(function() {
"use strict";
var wp;
(wp ||= {}).mediaUtils = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// package-external:@wordpress/element
var require_element = __commonJS({
"package-external:@wordpress/element"(exports, module) {
module.exports = window.wp.element;
}
});
// package-external:@wordpress/i18n
var require_i18n = __commonJS({
"package-external:@wordpress/i18n"(exports, module) {
module.exports = window.wp.i18n;
}
});
// package-external:@wordpress/deprecated
var require_deprecated = __commonJS({
"package-external:@wordpress/deprecated"(exports, module) {
module.exports = window.wp.deprecated;
}
});
// package-external:@wordpress/data
var require_data = __commonJS({
"package-external:@wordpress/data"(exports, module) {
module.exports = window.wp.data;
}
});
// package-external:@wordpress/core-data
var require_core_data = __commonJS({
"package-external:@wordpress/core-data"(exports, module) {
module.exports = window.wp.coreData;
}
});
// package-external:@wordpress/blob
var require_blob = __commonJS({
"package-external:@wordpress/blob"(exports, module) {
module.exports = window.wp.blob;
}
});
// package-external:@wordpress/api-fetch
var require_api_fetch = __commonJS({
"package-external:@wordpress/api-fetch"(exports, module) {
module.exports = window.wp.apiFetch;
}
});
// package-external:@wordpress/components
var require_components = __commonJS({
"package-external:@wordpress/components"(exports, module) {
module.exports = window.wp.components;
}
});
// package-external:@wordpress/primitives
var require_primitives = __commonJS({
"package-external:@wordpress/primitives"(exports, module) {
module.exports = window.wp.primitives;
}
});
// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
"vendor-external:react/jsx-runtime"(exports, module) {
module.exports = window.ReactJSXRuntime;
}
});
// package-external:@wordpress/compose
var require_compose = __commonJS({
"package-external:@wordpress/compose"(exports, module) {
module.exports = window.wp.compose;
}
});
// vendor-external:react
var require_react = __commonJS({
"vendor-external:react"(exports, module) {
module.exports = window.React;
}
});
// vendor-external:react-dom
var require_react_dom = __commonJS({
"vendor-external:react-dom"(exports, module) {
module.exports = window.ReactDOM;
}
});
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
"use strict";
(function() {
function is(x2, y2) {
return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
}
function useSyncExternalStore$2(subscribe2, getSnapshot) {
didWarnOld18Alpha || void 0 === React147.startTransition || (didWarnOld18Alpha = true, console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
));
var value = getSnapshot();
if (!didWarnUncachedGetSnapshot) {
var cachedValue = getSnapshot();
objectIs(value, cachedValue) || (console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"
), didWarnUncachedGetSnapshot = true);
}
cachedValue = useState58({
inst: { value, getSnapshot }
});
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
useLayoutEffect7(
function() {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
},
[subscribe2, value, getSnapshot]
);
useEffect52(
function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
return subscribe2(function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
});
},
[subscribe2]
);
useDebugValue2(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error2) {
return true;
}
}
function useSyncExternalStore$1(subscribe2, getSnapshot) {
return getSnapshot();
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React147 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState58 = React147.useState, useEffect52 = React147.useEffect, useLayoutEffect7 = React147.useLayoutEffect, useDebugValue2 = React147.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
exports.useSyncExternalStore = void 0 !== React147.useSyncExternalStore ? React147.useSyncExternalStore : shim;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
"node_modules/use-sync-external-store/shim/index.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_use_sync_external_store_shim_development();
}
}
});
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
var require_with_selector_development = __commonJS({
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
"use strict";
(function() {
function is(x2, y2) {
return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React147 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore4 = shim.useSyncExternalStore, useRef93 = React147.useRef, useEffect52 = React147.useEffect, useMemo70 = React147.useMemo, useDebugValue2 = React147.useDebugValue;
exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector2, isEqual) {
var instRef = useRef93(null);
if (null === instRef.current) {
var inst = { hasValue: false, value: null };
instRef.current = inst;
} else inst = instRef.current;
instRef = useMemo70(
function() {
function memoizedSelector(nextSnapshot) {
if (!hasMemo) {
hasMemo = true;
memoizedSnapshot = nextSnapshot;
nextSnapshot = selector2(nextSnapshot);
if (void 0 !== isEqual && inst.hasValue) {
var currentSelection = inst.value;
if (isEqual(currentSelection, nextSnapshot))
return memoizedSelection = currentSelection;
}
return memoizedSelection = nextSnapshot;
}
currentSelection = memoizedSelection;
if (objectIs(memoizedSnapshot, nextSnapshot))
return currentSelection;
var nextSelection = selector2(nextSnapshot);
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return memoizedSnapshot = nextSnapshot, currentSelection;
memoizedSnapshot = nextSnapshot;
return memoizedSelection = nextSelection;
}
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
return [
function() {
return memoizedSelector(getSnapshot());
},
null === maybeGetServerSnapshot ? void 0 : function() {
return memoizedSelector(maybeGetServerSnapshot());
}
];
},
[getSnapshot, getServerSnapshot, selector2, isEqual]
);
var value = useSyncExternalStore4(subscribe2, instRef[0], instRef[1]);
useEffect52(
function() {
inst.hasValue = true;
inst.value = value;
},
[value]
);
useDebugValue2(value);
return value;
};
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/use-sync-external-store/shim/with-selector.js
var require_with_selector = __commonJS({
"node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_with_selector_development();
}
}
});
// package-external:@wordpress/theme
var require_theme = __commonJS({
"package-external:@wordpress/theme"(exports, module) {
module.exports = window.wp.theme;
}
});
// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
"package-external:@wordpress/private-apis"(exports, module) {
module.exports = window.wp.privateApis;
}
});
// package-external:@wordpress/a11y
var require_a11y = __commonJS({
"package-external:@wordpress/a11y"(exports, module) {
module.exports = window.wp.a11y;
}
});
// package-external:@wordpress/warning
var require_warning = __commonJS({
"package-external:@wordpress/warning"(exports, module) {
module.exports = window.wp.warning;
}
});
// package-external:@wordpress/keycodes
var require_keycodes = __commonJS({
"package-external:@wordpress/keycodes"(exports, module) {
module.exports = window.wp.keycodes;
}
});
// node_modules/remove-accents/index.js
var require_remove_accents = __commonJS({
"node_modules/remove-accents/index.js"(exports, module) {
var characterMap = {
"\xC0": "A",
"\xC1": "A",
"\xC2": "A",
"\xC3": "A",
"\xC4": "A",
"\xC5": "A",
"\u1EA4": "A",
"\u1EAE": "A",
"\u1EB2": "A",
"\u1EB4": "A",
"\u1EB6": "A",
"\xC6": "AE",
"\u1EA6": "A",
"\u1EB0": "A",
"\u0202": "A",
"\u1EA2": "A",
"\u1EA0": "A",
"\u1EA8": "A",
"\u1EAA": "A",
"\u1EAC": "A",
"\xC7": "C",
"\u1E08": "C",
"\xC8": "E",
"\xC9": "E",
"\xCA": "E",
"\xCB": "E",
"\u1EBE": "E",
"\u1E16": "E",
"\u1EC0": "E",
"\u1E14": "E",
"\u1E1C": "E",
"\u0206": "E",
"\u1EBA": "E",
"\u1EBC": "E",
"\u1EB8": "E",
"\u1EC2": "E",
"\u1EC4": "E",
"\u1EC6": "E",
"\xCC": "I",
"\xCD": "I",
"\xCE": "I",
"\xCF": "I",
"\u1E2E": "I",
"\u020A": "I",
"\u1EC8": "I",
"\u1ECA": "I",
"\xD0": "D",
"\xD1": "N",
"\xD2": "O",
"\xD3": "O",
"\xD4": "O",
"\xD5": "O",
"\xD6": "O",
"\xD8": "O",
"\u1ED0": "O",
"\u1E4C": "O",
"\u1E52": "O",
"\u020E": "O",
"\u1ECE": "O",
"\u1ECC": "O",
"\u1ED4": "O",
"\u1ED6": "O",
"\u1ED8": "O",
"\u1EDC": "O",
"\u1EDE": "O",
"\u1EE0": "O",
"\u1EDA": "O",
"\u1EE2": "O",
"\xD9": "U",
"\xDA": "U",
"\xDB": "U",
"\xDC": "U",
"\u1EE6": "U",
"\u1EE4": "U",
"\u1EEC": "U",
"\u1EEE": "U",
"\u1EF0": "U",
"\xDD": "Y",
"\xE0": "a",
"\xE1": "a",
"\xE2": "a",
"\xE3": "a",
"\xE4": "a",
"\xE5": "a",
"\u1EA5": "a",
"\u1EAF": "a",
"\u1EB3": "a",
"\u1EB5": "a",
"\u1EB7": "a",
"\xE6": "ae",
"\u1EA7": "a",
"\u1EB1": "a",
"\u0203": "a",
"\u1EA3": "a",
"\u1EA1": "a",
"\u1EA9": "a",
"\u1EAB": "a",
"\u1EAD": "a",
"\xE7": "c",
"\u1E09": "c",
"\xE8": "e",
"\xE9": "e",
"\xEA": "e",
"\xEB": "e",
"\u1EBF": "e",
"\u1E17": "e",
"\u1EC1": "e",
"\u1E15": "e",
"\u1E1D": "e",
"\u0207": "e",
"\u1EBB": "e",
"\u1EBD": "e",
"\u1EB9": "e",
"\u1EC3": "e",
"\u1EC5": "e",
"\u1EC7": "e",
"\xEC": "i",
"\xED": "i",
"\xEE": "i",
"\xEF": "i",
"\u1E2F": "i",
"\u020B": "i",
"\u1EC9": "i",
"\u1ECB": "i",
"\xF0": "d",
"\xF1": "n",
"\xF2": "o",
"\xF3": "o",
"\xF4": "o",
"\xF5": "o",
"\xF6": "o",
"\xF8": "o",
"\u1ED1": "o",
"\u1E4D": "o",
"\u1E53": "o",
"\u020F": "o",
"\u1ECF": "o",
"\u1ECD": "o",
"\u1ED5": "o",
"\u1ED7": "o",
"\u1ED9": "o",
"\u1EDD": "o",
"\u1EDF": "o",
"\u1EE1": "o",
"\u1EDB": "o",
"\u1EE3": "o",
"\xF9": "u",
"\xFA": "u",
"\xFB": "u",
"\xFC": "u",
"\u1EE7": "u",
"\u1EE5": "u",
"\u1EED": "u",
"\u1EEF": "u",
"\u1EF1": "u",
"\xFD": "y",
"\xFF": "y",
"\u0100": "A",
"\u0101": "a",
"\u0102": "A",
"\u0103": "a",
"\u0104": "A",
"\u0105": "a",
"\u0106": "C",
"\u0107": "c",
"\u0108": "C",
"\u0109": "c",
"\u010A": "C",
"\u010B": "c",
"\u010C": "C",
"\u010D": "c",
"C\u0306": "C",
"c\u0306": "c",
"\u010E": "D",
"\u010F": "d",
"\u0110": "D",
"\u0111": "d",
"\u0112": "E",
"\u0113": "e",
"\u0114": "E",
"\u0115": "e",
"\u0116": "E",
"\u0117": "e",
"\u0118": "E",
"\u0119": "e",
"\u011A": "E",
"\u011B": "e",
"\u011C": "G",
"\u01F4": "G",
"\u011D": "g",
"\u01F5": "g",
"\u011E": "G",
"\u011F": "g",
"\u0120": "G",
"\u0121": "g",
"\u0122": "G",
"\u0123": "g",
"\u0124": "H",
"\u0125": "h",
"\u0126": "H",
"\u0127": "h",
"\u1E2A": "H",
"\u1E2B": "h",
"\u0128": "I",
"\u0129": "i",
"\u012A": "I",
"\u012B": "i",
"\u012C": "I",
"\u012D": "i",
"\u012E": "I",
"\u012F": "i",
"\u0130": "I",
"\u0131": "i",
"\u0132": "IJ",
"\u0133": "ij",
"\u0134": "J",
"\u0135": "j",
"\u0136": "K",
"\u0137": "k",
"\u1E30": "K",
"\u1E31": "k",
"K\u0306": "K",
"k\u0306": "k",
"\u0139": "L",
"\u013A": "l",
"\u013B": "L",
"\u013C": "l",
"\u013D": "L",
"\u013E": "l",
"\u013F": "L",
"\u0140": "l",
"\u0141": "l",
"\u0142": "l",
"\u1E3E": "M",
"\u1E3F": "m",
"M\u0306": "M",
"m\u0306": "m",
"\u0143": "N",
"\u0144": "n",
"\u0145": "N",
"\u0146": "n",
"\u0147": "N",
"\u0148": "n",
"\u0149": "n",
"N\u0306": "N",
"n\u0306": "n",
"\u014C": "O",
"\u014D": "o",
"\u014E": "O",
"\u014F": "o",
"\u0150": "O",
"\u0151": "o",
"\u0152": "OE",
"\u0153": "oe",
"P\u0306": "P",
"p\u0306": "p",
"\u0154": "R",
"\u0155": "r",
"\u0156": "R",
"\u0157": "r",
"\u0158": "R",
"\u0159": "r",
"R\u0306": "R",
"r\u0306": "r",
"\u0212": "R",
"\u0213": "r",
"\u015A": "S",
"\u015B": "s",
"\u015C": "S",
"\u015D": "s",
"\u015E": "S",
"\u0218": "S",
"\u0219": "s",
"\u015F": "s",
"\u0160": "S",
"\u0161": "s",
"\u0162": "T",
"\u0163": "t",
"\u021B": "t",
"\u021A": "T",
"\u0164": "T",
"\u0165": "t",
"\u0166": "T",
"\u0167": "t",
"T\u0306": "T",
"t\u0306": "t",
"\u0168": "U",
"\u0169": "u",
"\u016A": "U",
"\u016B": "u",
"\u016C": "U",
"\u016D": "u",
"\u016E": "U",
"\u016F": "u",
"\u0170": "U",
"\u0171": "u",
"\u0172": "U",
"\u0173": "u",
"\u0216": "U",
"\u0217": "u",
"V\u0306": "V",
"v\u0306": "v",
"\u0174": "W",
"\u0175": "w",
"\u1E82": "W",
"\u1E83": "w",
"X\u0306": "X",
"x\u0306": "x",
"\u0176": "Y",
"\u0177": "y",
"\u0178": "Y",
"Y\u0306": "Y",
"y\u0306": "y",
"\u0179": "Z",
"\u017A": "z",
"\u017B": "Z",
"\u017C": "z",
"\u017D": "Z",
"\u017E": "z",
"\u017F": "s",
"\u0192": "f",
"\u01A0": "O",
"\u01A1": "o",
"\u01AF": "U",
"\u01B0": "u",
"\u01CD": "A",
"\u01CE": "a",
"\u01CF": "I",
"\u01D0": "i",
"\u01D1": "O",
"\u01D2": "o",
"\u01D3": "U",
"\u01D4": "u",
"\u01D5": "U",
"\u01D6": "u",
"\u01D7": "U",
"\u01D8": "u",
"\u01D9": "U",
"\u01DA": "u",
"\u01DB": "U",
"\u01DC": "u",
"\u1EE8": "U",
"\u1EE9": "u",
"\u1E78": "U",
"\u1E79": "u",
"\u01FA": "A",
"\u01FB": "a",
"\u01FC": "AE",
"\u01FD": "ae",
"\u01FE": "O",
"\u01FF": "o",
"\xDE": "TH",
"\xFE": "th",
"\u1E54": "P",
"\u1E55": "p",
"\u1E64": "S",
"\u1E65": "s",
"X\u0301": "X",
"x\u0301": "x",
"\u0403": "\u0413",
"\u0453": "\u0433",
"\u040C": "\u041A",
"\u045C": "\u043A",
"A\u030B": "A",
"a\u030B": "a",
"E\u030B": "E",
"e\u030B": "e",
"I\u030B": "I",
"i\u030B": "i",
"\u01F8": "N",
"\u01F9": "n",
"\u1ED2": "O",
"\u1ED3": "o",
"\u1E50": "O",
"\u1E51": "o",
"\u1EEA": "U",
"\u1EEB": "u",
"\u1E80": "W",
"\u1E81": "w",
"\u1EF2": "Y",
"\u1EF3": "y",
"\u0200": "A",
"\u0201": "a",
"\u0204": "E",
"\u0205": "e",
"\u0208": "I",
"\u0209": "i",
"\u020C": "O",
"\u020D": "o",
"\u0210": "R",
"\u0211": "r",
"\u0214": "U",
"\u0215": "u",
"B\u030C": "B",
"b\u030C": "b",
"\u010C\u0323": "C",
"\u010D\u0323": "c",
"\xCA\u030C": "E",
"\xEA\u030C": "e",
"F\u030C": "F",
"f\u030C": "f",
"\u01E6": "G",
"\u01E7": "g",
"\u021E": "H",
"\u021F": "h",
"J\u030C": "J",
"\u01F0": "j",
"\u01E8": "K",
"\u01E9": "k",
"M\u030C": "M",
"m\u030C": "m",
"P\u030C": "P",
"p\u030C": "p",
"Q\u030C": "Q",
"q\u030C": "q",
"\u0158\u0329": "R",
"\u0159\u0329": "r",
"\u1E66": "S",
"\u1E67": "s",
"V\u030C": "V",
"v\u030C": "v",
"W\u030C": "W",
"w\u030C": "w",
"X\u030C": "X",
"x\u030C": "x",
"Y\u030C": "Y",
"y\u030C": "y",
"A\u0327": "A",
"a\u0327": "a",
"B\u0327": "B",
"b\u0327": "b",
"\u1E10": "D",
"\u1E11": "d",
"\u0228": "E",
"\u0229": "e",
"\u0190\u0327": "E",
"\u025B\u0327": "e",
"\u1E28": "H",
"\u1E29": "h",
"I\u0327": "I",
"i\u0327": "i",
"\u0197\u0327": "I",
"\u0268\u0327": "i",
"M\u0327": "M",
"m\u0327": "m",
"O\u0327": "O",
"o\u0327": "o",
"Q\u0327": "Q",
"q\u0327": "q",
"U\u0327": "U",
"u\u0327": "u",
"X\u0327": "X",
"x\u0327": "x",
"Z\u0327": "Z",
"z\u0327": "z",
"\u0439": "\u0438",
"\u0419": "\u0418",
"\u0451": "\u0435",
"\u0401": "\u0415"
};
var chars = Object.keys(characterMap).join("|");
var allAccents = new RegExp(chars, "g");
var firstAccent = new RegExp(chars, "");
function matcher(match2) {
return characterMap[match2];
}
var removeAccents2 = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents2;
module.exports.has = hasAccents;
module.exports.remove = removeAccents2;
}
});
// node_modules/fast-deep-equal/es6/index.js
var require_es6 = __commonJS({
"node_modules/fast-deep-equal/es6/index.js"(exports, module) {
"use strict";
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == "object" && typeof b == "object") {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0; )
if (!equal(a[i], b[i])) return false;
return true;
}
if (a instanceof Map && b instanceof Map) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if (a instanceof Set && b instanceof Set) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0; )
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0; ) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
return a !== a && b !== b;
};
}
});
// package-external:@wordpress/date
var require_date = __commonJS({
"package-external:@wordpress/date"(exports, module) {
module.exports = window.wp.date;
}
});
// package-external:@wordpress/preferences
var require_preferences = __commonJS({
"package-external:@wordpress/preferences"(exports, module) {
module.exports = window.wp.preferences;
}
});
// package-external:@wordpress/url
var require_url = __commonJS({
"package-external:@wordpress/url"(exports, module) {
module.exports = window.wp.url;
}
});
// package-external:@wordpress/notices
var require_notices = __commonJS({
"package-external:@wordpress/notices"(exports, module) {
module.exports = window.wp.notices;
}
});
// packages/media-utils/build-module/index.mjs
var index_exports = {};
__export(index_exports, {
MediaUpload: () => media_upload_default,
privateApis: () => privateApis,
transformAttachment: () => transformAttachment,
uploadMedia: () => uploadMedia,
validateFileSize: () => validateFileSize,
validateMimeType: () => validateMimeType,
validateMimeTypeForUser: () => validateMimeTypeForUser
});
// packages/media-utils/build-module/components/media-upload/index.mjs
var import_element = __toESM(require_element(), 1);
var import_i18n = __toESM(require_i18n(), 1);
var import_deprecated = __toESM(require_deprecated(), 1);
var import_data = __toESM(require_data(), 1);
// packages/media-utils/build-module/utils/invalidate-attachment-resolutions.mjs
var import_core_data = __toESM(require_core_data(), 1);
function invalidateAttachmentResolutions(registry) {
const resolvers = registry.select(import_core_data.store).getCachedResolvers();
const entityRecordResolutions = resolvers.getEntityRecords;
entityRecordResolutions?.forEach((_value, args) => {
if (args[0] === "postType" && args[1] === "attachment") {
registry.dispatch(import_core_data.store).invalidateResolution("getEntityRecords", args);
}
});
}
// packages/media-utils/build-module/components/media-upload/index.mjs
var DEFAULT_EMPTY_GALLERY = [];
var getFeaturedImageMediaFrame = () => {
const { wp } = window;
return wp.media.view.MediaFrame.Select.extend({
/**
* Enables the Set Featured Image Button.
*
* @param {Object} toolbar toolbar for featured image state
* @return {void}
*/
featuredImageToolbar(toolbar) {
this.createSelectToolbar(toolbar, {
text: wp.media.view.l10n.setFeaturedImage,
state: this.options.state
});
},
/**
* Handle the edit state requirements of selected media item.
*
* @return {void}
*/
editState() {
const selection = this.state("featured-image").get("selection");
const view = new wp.media.view.EditImage({
model: selection.single(),
controller: this
}).render();
this.content.set(view);
view.loadEditor();
},
/**
* Create the default states.
*
* @return {void}
*/
createStates: function createStates() {
this.on(
"toolbar:create:featured-image",
this.featuredImageToolbar,
this
);
this.on("content:render:edit-image", this.editState, this);
this.states.add([
new wp.media.controller.FeaturedImage(),
new wp.media.controller.EditImage({
model: this.options.editImage
})
]);
}
});
};
var getSingleMediaFrame = () => {
const { wp } = window;
return wp.media.view.MediaFrame.Select.extend({
/**
* Create the default states on the frame.
*/
createStates() {
const options = this.options;
if (this.options.states) {
return;
}
this.states.add([
// Main states.
new wp.media.controller.Library({
library: wp.media.query(options.library),
multiple: options.multiple,
title: options.title,
priority: 20,
filterable: "uploaded"
// Allow filtering by uploaded images.
}),
new wp.media.controller.EditImage({
model: options.editImage
})
]);
}
});
};
var getGalleryDetailsMediaFrame = () => {
const { wp } = window;
return wp.media.view.MediaFrame.Post.extend({
/**
* Set up gallery toolbar.
*
* @return {void}
*/
galleryToolbar() {
const editing = this.state().get("editing");
this.toolbar.set(
new wp.media.view.Toolbar({
controller: this,
items: {
insert: {
style: "primary",
text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
priority: 80,
requires: { library: true },
/**
* @fires wp.media.controller.State#update
*/
click() {
const controller = this.controller, state = controller.state();
controller.close();
state.trigger(
"update",
state.get("library")
);
controller.setState(controller.options.state);
controller.reset();
}
}
}
})
);
},
/**
* Handle the edit state requirements of selected media item.
*
* @return {void}
*/
editState() {
const selection = this.state("gallery").get("selection");
const view = new wp.media.view.EditImage({
model: selection.single(),
controller: this
}).render();
this.content.set(view);
view.loadEditor();
},
/**
* Create the default states.
*
* @return {void}
*/
createStates: function createStates() {
this.on("toolbar:create:main-gallery", this.galleryToolbar, this);
this.on("content:render:edit-image", this.editState, this);
this.states.add([
new wp.media.controller.Library({
id: "gallery",
title: wp.media.view.l10n.createGalleryTitle,
priority: 40,
toolbar: "main-gallery",
filterable: "uploaded",
multiple: "add",
editable: false,
library: wp.media.query({
type: "image",
...this.options.library
})
}),
new wp.media.controller.EditImage({
model: this.options.editImage
}),
new wp.media.controller.GalleryEdit({
library: this.options.selection,
editing: this.options.editing,
menu: "gallery",
displaySettings: false,
multiple: true
}),
new wp.media.controller.GalleryAdd()
]);
}
});
};
var slimImageObject = (img) => {
const attrSet = [
"sizes",
"mime",
"type",
"subtype",
"id",
"url",
"alt",
"link",
"caption"
];
return attrSet.reduce((result, key) => {
if (img?.hasOwnProperty(key)) {
result[key] = img[key];
}
return result;
}, {});
};
var getAttachmentsCollection = (ids) => {
const { wp } = window;
return wp.media.query({
order: "ASC",
orderby: "post__in",
post__in: ids,
posts_per_page: -1,
query: true,
type: "image"
});
};
var MediaUpload = class extends import_element.Component {
constructor() {
super(...arguments);
this.openModal = this.openModal.bind(this);
this.onOpen = this.onOpen.bind(this);
this.onSelect = this.onSelect.bind(this);
this.onUpdate = this.onUpdate.bind(this);
this.onClose = this.onClose.bind(this);
this.stopUndoRedoPropagation = this.stopUndoRedoPropagation.bind(this);
}
stopUndoRedoPropagation(event) {
if (!event.metaKey && !event.ctrlKey) {
return;
}
const character = event.key?.toLowerCase();
if (character !== "z" && character !== "y") {
return;
}
event.stopPropagation();
}
initializeListeners() {
this.frame.on("select", this.onSelect);
this.frame.on("update", this.onUpdate);
this.frame.on("open", this.onOpen);
this.frame.on("close", this.onClose);
}
/**
* Sets the Gallery frame and initializes listeners.
*
* @return {void}
*/
buildAndSetGalleryFrame() {
const {
addToGallery = false,
allowedTypes,
multiple = false,
value = DEFAULT_EMPTY_GALLERY
} = this.props;
if (value === this.lastGalleryValue) {
return;
}
const { wp } = window;
this.lastGalleryValue = value;
if (this.frame) {
this.frame.remove();
}
let currentState;
if (addToGallery) {
currentState = "gallery-library";
} else {
currentState = value && value.length ? "gallery-edit" : "gallery";
}
if (!this.GalleryDetailsMediaFrame) {
this.GalleryDetailsMediaFrame = getGalleryDetailsMediaFrame();
}
const attachments = getAttachmentsCollection(value);
const selection = new wp.media.model.Selection(attachments.models, {
props: attachments.props.toJSON(),
multiple
});
this.frame = new this.GalleryDetailsMediaFrame({
mimeType: allowedTypes,
state: currentState,
multiple,
selection,
editing: !!value?.length
});
wp.media.frame = this.frame;
this.initializeListeners();
}
/**
* Initializes the Media Library requirements for the featured image flow.
*
* @return {void}
*/
buildAndSetFeatureImageFrame() {
const { wp } = window;
const { value: featuredImageId, multiple, allowedTypes } = this.props;
const featuredImageFrame = getFeaturedImageMediaFrame();
const attachments = getAttachmentsCollection(featuredImageId);
const selection = new wp.media.model.Selection(attachments.models, {
props: attachments.props.toJSON()
});
this.frame = new featuredImageFrame({
mimeType: allowedTypes,
state: "featured-image",
multiple,
selection,
editing: featuredImageId
});
wp.media.frame = this.frame;
wp.media.view.settings.post = {
...wp.media.view.settings.post,
featuredImageId: featuredImageId || -1
};
}
/**
* Initializes the Media Library requirements for the single image flow.
*
* @return {void}
*/
buildAndSetSingleMediaFrame() {
const { wp } = window;
const {
allowedTypes,
multiple = false,
title = (0, import_i18n.__)("Select or Upload Media"),
value
} = this.props;
const frameConfig = {
title,
multiple
};
if (!!allowedTypes) {
frameConfig.library = { type: allowedTypes };
}
if (this.frame) {
this.frame.remove();
}
const singleImageFrame = getSingleMediaFrame();
const attachments = getAttachmentsCollection(value);
const selection = new wp.media.model.Selection(attachments.models, {
props: attachments.props.toJSON()
});
this.frame = new singleImageFrame({
mimeType: allowedTypes,
multiple,
selection,
...frameConfig
});
wp.media.frame = this.frame;
}
componentWillUnmount() {
this.detachUndoRedoGuard();
this.frame?.close();
this.frame?.modal?.remove();
this.frame?.remove();
}
detachUndoRedoGuard() {
if (this.frame?.modal?.el) {
this.frame.modal.el.removeEventListener(
"keydown",
this.stopUndoRedoPropagation,
true
);
}
}
onUpdate(selections) {
const { onSelect, multiple = false } = this.props;
const state = this.frame.state();
const selectedImages = selections || state.get("selection");
if (!selectedImages || !selectedImages.models.length) {
return;
}
if (multiple) {
onSelect(
selectedImages.models.map(
(model) => slimImageObject(model.toJSON())
)
);
} else {
onSelect(slimImageObject(selectedImages.models[0].toJSON()));
}
}
onSelect() {
const { onSelect, multiple = false } = this.props;
const attachment = this.frame.state().get("selection").toJSON();
onSelect(multiple ? attachment : attachment[0]);
}
onOpen() {
const { wp } = window;
const { value } = this.props;
this.updateCollection();
if (this.frame?.modal?.el) {
this.frame.modal.el.addEventListener(
"keydown",
this.stopUndoRedoPropagation,
true
);
}
if (this.props.mode) {
this.frame.content.mode(this.props.mode);
}
const hasMedia = Array.isArray(value) ? !!value?.length : !!value;
if (!hasMedia) {
return;
}
const isGallery = this.props.gallery;
const selection = this.frame.state().get("selection");
const valueArray = Array.isArray(value) ? value : [value];
if (!isGallery) {
valueArray.forEach((id) => {
selection.add(wp.media.attachment(id));
});
}
const attachments = getAttachmentsCollection(valueArray);
attachments.more().done(function() {
if (isGallery && attachments?.models?.length) {
selection.add(attachments.models);
}
});
}
onClose() {
const { onClose } = this.props;
this.detachUndoRedoGuard();
if (onClose) {
onClose();
}
invalidateAttachmentResolutions({ select: import_data.select, dispatch: import_data.dispatch });
this.frame.detach();
}
updateCollection() {
const frameContent = this.frame.content.get();
if (frameContent && frameContent.collection) {
const collection = frameContent.collection;
collection.toArray().forEach((model) => model.trigger("destroy", model));
collection.mirroring._hasMore = true;
collection.more();
}
}
openModal() {
const {
gallery = false,
featuredImageFlow,
unstableFeaturedImageFlow,
modalClass
} = this.props;
if (unstableFeaturedImageFlow !== void 0 && featuredImageFlow === void 0) {
(0, import_deprecated.default)(
"wp.mediaUtils.MediaUpload unstableFeaturedImageFlow prop",
{
since: "7.2",
alternative: "featuredImageFlow",
version: "7.4"
}
);
}
if (gallery) {
this.buildAndSetGalleryFrame();
} else {
this.buildAndSetSingleMediaFrame();
}
if (modalClass) {
this.frame.$el.addClass(modalClass);
}
if (featuredImageFlow ?? unstableFeaturedImageFlow) {
this.buildAndSetFeatureImageFrame();
}
this.initializeListeners();
this.frame.open();
}
render() {
return this.props.render({ open: this.openModal });
}
};
var media_upload_default = MediaUpload;
// packages/media-utils/build-module/utils/upload-media.mjs
var import_i18n6 = __toESM(require_i18n(), 1);
var import_blob = __toESM(require_blob(), 1);
// packages/media-utils/build-module/utils/upload-to-server.mjs
var import_api_fetch = __toESM(require_api_fetch(), 1);
// packages/media-utils/build-module/utils/flatten-form-data.mjs
function isPlainObject(data) {
return data !== null && typeof data === "object" && Object.getPrototypeOf(data) === Object.prototype;
}
function flattenFormData(formData, key, data) {
if (Array.isArray(data) || isPlainObject(data)) {
for (const [name, value] of Object.entries(data)) {
flattenFormData(formData, `${key}[${name}]`, value);
}
} else if (data !== void 0) {
formData.append(key, String(data));
}
}
// packages/media-utils/build-module/utils/transform-attachment.mjs
function transformAttachment(attachment) {
const { alt_text, source_url, ...savedMediaProps } = attachment;
return {
...savedMediaProps,
alt: attachment.alt_text,
caption: attachment.caption?.raw ?? "",
title: attachment.title.raw,
url: attachment.source_url,
poster: attachment._embedded?.["wp:featuredmedia"]?.[0]?.source_url || void 0
};
}
// packages/media-utils/build-module/utils/upload-to-server.mjs
async function uploadToServer(file, additionalData = {}, signal) {
const data = new FormData();
data.append("file", file, file.name || file.type.replace("/", "."));
for (const [key, value] of Object.entries(additionalData)) {
flattenFormData(data, key, value);
}
return transformAttachment(
await (0, import_api_fetch.default)({
// This allows the video block to directly get a video's poster image.
path: "/wp/v2/media?_embed=wp:featuredmedia",
body: data,
method: "POST",
signal
})
);
}
// packages/media-utils/build-module/utils/validate-mime-type.mjs
var import_i18n2 = __toESM(require_i18n(), 1);
// packages/media-utils/build-module/utils/upload-error.mjs
var UploadError = class extends Error {
code;
file;
constructor({ code, message: message2, file, cause }) {
super(message2, { cause });
Object.setPrototypeOf(this, new.target.prototype);
this.code = code;
this.file = file;
}
};
// packages/media-utils/build-module/utils/validate-mime-type.mjs
function validateMimeType(file, allowedTypes) {
if (!allowedTypes || allowedTypes.includes("*")) {
return;
}
const isAllowedType = allowedTypes.some((allowedType) => {
if (allowedType.includes("/")) {
return allowedType === file.type;
}
return file.type.startsWith(`${allowedType}/`);
});
if (file.type && !isAllowedType) {
throw new UploadError({
code: "MIME_TYPE_NOT_SUPPORTED",
message: (0, import_i18n2.sprintf)(
// translators: %s: file name.
(0, import_i18n2.__)("%s: Sorry, this file type is not supported here."),
file.name
),
file
});
}
}
// packages/media-utils/build-module/utils/validate-mime-type-for-user.mjs
var import_i18n3 = __toESM(require_i18n(), 1);
// packages/media-utils/build-module/utils/get-mime-types-array.mjs
function getMimeTypesArray(wpMimeTypesObject) {
if (!wpMimeTypesObject) {
return null;
}
return Object.entries(wpMimeTypesObject).flatMap(
([extensionsString, mime]) => {
const [type] = mime.split("/");
const extensions = extensionsString.split("|");
return [
mime,
...extensions.map(
(extension) => `${type}/${extension}`
)
];
}
);
}
// packages/media-utils/build-module/utils/validate-mime-type-for-user.mjs
function validateMimeTypeForUser(file, wpAllowedMimeTypes) {
const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes);
if (!allowedMimeTypesForUser) {
return;
}
const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes(
file.type
);
if (file.type && !isAllowedMimeTypeForUser) {
throw new UploadError({
code: "MIME_TYPE_NOT_ALLOWED_FOR_USER",
message: (0, import_i18n3.sprintf)(
// translators: %s: file name.
(0, import_i18n3.__)(
"%s: Sorry, you are not allowed to upload this file type."
),
file.name
),
file
});
}
}
// packages/media-utils/build-module/utils/validate-file-size.mjs
var import_i18n4 = __toESM(require_i18n(), 1);
function validateFileSize(file, maxUploadFileSize) {
if (file.size <= 0) {
throw new UploadError({
code: "EMPTY_FILE",
message: (0, import_i18n4.sprintf)(
// translators: %s: file name.
(0, import_i18n4.__)("%s: This file is empty."),
file.name
),
file
});
}
if (maxUploadFileSize && file.size > maxUploadFileSize) {
throw new UploadError({
code: "SIZE_ABOVE_LIMIT",
message: (0, import_i18n4.sprintf)(
// translators: %s: file name.
(0, import_i18n4.__)(
"%s: This file exceeds the maximum upload size for this site."
),
file.name
),
file
});
}
}
// packages/media-utils/build-module/utils/get-upload-error-message.mjs
var import_i18n5 = __toESM(require_i18n(), 1);
var OPAQUE_ERROR_CODES = ["invalid_json", "unknown_error"];
function getUploadErrorMessage(error2, fileName) {
const serverError = (0, import_i18n5.sprintf)(
/* translators: %s: file name */
(0, import_i18n5.__)('Failed to upload "%s". Please try again.'),
fileName
);
if (typeof error2 === "string") {
return error2 || serverError;
}
const { code, message: message2 } = error2 ?? {};
if (typeof code === "string" && OPAQUE_ERROR_CODES.includes(code)) {
return serverError;
}
return typeof message2 === "string" && message2 ? message2 : serverError;
}
// packages/media-utils/build-module/utils/upload-media.mjs
function uploadMedia({
wpAllowedMimeTypes,
allowedTypes,
additionalData = {},
filesList,
maxUploadFileSize,
onError,
onFileChange,
signal,
multiple = true
}) {
if (!multiple && filesList.length > 1) {
onError?.(new Error((0, import_i18n6.__)("Only one file can be used here.")));
return;
}
const validFiles = [];
const filesSet = [];
const setAndUpdateFiles = (index2, value) => {
if (!window.__clientSideMediaProcessing) {
if (filesSet[index2]?.url) {
(0, import_blob.revokeBlobURL)(filesSet[index2].url);
}
}
filesSet[index2] = value;
onFileChange?.(
filesSet.filter((attachment) => attachment !== null)
);
};
for (const mediaFile of filesList) {
try {
validateMimeTypeForUser(mediaFile, wpAllowedMimeTypes);
} catch (error2) {
onError?.(error2);
continue;
}
try {
validateMimeType(mediaFile, allowedTypes);
} catch (error2) {
onError?.(error2);
continue;
}
try {
validateFileSize(mediaFile, maxUploadFileSize);
} catch (error2) {
onError?.(error2);
continue;
}
validFiles.push(mediaFile);
if (!window.__clientSideMediaProcessing) {
filesSet.push({ url: (0, import_blob.createBlobURL)(mediaFile) });
onFileChange?.(filesSet);
}
}
validFiles.map(async (file, index2) => {
try {
const attachment = await uploadToServer(
file,
additionalData,
signal
);
setAndUpdateFiles(index2, attachment);
} catch (error2) {
setAndUpdateFiles(index2, null);
onError?.(
new UploadError({
code: "GENERAL",
message: getUploadErrorMessage(error2, file.name),
file,
cause: error2 instanceof Error ? error2 : void 0
})
);
}
});
}
// packages/media-utils/build-module/utils/sideload-to-server.mjs
var import_api_fetch2 = __toESM(require_api_fetch(), 1);
async function sideloadToServer(file, attachmentId, additionalData = {}, signal) {
const data = new FormData();
data.append("file", file, file.name || file.type.replace("/", "."));
for (const [key, value] of Object.entries(additionalData)) {
flattenFormData(data, key, value);
}
return (0, import_api_fetch2.default)({
path: `/wp/v2/media/${attachmentId}/sideload`,
body: data,
method: "POST",
signal
});
}
// packages/media-utils/build-module/utils/sideload-media.mjs
var noop = () => {
};
async function sideloadMedia({
file,
attachmentId,
additionalData = {},
signal,
onSuccess,
onError = noop
}) {
try {
const subSizeData = await sideloadToServer(
file,
attachmentId,
additionalData,
signal
);
onSuccess?.(subSizeData);
} catch (error2) {
onError(
new UploadError({
code: "GENERAL",
message: getUploadErrorMessage(error2, file.name),
file,
cause: error2 instanceof Error ? error2 : void 0
})
);
}
}
// node_modules/clsx/dist/clsx.mjs
function r(e) {
var t, f, n = "";
if ("string" == typeof e || "number" == typeof e) n += e;
else if ("object" == typeof e) if (Array.isArray(e)) {
var o = e.length;
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
} else for (f in e) e[f] && (n && (n += " "), n += f);
return n;
}
function clsx() {
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
return n;
}
var clsx_default = clsx;
// packages/media-utils/build-module/components/media-upload-modal/index.mjs
var import_element150 = __toESM(require_element(), 1);
var import_i18n79 = __toESM(require_i18n(), 1);
var import_core_data6 = __toESM(require_core_data(), 1);
var import_data14 = __toESM(require_data(), 1);
var import_components54 = __toESM(require_components(), 1);
// packages/icons/build-module/library/arrow-down.mjs
var import_primitives = __toESM(require_primitives(), 1);
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M12 4V19M7 14L12 19L17 14", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/arrow-left.mjs
var import_primitives2 = __toESM(require_primitives(), 1);
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M20 12L5 12M10 7L5 12L10 17", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/arrow-right.mjs
var import_primitives3 = __toESM(require_primitives(), 1);
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M4 12L19 12M14 17L19 12L14 7", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/arrow-up.mjs
var import_primitives4 = __toESM(require_primitives(), 1);
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
var arrow_up_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M12 20L12 5M17 10L12 5L7 10", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/audio.mjs
var import_primitives5 = __toESM(require_primitives(), 1);
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var audio_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M13.25 16.5C13.25 18.0188 12.0188 19.25 10.5 19.25C8.98122 19.25 7.75 18.0188 7.75 16.5C7.75 14.9812 8.98122 13.75 10.5 13.75C12.0188 13.75 13.25 14.9812 13.25 16.5Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M10.5 19.25C12.0188 19.25 13.25 18.0188 13.25 16.5C13.25 14.9812 12.0188 13.75 10.5 13.75C8.98122 13.75 7.75 14.9812 7.75 16.5C7.75 18.0188 8.98122 19.25 10.5 19.25ZM10.5 19.25C13.4867 19.25 13.75 16.5 13.75 15.1379V7.99998C13.75 4.9108 16.4 5.00254 18 5.00233", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/block-table.mjs
var import_primitives6 = __toESM(require_primitives(), 1);
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M4.75 9.5V6C4.75 5.30964 5.30964 4.75 6 4.75L18 4.75C18.6904 4.75 19.25 5.30964 19.25 6V9.5M4.75 9.5H12M4.75 9.5V14.5M19.25 9.5H12M19.25 9.5V14.5M12 9.5V14.5M12 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V14.5M12 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V14.5M12 19.25V14.5M12 14.5H19.25M12 14.5H4.75", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/category.mjs
var import_primitives7 = __toESM(require_primitives(), 1);
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
var category_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H9C9.69036 4.75 10.25 5.30964 10.25 6V9C10.25 9.69036 9.69036 10.25 9 10.25H6C5.30964 10.25 4.75 9.69036 4.75 9V6Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M4.75 15C4.75 14.3096 5.30964 13.75 6 13.75H9C9.69036 13.75 10.25 14.3096 10.25 15V18C10.25 18.6904 9.69036 19.25 9 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M13.75 6C13.75 5.30964 14.3096 4.75 15 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V9C19.25 9.69036 18.6904 10.25 18 10.25H15C14.3096 10.25 13.75 9.69036 13.75 9V6Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M13.75 15C13.75 14.3096 14.3096 13.75 15 13.75H18C18.6904 13.75 19.25 14.3096 19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15C14.3096 19.25 13.75 18.6904 13.75 18V15Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/check.mjs
var import_primitives8 = __toESM(require_primitives(), 1);
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
var check_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M7 12L10 15L17 8", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/chevron-down.mjs
var import_primitives9 = __toESM(require_primitives(), 1);
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/chevron-left.mjs
var import_primitives10 = __toESM(require_primitives(), 1);
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/chevron-right-small.mjs
var import_primitives11 = __toESM(require_primitives(), 1);
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/chevron-right.mjs
var import_primitives12 = __toESM(require_primitives(), 1);
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/close-small.mjs
var import_primitives13 = __toESM(require_primitives(), 1);
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/cog.mjs
var import_primitives14 = __toESM(require_primitives(), 1);
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var cog_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M5.38646 8.95505C5.36302 8.99564 5.37092 9.04706 5.40547 9.07874L6.96476 10.509C7.08306 10.1089 7.24777 9.72864 7.45264 9.37456C7.66022 9.01579 7.90904 8.68387 8.19262 8.38527L6.17287 7.74956C6.12816 7.73549 6.07968 7.75436 6.05624 7.79495L5.38646 8.95505Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12.6698 19.25C12.7167 19.25 12.7573 19.2174 12.7674 19.1717L13.2265 17.106C12.833 17.2001 12.4223 17.25 12 17.25C11.5777 17.25 11.167 17.2001 10.7736 17.106L11.2326 19.1717C11.2428 19.2174 11.2834 19.25 11.3303 19.25L12.6698 19.25Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M11.3303 4.75C11.2834 4.75 11.2428 4.78255 11.2326 4.82831L10.7736 6.89403C11.167 6.79986 11.5777 6.75 12 6.75C12.4223 6.75 12.833 6.79987 13.2265 6.89403L12.7674 4.82831C12.7573 4.78255 12.7167 4.75 12.6698 4.75L11.3303 4.75Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M17.9438 7.79495C17.9204 7.75436 17.8719 7.73549 17.8272 7.74956L15.8074 8.38528C16.091 8.68388 16.3398 9.0158 16.5474 9.37457C16.7523 9.72865 16.917 10.1089 17.0353 10.509L18.5946 9.07874C18.6291 9.04706 18.637 8.99564 18.6136 8.95505L17.9438 7.79495Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M6.05625 16.205C6.07968 16.2456 6.12816 16.2645 6.17287 16.2504L8.19262 15.6147C7.90904 15.3161 7.66022 14.9842 7.45264 14.6254C7.24777 14.2714 7.08307 13.8911 6.96476 13.491L5.40547 14.9213C5.37093 14.9529 5.36303 15.0044 5.38646 15.045L6.05625 16.205Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M18.6136 15.0449C18.637 15.0044 18.6291 14.9529 18.5946 14.9213L17.0353 13.491C16.917 13.8911 16.7523 14.2713 16.5474 14.6254C16.3398 14.9842 16.091 15.3161 15.8074 15.6147L17.8272 16.2504C17.8719 16.2645 17.9204 16.2456 17.9438 16.205L18.6136 15.0449Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 6.75C14.8995 6.75 17.25 9.10051 17.25 12C17.25 14.8995 14.8995 17.25 12 17.25C9.10051 17.25 6.75 14.8995 6.75 12C6.75 9.10051 9.10051 6.75 12 6.75Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/comment-author-avatar.mjs
var import_primitives15 = __toESM(require_primitives(), 1);
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var comment_author_avatar_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M8 18.0476V16C8 14.8954 8.89543 14 10 14H14C15.1046 14 16 14.8954 16 16V18.0476", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M12 4.75C7.99594 4.75 4.75 7.99593 4.75 12C4.75 16.0041 7.99593 19.25 12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M13.75 10C13.75 10.9665 12.9665 11.75 12 11.75C11.0335 11.75 10.25 10.9665 10.25 10C10.25 9.0335 11.0335 8.25 12 8.25C12.9665 8.25 13.75 9.0335 13.75 10Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/envelope.mjs
var import_primitives16 = __toESM(require_primitives(), 1);
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M20.25 8.5V7C20.25 6.30964 19.6904 5.75 19 5.75H5C4.30964 5.75 3.75 6.30964 3.75 7V8.5M20.25 8.5V17C20.25 17.6904 19.6904 18.25 19 18.25H5C4.30964 18.25 3.75 17.6904 3.75 17V8.5M20.25 8.5L12 14.5L3.75 8.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/error.mjs
var import_primitives17 = __toESM(require_primitives(), 1);
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var error_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/file.mjs
var import_primitives18 = __toESM(require_primitives(), 1);
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
var file_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives18.Path, { d: "M3.75 6V17.5C3.75 18.1904 4.30964 18.75 5 18.75H19C19.6904 18.75 20.25 18.1904 20.25 17.5V8.5C20.25 7.80964 19.6904 7.25 19 7.25H13.3463C12.8352 7.25 12.3755 6.93881 12.1857 6.46424L11.8143 5.53576C11.6245 5.06119 11.1648 4.75 10.6537 4.75H5C4.30964 4.75 3.75 5.30964 3.75 6Z", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/format-list-bullets-rtl.mjs
var import_primitives19 = __toESM(require_primitives(), 1);
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M13 8H4M13 16H4", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 9.25C17.3096 9.25 16.75 8.69036 16.75 8C16.75 7.30964 17.3096 6.75 18 6.75C18.6904 6.75 19.25 7.30964 19.25 8C19.25 8.69036 18.6904 9.25 18 9.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 17.25C17.3096 17.25 16.75 16.6904 16.75 16C16.75 15.3096 17.3096 14.75 18 14.75C18.6904 14.75 19.25 15.3096 19.25 16C19.25 16.6904 18.6904 17.25 18 17.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 9.25C17.3096 9.25 16.75 8.69036 16.75 8C16.75 7.30964 17.3096 6.75 18 6.75C18.6904 6.75 19.25 7.30964 19.25 8C19.25 8.69036 18.6904 9.25 18 9.25Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives19.Path, { d: "M18 17.25C17.3096 17.25 16.75 16.6904 16.75 16C16.75 15.3096 17.3096 14.75 18 14.75C18.6904 14.75 19.25 15.3096 19.25 16C19.25 16.6904 18.6904 17.25 18 17.25Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/format-list-bullets.mjs
var import_primitives20 = __toESM(require_primitives(), 1);
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M11 8H20M11 16H20", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 9.25C6.69036 9.25 7.25 8.69036 7.25 8C7.25 7.30964 6.69036 6.75 6 6.75C5.30964 6.75 4.75 7.30964 4.75 8C4.75 8.69036 5.30964 9.25 6 9.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 17.25C6.69036 17.25 7.25 16.6904 7.25 16C7.25 15.3096 6.69036 14.75 6 14.75C5.30964 14.75 4.75 15.3096 4.75 16C4.75 16.6904 5.30964 17.25 6 17.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 9.25C6.69036 9.25 7.25 8.69036 7.25 8C7.25 7.30964 6.69036 6.75 6 6.75C5.30964 6.75 4.75 7.30964 4.75 8C4.75 8.69036 5.30964 9.25 6 9.25Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives20.Path, { d: "M6 17.25C6.69036 17.25 7.25 16.6904 7.25 16C7.25 15.3096 6.69036 14.75 6 14.75C5.30964 14.75 4.75 15.3096 4.75 16C4.75 16.6904 5.30964 17.25 6 17.25Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/funnel.mjs
var import_primitives21 = __toESM(require_primitives(), 1);
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var funnel_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives21.Path, { d: "M10 17.5H14M8 12H16M6 6.5H18", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/image.mjs
var import_primitives22 = __toESM(require_primitives(), 1);
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
var image_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives22.Path, { d: "M19.25 14.2513L16.0707 11.0707C16.0317 11.0317 15.9683 11.0317 15.9293 11.0707L12.0584 14.9416C12.0245 14.9755 11.9713 14.9806 11.9316 14.9537L8.65791 12.7392C8.62313 12.7156 8.57736 12.7163 8.54332 12.7409L4.75 15.4808M19.25 14.2513V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V15.4808M19.25 14.2513V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.4808", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/link.mjs
var import_primitives23 = __toESM(require_primitives(), 1);
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var link_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives23.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/mobile.mjs
var import_primitives24 = __toESM(require_primitives(), 1);
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives24.Path, { d: "M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/more-vertical.mjs
var import_primitives25 = __toESM(require_primitives(), 1);
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives25.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/next.mjs
var import_primitives26 = __toESM(require_primitives(), 1);
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
var next_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives26.Path, { d: "M7 17.5L12 12L7 6.5M13 17.5L18 12L13 6.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/previous.mjs
var import_primitives27 = __toESM(require_primitives(), 1);
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
var previous_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives27.Path, { d: "M17 6.5L12 12L17 17.5M11 6.5L6 12L11 17.5", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/published.mjs
var import_primitives28 = __toESM(require_primitives(), 1);
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var published_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives28.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives28.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/scheduled.mjs
var import_primitives29 = __toESM(require_primitives(), 1);
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var scheduled_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives29.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives29.Path, { d: "M9.5 12.25H12.25V8", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/search.mjs
var import_primitives30 = __toESM(require_primitives(), 1);
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var search_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives30.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/seen.mjs
var import_primitives31 = __toESM(require_primitives(), 1);
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var seen_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives31.Path, { d: "M20.0645 13C18.5918 10.0366 15.5337 8 12 8C8.46631 8 5.40825 10.0366 3.93555 13", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives31.Circle, { cx: "12", cy: "12.5", r: "3", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/unseen.mjs
var import_primitives32 = __toESM(require_primitives(), 1);
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives32.Path, { d: "M8 21L10.6587 15.1842M13.1523 9.72929L13.8553 8.19144L16 3.5M20.0645 13C19.2118 11.2841 17.8276 9.87898 16.1272 9M3.93555 13C5.40825 10.0366 8.46631 8 12 8C12.636 8 13.2566 8.06597 13.8553 8.19144M13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842M13.1523 9.72929L10.6587 15.1842M13.1755 15.261C14.2481 14.8037 15 13.7397 15 12.5C15 12.1819 14.9505 11.8753 14.8587 11.5876", vectorEffect: "non-scaling-stroke" }),
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives32.Path, { d: "M12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842L13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" })
] });
// packages/icons/build-module/library/upload.mjs
var import_primitives33 = __toESM(require_primitives(), 1);
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var upload_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives33.Path, { d: "M4.75 15V19.25H12M12 19.25V4.5M12 19.25H19.25V15M17.5 10L12 4.5L6.5 10", vectorEffect: "non-scaling-stroke" }) });
// packages/icons/build-module/library/video.mjs
var import_primitives34 = __toESM(require_primitives(), 1);
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var video_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives34.Path, { d: "M10 15L15 12L10 9V15Z", fill: "currentColor", stroke: "none" }),
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives34.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V6Z", vectorEffect: "non-scaling-stroke" })
] });
// packages/ui/build-module/badge/badge.mjs
var import_element16 = __toESM(require_element(), 1);
// node_modules/@base-ui/utils/useControlled.mjs
var React = __toESM(require_react(), 1);
// node_modules/@base-ui/utils/createLogOnce.mjs
var loggedMessages;
if (true) {
loggedMessages = /* @__PURE__ */ new Set();
}
function createLogOnce(severity, prefix) {
return function logOnce(...messages) {
if (true) {
const message2 = messages.join(" ");
const output = prefix ? `${prefix}: ${message2}` : message2;
const key = `${severity}:${output}`;
if (!loggedMessages.has(key)) {
loggedMessages.add(key);
if (severity === "warn") {
console.warn(output);
} else {
console.error(output);
}
}
}
};
}
// node_modules/@base-ui/utils/error.mjs
var error = createLogOnce("error", "Base UI");
// node_modules/@base-ui/utils/useControlled.mjs
function useControlled({
controlled,
default: defaultProp,
name,
state = "value"
}) {
const {
current: isControlled
} = React.useRef(controlled !== void 0);
const [valueState, setValue] = React.useState(defaultProp);
const value = isControlled && controlled !== void 0 ? controlled : valueState;
if (true) {
React.useEffect(() => {
if (isControlled !== (controlled !== void 0)) {
error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
}
}, [state, name, controlled]);
const {
current: defaultValue2
} = React.useRef(defaultProp);
React.useEffect(() => {
if (!isControlled && serializeToDevModeString(defaultValue2) !== serializeToDevModeString(defaultProp)) {
error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
}
}, [defaultProp]);
}
const setValueIfUncontrolled = React.useCallback((newValue) => {
if (!isControlled) {
setValue(newValue);
}
}, []);
return [value, setValueIfUncontrolled];
}
function serializeToDevModeString(input) {
let nextId = 0;
const seen = /* @__PURE__ */ new WeakMap();
try {
const result = JSON.stringify(input, function replacer(key, value) {
if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) {
return void 0;
}
if (typeof value === "bigint") {
return `__bigint__:${value}`;
}
if (value !== null && typeof value === "object") {
const id = seen.get(value);
if (id !== void 0) {
return `__object__:${id}`;
}
seen.set(value, nextId);
nextId += 1;
}
return value;
});
return result ?? `__top__:${typeof input}`;
} catch {
return "__unserializable__";
}
}
// node_modules/@base-ui/utils/safeReact.mjs
var React2 = __toESM(require_react(), 1);
var SafeReact = {
...React2
};
// node_modules/@base-ui/utils/useRefWithInit.mjs
var React3 = __toESM(require_react(), 1);
var UNINITIALIZED = {};
function useRefWithInit(init2, initArg) {
const ref = React3.useRef(UNINITIALIZED);
if (ref.current === UNINITIALIZED) {
ref.current = init2(initArg);
}
return ref;
}
// node_modules/@base-ui/utils/useStableCallback.mjs
var useInsertionEffect = SafeReact.useInsertionEffect;
var useSafeInsertionEffect = (
// React 17 doesn't have useInsertionEffect.
useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
);
function useStableCallback(callback) {
const stable = useRefWithInit(createStableCallback).current;
stable.next = callback;
useSafeInsertionEffect(stable.effect);
return stable.trampoline;
}
function createStableCallback() {
const stable = {
next: void 0,
callback: assertNotCalled,
trampoline: (...args) => stable.callback?.(...args),
effect: () => {
stable.callback = stable.next;
}
};
return stable;
}
function assertNotCalled() {
if (true) {
throw (
/* minify-error-disabled */
new Error("Base UI: Cannot call an event handler while rendering.")
);
}
}
// node_modules/@base-ui/utils/warn.mjs
var warn = createLogOnce("warn", "Base UI");
// node_modules/@base-ui/utils/empty.mjs
function NOOP() {
}
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});
// node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
var React6 = __toESM(require_react(), 1);
// node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
var React4 = __toESM(require_react(), 1);
var noop2 = () => {
};
var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop2;
// node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
var React5 = __toESM(require_react(), 1);
var CompositeListContext = /* @__PURE__ */ React5.createContext({
register: () => {
},
unregister: () => {
},
subscribeMapChange: () => () => {
},
nextIndexRef: {
current: 0
}
});
if (true) CompositeListContext.displayName = "CompositeListContext";
function useCompositeListContext() {
return React5.useContext(CompositeListContext);
}
// node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
function CompositeList(props) {
const {
children,
elementsRef,
labelsRef,
onMapChange: onMapChangeProp
} = props;
const onMapChange = useStableCallback(onMapChangeProp);
const [, setMapTick] = React6.useState(false);
const listeners = useRefWithInit(createListeners).current;
const map = useRefWithInit(createMap).current;
const nextIndexRef = React6.useRef(0);
const isDirtyRef = React6.useRef(true);
const itemsRef = React6.useRef(null);
const mutationObserverRef = React6.useRef(null);
const scheduleMapUpdate = useStableCallback(() => {
if (isDirtyRef.current) {
return;
}
isDirtyRef.current = true;
setMapTick((tick) => !tick);
});
const register2 = useStableCallback((node, registration) => {
map.set(node, registration);
scheduleMapUpdate();
});
const unregister = useStableCallback((node) => {
map.delete(node);
scheduleMapUpdate();
});
const syncRefs = useStableCallback((items) => {
const nextMap = /* @__PURE__ */ new Map();
elementsRef.current.length = 0;
if (labelsRef) {
labelsRef.current.length = 0;
}
items.forEach((item) => {
nextMap.set(item.element, {
...item.registration.metadata ?? {},
index: item.index
});
elementsRef.current[item.index] = item.element;
if (labelsRef) {
labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
}
});
nextIndexRef.current = elementsRef.current.length;
return nextMap;
});
function observe(sortedNodes) {
mutationObserverRef.current?.disconnect();
mutationObserverRef.current = null;
if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
return;
}
const mutationObserver = new MutationObserver((entries) => {
if (!hasMovedNode(entries)) {
return;
}
let previousConnectedNode = null;
for (const node of sortedNodes) {
if (!node.isConnected) {
continue;
}
if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
mutationObserver.disconnect();
scheduleMapUpdate();
return;
}
previousConnectedNode = node;
}
});
mutationObserverRef.current = mutationObserver;
const roots = /* @__PURE__ */ new Set();
for (let i = 1; i < sortedNodes.length; i += 1) {
const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
if (root) {
roots.add(root);
}
}
roots.forEach((root) => mutationObserver.observe(root, {
childList: true
}));
}
const flush = useStableCallback(() => {
const [items, automaticNodes] = getCompositeListSnapshot(map);
const nextMap = syncRefs(items);
const previousItems = itemsRef.current;
const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
const previousItem = previousItems[index2];
return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
});
observe(automaticNodes);
itemsRef.current = items;
isDirtyRef.current = false;
if (!changed) {
return;
}
listeners.forEach((listener) => listener(nextMap));
onMapChange(nextMap);
});
useIsoLayoutEffect(() => {
if (!isDirtyRef.current && itemsRef.current) {
syncRefs(itemsRef.current);
}
return () => {
elementsRef.current = [];
if (labelsRef) {
labelsRef.current = [];
}
};
}, [elementsRef, labelsRef, syncRefs]);
useIsoLayoutEffect(() => {
if (isDirtyRef.current) {
flush();
}
});
useIsoLayoutEffect(() => {
return () => {
mutationObserverRef.current?.disconnect();
isDirtyRef.current = true;
};
}, []);
const subscribeMapChange = useStableCallback((fn) => {
listeners.add(fn);
return () => {
listeners.delete(fn);
};
});
const contextValue = React6.useMemo(() => ({
register: register2,
unregister,
subscribeMapChange,
nextIndexRef
}), [register2, unregister, subscribeMapChange, nextIndexRef]);
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompositeListContext.Provider, {
value: contextValue,
children
});
}
function createMap() {
return /* @__PURE__ */ new Map();
}
function createListeners() {
return /* @__PURE__ */ new Set();
}
function getCompositeListSnapshot(map) {
const reservedIndices = /* @__PURE__ */ new Set();
const items = [];
const automaticItems = [];
map.forEach((registration, node) => {
if (!node.isConnected) {
return;
}
const index2 = registration.index;
const item = {
index: index2 ?? -1,
element: node,
registration
};
if (index2 === null) {
automaticItems.push(item);
} else if (index2 >= 0) {
reservedIndices.add(index2);
items.push(item);
}
});
let nextAutomaticIndex = 0;
automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
automaticItems.forEach((item) => {
while (reservedIndices.has(nextAutomaticIndex)) {
nextAutomaticIndex += 1;
}
item.index = nextAutomaticIndex;
items.push(item);
nextAutomaticIndex += 1;
});
if (reservedIndices.size > 0) {
items.sort((a, b) => a.index - b.index);
}
return [items, automaticItems.map((item) => item.element)];
}
function getCommonAncestor(firstNode, lastNode) {
let ancestor = firstNode.parentElement;
while (ancestor && !ancestor.contains(lastNode)) {
ancestor = ancestor.parentElement;
}
return ancestor;
}
function hasMovedNode(entries) {
for (const entry of entries) {
for (let i = 0; i < entry.removedNodes.length; i += 1) {
if (entry.removedNodes[i].isConnected) {
return true;
}
}
}
return false;
}
function sortByDocumentPosition(a, b) {
return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
}
// node_modules/@base-ui/react/internals/useRenderElement.mjs
var React9 = __toESM(require_react(), 1);
// node_modules/@base-ui/utils/useMergedRefs.mjs
function useMergedRefs(a, b, c2, d) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChange(forkRef, a, b, c2, d)) {
update(forkRef, [a, b, c2, d]);
}
return forkRef.callback;
}
function useMergedRefsN(refs) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChangeN(forkRef, refs)) {
update(forkRef, refs);
}
return forkRef.callback;
}
function createForkRef() {
return {
callback: null,
cleanup: null,
refs: []
};
}
function didChange(forkRef, a, b, c2, d) {
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d;
}
function didChangeN(forkRef, newRefs) {
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
}
function update(forkRef, refs) {
forkRef.refs = refs;
if (refs.every((ref) => ref == null)) {
forkRef.callback = null;
return;
}
forkRef.callback = (instance) => {
if (forkRef.cleanup) {
forkRef.cleanup();
forkRef.cleanup = null;
}
if (instance != null) {
const cleanupCallbacks = Array(refs.length).fill(null);
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const refCleanup = ref(instance);
if (typeof refCleanup === "function") {
cleanupCallbacks[i] = refCleanup;
}
break;
}
case "object": {
ref.current = instance;
break;
}
default:
}
}
forkRef.cleanup = () => {
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const cleanupCallback = cleanupCallbacks[i];
if (typeof cleanupCallback === "function") {
cleanupCallback();
} else {
void ref(null);
}
break;
}
case "object": {
ref.current = null;
break;
}
default:
}
}
};
}
};
}
// node_modules/@base-ui/utils/getReactElementRef.mjs
var React8 = __toESM(require_react(), 1);
// node_modules/@base-ui/utils/reactVersion.mjs
var React7 = __toESM(require_react(), 1);
var majorVersion = parseInt(React7.version, 10);
function isReactVersionAtLeast(reactVersionToCheck) {
return majorVersion >= reactVersionToCheck;
}
// node_modules/@base-ui/utils/getReactElementRef.mjs
function getReactElementRef(element) {
if (!/* @__PURE__ */ React8.isValidElement(element)) {
return null;
}
const reactElement = element;
const propsWithRef = reactElement.props;
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}
// node_modules/@base-ui/utils/mergeObjects.mjs
function mergeObjects(a, b) {
if (a && !b) {
return a;
}
if (!a && b) {
return b;
}
if (a || b) {
return {
...a,
...b
};
}
return void 0;
}
// node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
function getStateAttributesProps(state, customMapping) {
const props = {};
for (const key in state) {
const value = state[key];
if (customMapping?.hasOwnProperty(key)) {
const customProps = customMapping[key](value);
if (customProps != null) {
Object.assign(props, customProps);
}
continue;
}
if (value === true) {
props[`data-${key.toLowerCase()}`] = "";
} else if (value) {
props[`data-${key.toLowerCase()}`] = value.toString();
}
}
return props;
}
// node_modules/@base-ui/react/utils/resolveClassName.mjs
function resolveClassName(className, state) {
return typeof className === "function" ? className(state) : className;
}
// node_modules/@base-ui/react/utils/resolveStyle.mjs
function resolveStyle(style, state) {
return typeof style === "function" ? style(state) : style;
}
// node_modules/@base-ui/react/merge-props/mergeProps.mjs
var EMPTY_PROPS = {};
function mergeProps(a, b, c2, d, e) {
if (!c2 && !d && !e && !a) {
return createInitialMergedProps(b);
}
let merged = createInitialMergedProps(a);
if (b) {
merged = mergeInto(merged, b);
}
if (c2) {
merged = mergeInto(merged, c2);
}
if (d) {
merged = mergeInto(merged, d);
}
if (e) {
merged = mergeInto(merged, e);
}
return merged;
}
function mergePropsN(props) {
if (props.length === 0) {
return EMPTY_PROPS;
}
if (props.length === 1) {
return createInitialMergedProps(props[0]);
}
let merged = createInitialMergedProps(props[0]);
for (let i = 1; i < props.length; i += 1) {
merged = mergeInto(merged, props[i]);
}
return merged;
}
function createInitialMergedProps(inputProps) {
if (isPropsGetter(inputProps)) {
return {
...resolvePropsGetter(inputProps, EMPTY_PROPS)
};
}
return copyInitialProps(inputProps);
}
function mergeInto(merged, inputProps) {
if (isPropsGetter(inputProps)) {
return resolvePropsGetter(inputProps, merged);
}
return mutablyMergeInto(merged, inputProps);
}
function copyInitialProps(inputProps) {
const copiedProps = {
...inputProps
};
for (const propName in copiedProps) {
const propValue = copiedProps[propName];
if (isEventHandler(propName, propValue)) {
copiedProps[propName] = wrapEventHandler(propValue);
}
}
return copiedProps;
}
function mutablyMergeInto(mergedProps, externalProps) {
if (!externalProps) {
return mergedProps;
}
for (const propName in externalProps) {
const externalPropValue = externalProps[propName];
switch (propName) {
case "style": {
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
break;
}
case "className": {
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
break;
}
default: {
if (isEventHandler(propName, externalPropValue)) {
mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
} else {
mergedProps[propName] = externalPropValue;
}
}
}
}
return mergedProps;
}
function isEventHandler(key, value) {
const code0 = key.charCodeAt(0);
const code1 = key.charCodeAt(1);
const code2 = key.charCodeAt(2);
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
}
function isPropsGetter(inputProps) {
return typeof inputProps === "function";
}
function resolvePropsGetter(inputProps, previousProps) {
if (isPropsGetter(inputProps)) {
return inputProps(previousProps);
}
return inputProps ?? EMPTY_PROPS;
}
function mergeEventHandlers(ourHandler, theirHandler) {
if (!theirHandler) {
return ourHandler;
}
if (!ourHandler) {
return wrapEventHandler(theirHandler);
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
const baseUIEvent = event;
makeEventPreventable(baseUIEvent);
const result2 = theirHandler(...args);
if (!baseUIEvent.baseUIHandlerPrevented) {
ourHandler?.(...args);
}
return result2;
}
const result = theirHandler(...args);
ourHandler?.(...args);
return result;
};
}
function wrapEventHandler(handler) {
if (!handler) {
return handler;
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
makeEventPreventable(event);
}
return handler(...args);
};
}
function makeEventPreventable(event) {
event.preventBaseUIHandler = () => {
event.baseUIHandlerPrevented = true;
};
return event;
}
function mergeClassNames(ourClassName, theirClassName) {
if (theirClassName) {
if (ourClassName) {
return theirClassName + " " + ourClassName;
}
return theirClassName;
}
return ourClassName;
}
function isSyntheticEvent(event) {
return event != null && typeof event === "object" && "nativeEvent" in event;
}
// node_modules/@base-ui/react/internals/useRenderElement.mjs
var import_react = __toESM(require_react(), 1);
function useRenderElement(element, componentProps, params = {}) {
let renderProp = componentProps.render;
if (params.enabled !== false) {
renderProp = unwrapLazyRenderProp(renderProp);
}
const outProps = useRenderElementProps(componentProps, params, renderProp);
if (params.enabled === false) {
return null;
}
const state = params.state ?? EMPTY_OBJECT;
return evaluateRenderProp(element, renderProp, outProps, state);
}
function useRenderElementProps(componentProps, params, renderProp) {
const {
className: classNameProp,
style: styleProp
} = componentProps;
const {
state = EMPTY_OBJECT,
ref,
props,
stateAttributesMapping: stateAttributesMapping2,
enabled = true
} = params;
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
const style = enabled ? resolveStyle(styleProp, state) : void 0;
const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT;
const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
if (typeof document !== "undefined") {
if (!enabled) {
void useMergedRefs(null, null);
} else if (Array.isArray(ref)) {
outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
} else {
outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
}
}
if (!enabled) {
return EMPTY_OBJECT;
}
if (className !== void 0) {
outProps.className = mergeClassNames(outProps.className, className);
}
if (style !== void 0) {
outProps.style = mergeObjects(outProps.style, style);
}
return outProps;
}
function resolveRenderFunctionProps(props) {
if (Array.isArray(props)) {
return mergePropsN(props);
}
return mergeProps(void 0, props);
}
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
function unwrapLazyRenderProp(render4) {
if (render4?.$$typeof !== REACT_LAZY_TYPE) {
return render4;
}
const unwrapped = React9.Children.toArray(render4)[0];
return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render4;
}
function evaluateRenderProp(element, render4, props, state) {
if (render4) {
if (typeof render4 === "function") {
if (true) {
warnIfRenderPropLooksLikeComponent(render4);
}
return render4(props, state);
}
const mergedProps = mergeProps(props, render4.props);
mergedProps.ref = props.ref;
if (true) {
if (!/* @__PURE__ */ React9.isValidElement(render4)) {
throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
}
}
return /* @__PURE__ */ React9.cloneElement(render4, mergedProps);
}
if (element) {
if (typeof element === "string") {
return renderTag(element, props);
}
}
throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
}
function warnIfRenderPropLooksLikeComponent(renderFn) {
const functionName = renderFn.name;
if (functionName.length === 0) {
return;
}
if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
return;
}
if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
return;
}
warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={}` or `render={(props) => }` instead.", "https://base-ui.com/r/invalid-render-prop");
}
function renderTag(Tag, props) {
if (Tag === "button") {
return /* @__PURE__ */ (0, import_react.createElement)("button", {
type: "button",
...props,
key: props.key
});
}
if (Tag === "img") {
return /* @__PURE__ */ (0, import_react.createElement)("img", {
alt: "",
...props,
key: props.key
});
}
return /* @__PURE__ */ React9.createElement(Tag, props);
}
// node_modules/@base-ui/utils/useId.mjs
var React10 = __toESM(require_react(), 1);
var globalId = 0;
function useGlobalId(idOverride, prefix = "mui") {
const [defaultId, setDefaultId] = React10.useState(idOverride);
const id = idOverride || defaultId;
React10.useEffect(() => {
if (defaultId == null) {
globalId += 1;
setDefaultId(`${prefix}-${globalId}`);
}
}, [defaultId, prefix]);
return id;
}
var maybeReactUseId = SafeReact.useId;
function useId(idOverride, prefix) {
if (maybeReactUseId !== void 0) {
const reactId = maybeReactUseId();
return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
}
return useGlobalId(idOverride, prefix);
}
// node_modules/@base-ui/react/internals/useBaseUiId.mjs
function useBaseUiId(idOverride) {
return useId(idOverride, "base-ui");
}
// node_modules/@base-ui/react/internals/reason-parts.mjs
var reason_parts_exports = {};
__export(reason_parts_exports, {
cancelOpen: () => cancelOpen,
chipRemovePress: () => chipRemovePress,
clearPress: () => clearPress,
closePress: () => closePress,
closeWatcher: () => closeWatcher,
decrementPress: () => decrementPress,
disabled: () => disabled,
drag: () => drag,
escapeKey: () => escapeKey,
focusOut: () => focusOut,
imperativeAction: () => imperativeAction,
incrementPress: () => incrementPress,
initial: () => initial,
inputBlur: () => inputBlur,
inputChange: () => inputChange,
inputClear: () => inputClear,
inputPaste: () => inputPaste,
inputPress: () => inputPress,
itemPress: () => itemPress,
keyboard: () => keyboard,
linkPress: () => linkPress,
listNavigation: () => listNavigation,
missing: () => missing,
none: () => none,
outsidePress: () => outsidePress,
pointer: () => pointer,
scrub: () => scrub,
siblingOpen: () => siblingOpen,
swipe: () => swipe,
trackPress: () => trackPress,
triggerFocus: () => triggerFocus,
triggerHover: () => triggerHover,
triggerPress: () => triggerPress,
wheel: () => wheel,
windowResize: () => windowResize
});
var none = "none";
var triggerPress = "trigger-press";
var triggerHover = "trigger-hover";
var triggerFocus = "trigger-focus";
var outsidePress = "outside-press";
var itemPress = "item-press";
var closePress = "close-press";
var linkPress = "link-press";
var clearPress = "clear-press";
var chipRemovePress = "chip-remove-press";
var trackPress = "track-press";
var incrementPress = "increment-press";
var decrementPress = "decrement-press";
var inputChange = "input-change";
var inputClear = "input-clear";
var inputBlur = "input-blur";
var inputPaste = "input-paste";
var inputPress = "input-press";
var focusOut = "focus-out";
var escapeKey = "escape-key";
var closeWatcher = "close-watcher";
var listNavigation = "list-navigation";
var keyboard = "keyboard";
var pointer = "pointer";
var drag = "drag";
var wheel = "wheel";
var scrub = "scrub";
var cancelOpen = "cancel-open";
var siblingOpen = "sibling-open";
var disabled = "disabled";
var missing = "missing";
var initial = "initial";
var imperativeAction = "imperative-action";
var swipe = "swipe";
var windowResize = "window-resize";
// node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
function createChangeEventDetails(reason, event, trigger, customProperties) {
let canceled = false;
let allowPropagation = false;
const custom = customProperties ?? EMPTY_OBJECT;
const details = {
reason,
event: event ?? new Event("base-ui"),
cancel() {
canceled = true;
},
allowPropagation() {
allowPropagation = true;
},
get isCanceled() {
return canceled;
},
get isPropagationAllowed() {
return allowPropagation;
},
trigger,
...custom
};
return details;
}
// node_modules/@base-ui/react/internals/useTransitionStatus.mjs
var React12 = __toESM(require_react(), 1);
// node_modules/@base-ui/utils/useOnMount.mjs
var React11 = __toESM(require_react(), 1);
function useOnMount(fn) {
React11.useEffect(fn, EMPTY_ARRAY);
}
// node_modules/@base-ui/utils/useAnimationFrame.mjs
var EMPTY = null;
var LAST_RAF = globalThis.requestAnimationFrame;
var Scheduler = class {
/* This implementation uses an array as a backing data-structure for frame callbacks.
* It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
* never calls the native `cancelAnimationFrame` if there are no frames left. This can
* be much more efficient if there is a call pattern that alterns as
* "request-cancel-request-cancel-…".
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
callbacks = [];
callbacksCount = 0;
nextId = 1;
startId = 1;
isScheduled = false;
tick = (timestamp) => {
this.isScheduled = false;
const currentCallbacks = this.callbacks;
const currentCallbacksCount = this.callbacksCount;
this.callbacks = [];
this.callbacksCount = 0;
this.startId = this.nextId;
if (currentCallbacksCount > 0) {
for (let i = 0; i < currentCallbacks.length; i += 1) {
currentCallbacks[i]?.(timestamp);
}
}
};
request(fn) {
const id = this.nextId;
this.nextId += 1;
this.callbacks.push(fn);
this.callbacksCount += 1;
const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
if (!this.isScheduled || didRAFChange) {
requestAnimationFrame(this.tick);
this.isScheduled = true;
}
return id;
}
cancel(id) {
const index2 = id - this.startId;
if (index2 < 0 || index2 >= this.callbacks.length) {
return;
}
if (this.callbacks[index2] === null) {
return;
}
this.callbacks[index2] = null;
this.callbacksCount -= 1;
}
};
var scheduler = new Scheduler();
var AnimationFrame = class _AnimationFrame {
static create() {
return new _AnimationFrame();
}
static request(fn) {
return scheduler.request(fn);
}
static cancel(id) {
return scheduler.cancel(id);
}
currentId = EMPTY;
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
request(fn) {
this.cancel();
this.currentId = scheduler.request(() => {
this.currentId = EMPTY;
fn();
});
}
cancel = () => {
if (this.currentId !== EMPTY) {
scheduler.cancel(this.currentId);
this.currentId = EMPTY;
}
};
disposeEffect = () => {
return this.cancel;
};
};
function useAnimationFrame() {
const timeout = useRefWithInit(AnimationFrame.create).current;
useOnMount(timeout.disposeEffect);
return timeout;
}
// node_modules/@base-ui/react/internals/useTransitionStatus.mjs
function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
const [transitionStatus, setTransitionStatus] = React12.useState(open2 && enableIdleState ? "idle" : void 0);
const [mounted, setMounted] = React12.useState(open2 && !animateInitialOpen);
if (open2 && !mounted) {
setMounted(true);
setTransitionStatus("starting");
}
if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) {
setTransitionStatus("ending");
}
if (!open2 && !mounted && transitionStatus === "ending") {
setTransitionStatus(void 0);
}
useIsoLayoutEffect(() => {
if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) {
const frame = AnimationFrame.request(() => {
setTransitionStatus("ending");
});
return () => {
AnimationFrame.cancel(frame);
};
}
return void 0;
}, [open2, mounted, transitionStatus, deferEndingState]);
useIsoLayoutEffect(() => {
if (!open2 || enableIdleState) {
return void 0;
}
const frame = AnimationFrame.request(() => {
setTransitionStatus(void 0);
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2]);
useIsoLayoutEffect(() => {
if (!open2 || !enableIdleState) {
return void 0;
}
if (open2 && mounted && transitionStatus !== "idle") {
setTransitionStatus("starting");
}
const frame = AnimationFrame.request(() => {
setTransitionStatus("idle");
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2, mounted, transitionStatus]);
return {
mounted,
setMounted,
transitionStatus
};
}
// node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
var React13 = __toESM(require_react(), 1);
function useCompositeListItem(params = {}) {
const {
guess,
label,
metadata,
textRef,
index: externalIndex
} = params;
const {
register: register2,
unregister,
subscribeMapChange,
nextIndexRef
} = useCompositeListContext();
const indexRef = React13.useRef(-1);
const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => {
if (indexRef.current === -1) {
const newIndex = nextIndexRef.current;
nextIndexRef.current += 1;
indexRef.current = newIndex;
}
return indexRef.current;
} : -1);
const index2 = externalIndex ?? internalIndex;
const componentRef = React13.useRef(null);
const ref = React13.useCallback((node) => {
const previousNode = componentRef.current;
if (previousNode) {
unregister(previousNode);
}
componentRef.current = node;
if (node) {
register2(node, {
metadata: metadata ?? null,
index: externalIndex ?? null,
label,
textRef
});
}
}, [externalIndex, register2, unregister, metadata, label, textRef]);
useIsoLayoutEffect(() => {
if (externalIndex != null) {
return void 0;
}
return subscribeMapChange((map) => {
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
if (i != null) {
setInternalIndex(i);
}
});
}, [externalIndex, subscribeMapChange]);
return {
ref,
index: index2
};
}
// node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
var startingStyle = "data-starting-style";
var endingStyle = "data-ending-style";
// node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
var STARTING_HOOK = {
[startingStyle]: ""
};
var ENDING_HOOK = {
[endingStyle]: ""
};
var transitionStatusMapping = {
transitionStatus(value) {
if (value === "starting") {
return STARTING_HOOK;
}
if (value === "ending") {
return ENDING_HOOK;
}
return null;
}
};
// node_modules/@base-ui/react/internals/use-button/useButton.mjs
var React16 = __toESM(require_react(), 1);
// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
return typeof window !== "undefined";
}
function getNodeName(node) {
if (isNode(node)) {
return (node.nodeName || "").toLowerCase();
}
return "#document";
}
function getWindow(node) {
var _node$ownerDocument;
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
var _ref;
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Node || value instanceof getWindow(value).Node;
}
function isElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Element || value instanceof getWindow(value).Element;
}
function isHTMLElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
if (!hasWindow() || typeof ShadowRoot === "undefined") {
return false;
}
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = getComputedStyle2(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
}
function isTableElement(element) {
return /^(table|td|th)$/.test(getNodeName(element));
}
function isTopLayer(element) {
try {
if (element.matches(":popover-open")) {
return true;
}
} catch (_e) {
}
try {
return element.matches(":modal");
} catch (_e) {
return false;
}
}
var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
var containRe = /paint|layout|strict|content/;
var isNotNone = (value) => !!value && value !== "none";
var isWebKitValue;
function isContainingBlock(elementOrCss) {
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else if (isTopLayer(currentNode)) {
return null;
}
currentNode = getParentNode(currentNode);
}
return null;
}
function isWebKit() {
if (isWebKitValue == null) {
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
}
return isWebKitValue;
}
function isLastTraversableNode(node) {
return /^(html|body|#document)$/.test(getNodeName(node));
}
function getComputedStyle2(element) {
return getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
if (isElement(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.scrollX,
scrollTop: element.scrollY
};
}
function getParentNode(node) {
if (getNodeName(node) === "html") {
return node;
}
const result = (
// Step into the shadow DOM of the parent of a slotted node.
node.assignedSlot || // DOM Element detected.
node.parentNode || // ShadowRoot detected.
isShadowRoot(node) && node.host || // Fallback.
getDocumentElement(node)
);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return (node.ownerDocument || node).body;
}
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = getWindow(scrollableAncestor);
if (isBody) {
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
} else {
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
}
function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
// node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
var React14 = __toESM(require_react(), 1);
var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
if (true) CompositeRootContext.displayName = "CompositeRootContext";
function useCompositeRootContext(optional = false) {
const context = React14.useContext(CompositeRootContext);
if (context === void 0 && !optional) {
throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within ." : formatErrorMessage_default(16));
}
return context;
}
// node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
var React15 = __toESM(require_react(), 1);
function useFocusableWhenDisabled(parameters) {
const {
focusableWhenDisabled,
disabled: disabled2,
composite = false,
tabIndex: tabIndexProp = 0,
isNativeButton
} = parameters;
const isFocusableComposite = composite && focusableWhenDisabled !== false;
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
const props = React15.useMemo(() => {
const additionalProps = {
// allow Tabbing away from focusableWhenDisabled elements
onKeyDown(event) {
if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
event.preventDefault();
}
}
};
if (!composite) {
additionalProps.tabIndex = tabIndexProp;
if (!isNativeButton && disabled2) {
additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
}
}
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
additionalProps["aria-disabled"] = disabled2;
}
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
additionalProps.disabled = disabled2;
}
return additionalProps;
}, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
return {
props
};
}
// node_modules/@base-ui/utils/owner.mjs
function ownerDocument(node) {
return node?.ownerDocument || document;
}
// node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
function dispatchClickWithModifiers(target, sourceEvent, {
detail = 0
} = {}) {
target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
bubbles: true,
cancelable: true,
composed: true,
detail,
shiftKey: sourceEvent.shiftKey,
ctrlKey: sourceEvent.ctrlKey,
altKey: sourceEvent.altKey,
metaKey: sourceEvent.metaKey
}));
}
// node_modules/@base-ui/react/internals/use-button/useButton.mjs
function useButton(parameters = {}) {
const {
disabled: disabled2 = false,
focusableWhenDisabled,
tabIndex = 0,
native: isNativeButton = true,
composite: compositeProp
} = parameters;
const elementRef = React16.useRef(null);
const compositeRootContext = useCompositeRootContext(true);
const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
const {
props: focusableWhenDisabledProps
} = useFocusableWhenDisabled({
focusableWhenDisabled,
disabled: disabled2,
composite: isCompositeItem,
tabIndex,
isNativeButton
});
if (true) {
React16.useEffect(() => {
if (!elementRef.current) {
return;
}
const isButtonTag = isButtonElement(elementRef.current);
if (isNativeButton) {
if (!isButtonTag) {
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
const message2 = "A component that acts as a button expected a native