(function() {
"use strict";
var wp;
(wp ||= {}).components = (() => {
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 __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
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, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, 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/primitives
var require_primitives = __commonJS({
"package-external:@wordpress/primitives"(exports, module) {
module.exports = window.wp.primitives;
}
});
// package-external:@wordpress/i18n
var require_i18n = __commonJS({
"package-external:@wordpress/i18n"(exports, module) {
module.exports = window.wp.i18n;
}
});
// package-external:@wordpress/compose
var require_compose = __commonJS({
"package-external:@wordpress/compose"(exports, module) {
module.exports = window.wp.compose;
}
});
// package-external:@wordpress/element
var require_element = __commonJS({
"package-external:@wordpress/element"(exports, module) {
module.exports = window.wp.element;
}
});
// vendor-external:react
var require_react = __commonJS({
"vendor-external:react"(exports, module) {
module.exports = window.React;
}
});
// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
"vendor-external:react/jsx-runtime"(exports, module) {
module.exports = window.ReactJSXRuntime;
}
});
// 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, y3) {
return x2 === y3 && (0 !== x2 || 1 / x2 === 1 / y3) || x2 !== x2 && y3 !== y3;
}
function useSyncExternalStore$2(subscribe2, getSnapshot) {
didWarnOld18Alpha || void 0 === React40.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 = useState78({
inst: { value, getSnapshot }
});
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
useLayoutEffect25(
function() {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
},
[subscribe2, value, getSnapshot]
);
useEffect73(
function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
return subscribe2(function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
});
},
[subscribe2]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
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 React40 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState78 = React40.useState, useEffect73 = React40.useEffect, useLayoutEffect25 = React40.useLayoutEffect, useDebugValue = React40.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 !== React40.useSyncExternalStore ? React40.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();
}
}
});
// vendor-external:react-dom
var require_react_dom = __commonJS({
"vendor-external:react-dom"(exports, module) {
module.exports = window.ReactDOM;
}
});
// package-external:@wordpress/deprecated
var require_deprecated = __commonJS({
"package-external:@wordpress/deprecated"(exports, module) {
module.exports = window.wp.deprecated;
}
});
// node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize(fn) {
var cache2 = /* @__PURE__ */ Object.create(null);
return function(arg) {
if (cache2[arg] === void 0) cache2[arg] = fn(arg);
return cache2[arg];
};
}
var init_emotion_memoize_esm = __esm({
"node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"() {
}
});
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
var emotion_is_prop_valid_esm_exports = {};
__export(emotion_is_prop_valid_esm_exports, {
default: () => isPropValid
});
var reactPropsRegex, isPropValid;
var init_emotion_is_prop_valid_esm = __esm({
"node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js"() {
init_emotion_memoize_esm();
reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
isPropValid = /* @__PURE__ */ memoize(
function(prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
}
});
// node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS({
"node_modules/react-is/cjs/react-is.development.js"(exports) {
"use strict";
if (true) {
(function() {
"use strict";
var hasSymbol = typeof Symbol === "function" && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
function isValidElementType(type) {
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}
function typeOf(object) {
if (typeof object === "object" && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_ASYNC_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return void 0;
}
var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element2 = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment8 = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal3 = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
}
}
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement3(object) {
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element2;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment8;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal3;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement3;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})();
}
}
});
// node_modules/react-is/index.js
var require_react_is = __commonJS({
"node_modules/react-is/index.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_react_is_development();
}
}
});
// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
var require_hoist_non_react_statics_cjs = __commonJS({
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) {
"use strict";
var reactIs = require_react_is();
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
"$$typeof": true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
"$$typeof": true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
}
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== "string") {
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i3 = 0; i3 < keys.length; ++i3) {
var key = keys[i3];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
defineProperty(targetComponent, key, descriptor);
} catch (e3) {
}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
}
});
// node_modules/deepmerge/dist/cjs.js
var require_cjs = __commonJS({
"node_modules/deepmerge/dist/cjs.js"(exports, module) {
"use strict";
var isMergeableObject = function isMergeableObject2(value) {
return isNonNullObject(value) && !isSpecial(value);
};
function isNonNullObject(value) {
return !!value && typeof value === "object";
}
function isSpecial(value) {
var stringValue = Object.prototype.toString.call(value);
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
}
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
function isReactElement(value) {
return value.$$typeof === REACT_ELEMENT_TYPE;
}
function emptyTarget(val) {
return Array.isArray(val) ? [] : {};
}
function cloneUnlessOtherwiseSpecified(value, options2) {
return options2.clone !== false && options2.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options2) : value;
}
function defaultArrayMerge(target, source, options2) {
return target.concat(source).map(function(element) {
return cloneUnlessOtherwiseSpecified(element, options2);
});
}
function getMergeFunction(key, options2) {
if (!options2.customMerge) {
return deepmerge2;
}
var customMerge = options2.customMerge(key);
return typeof customMerge === "function" ? customMerge : deepmerge2;
}
function getEnumerableOwnPropertySymbols(target) {
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol4) {
return Object.propertyIsEnumerable.call(target, symbol4);
}) : [];
}
function getKeys2(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
}
function propertyIsOnObject(object, property) {
try {
return property in object;
} catch (_2) {
return false;
}
}
function propertyIsUnsafe(target, key) {
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
}
function mergeObject(target, source, options2) {
var destination = {};
if (options2.isMergeableObject(target)) {
getKeys2(target).forEach(function(key) {
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2);
});
}
getKeys2(source).forEach(function(key) {
if (propertyIsUnsafe(target, key)) {
return;
}
if (propertyIsOnObject(target, key) && options2.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options2)(target[key], source[key], options2);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2);
}
});
return destination;
}
function deepmerge2(target, source, options2) {
options2 = options2 || {};
options2.arrayMerge = options2.arrayMerge || defaultArrayMerge;
options2.isMergeableObject = options2.isMergeableObject || isMergeableObject;
options2.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (!sourceAndTargetTypesMatch) {
return cloneUnlessOtherwiseSpecified(source, options2);
} else if (sourceIsArray) {
return options2.arrayMerge(target, source, options2);
} else {
return mergeObject(target, source, options2);
}
}
deepmerge2.all = function deepmergeAll(array, options2) {
if (!Array.isArray(array)) {
throw new Error("first argument should be an array");
}
return array.reduce(function(prev2, next2) {
return deepmerge2(prev2, next2, options2);
}, {});
};
var deepmerge_1 = deepmerge2;
module.exports = deepmerge_1;
}
});
// 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(a3, b3) {
if (a3 === b3) return true;
if (a3 && b3 && typeof a3 == "object" && typeof b3 == "object") {
if (a3.constructor !== b3.constructor) return false;
var length2, i3, keys;
if (Array.isArray(a3)) {
length2 = a3.length;
if (length2 != b3.length) return false;
for (i3 = length2; i3-- !== 0; )
if (!equal(a3[i3], b3[i3])) return false;
return true;
}
if (a3 instanceof Map && b3 instanceof Map) {
if (a3.size !== b3.size) return false;
for (i3 of a3.entries())
if (!b3.has(i3[0])) return false;
for (i3 of a3.entries())
if (!equal(i3[1], b3.get(i3[0]))) return false;
return true;
}
if (a3 instanceof Set && b3 instanceof Set) {
if (a3.size !== b3.size) return false;
for (i3 of a3.entries())
if (!b3.has(i3[0])) return false;
return true;
}
if (ArrayBuffer.isView(a3) && ArrayBuffer.isView(b3)) {
length2 = a3.length;
if (length2 != b3.length) return false;
for (i3 = length2; i3-- !== 0; )
if (a3[i3] !== b3[i3]) return false;
return true;
}
if (a3.constructor === RegExp) return a3.source === b3.source && a3.flags === b3.flags;
if (a3.valueOf !== Object.prototype.valueOf) return a3.valueOf() === b3.valueOf();
if (a3.toString !== Object.prototype.toString) return a3.toString() === b3.toString();
keys = Object.keys(a3);
length2 = keys.length;
if (length2 !== Object.keys(b3).length) return false;
for (i3 = length2; i3-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(b3, keys[i3])) return false;
for (i3 = length2; i3-- !== 0; ) {
var key = keys[i3];
if (!equal(a3[key], b3[key])) return false;
}
return true;
}
return a3 !== a3 && b3 !== b3;
};
}
});
// package-external:@wordpress/warning
var require_warning = __commonJS({
"package-external:@wordpress/warning"(exports, module) {
module.exports = window.wp.warning;
}
});
// node_modules/highlight-words-core/dist/index.js
var require_dist = __commonJS({
"node_modules/highlight-words-core/dist/index.js"(exports, module) {
module.exports = /******/
(function(modules) {
var installedModules = {};
function __webpack_require__(moduleId) {
if (installedModules[moduleId])
return installedModules[moduleId].exports;
var module2 = installedModules[moduleId] = {
/******/
exports: {},
/******/
id: moduleId,
/******/
loaded: false
/******/
};
modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
module2.loaded = true;
return module2.exports;
}
__webpack_require__.m = modules;
__webpack_require__.c = installedModules;
__webpack_require__.p = "";
return __webpack_require__(0);
})([
/* 0 */
/***/
(function(module2, exports2, __webpack_require__) {
module2.exports = __webpack_require__(1);
}),
/* 1 */
/***/
(function(module2, exports2, __webpack_require__) {
"use strict";
Object.defineProperty(exports2, "__esModule", {
value: true
});
var _utils = __webpack_require__(2);
Object.defineProperty(exports2, "combineChunks", {
enumerable: true,
get: function get() {
return _utils.combineChunks;
}
});
Object.defineProperty(exports2, "fillInChunks", {
enumerable: true,
get: function get() {
return _utils.fillInChunks;
}
});
Object.defineProperty(exports2, "findAll", {
enumerable: true,
get: function get() {
return _utils.findAll;
}
});
Object.defineProperty(exports2, "findChunks", {
enumerable: true,
get: function get() {
return _utils.findChunks;
}
});
}),
/* 2 */
/***/
(function(module2, exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", {
value: true
});
var findAll2 = exports2.findAll = function findAll3(_ref9) {
var autoEscape = _ref9.autoEscape, _ref$caseSensitive = _ref9.caseSensitive, caseSensitive = _ref$caseSensitive === void 0 ? false : _ref$caseSensitive, _ref$findChunks = _ref9.findChunks, findChunks = _ref$findChunks === void 0 ? defaultFindChunks : _ref$findChunks, sanitize2 = _ref9.sanitize, searchWords = _ref9.searchWords, textToHighlight = _ref9.textToHighlight;
return fillInChunks({
chunksToHighlight: combineChunks({
chunks: findChunks({
autoEscape,
caseSensitive,
sanitize: sanitize2,
searchWords,
textToHighlight
})
}),
totalLength: textToHighlight ? textToHighlight.length : 0
});
};
var combineChunks = exports2.combineChunks = function combineChunks2(_ref24) {
var chunks = _ref24.chunks;
chunks = chunks.sort(function(first, second) {
return first.start - second.start;
}).reduce(function(processedChunks, nextChunk) {
if (processedChunks.length === 0) {
return [nextChunk];
} else {
var prevChunk = processedChunks.pop();
if (nextChunk.start <= prevChunk.end) {
var endIndex = Math.max(prevChunk.end, nextChunk.end);
processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
} else {
processedChunks.push(prevChunk, nextChunk);
}
return processedChunks;
}
}, []);
return chunks;
};
var defaultFindChunks = function defaultFindChunks2(_ref32) {
var autoEscape = _ref32.autoEscape, caseSensitive = _ref32.caseSensitive, _ref3$sanitize = _ref32.sanitize, sanitize2 = _ref3$sanitize === void 0 ? defaultSanitize : _ref3$sanitize, searchWords = _ref32.searchWords, textToHighlight = _ref32.textToHighlight;
textToHighlight = sanitize2(textToHighlight);
return searchWords.filter(function(searchWord) {
return searchWord;
}).reduce(function(chunks, searchWord) {
searchWord = sanitize2(searchWord);
if (autoEscape) {
searchWord = escapeRegExpFn(searchWord);
}
var regex = new RegExp(searchWord, caseSensitive ? "g" : "gi");
var match4 = void 0;
while (match4 = regex.exec(textToHighlight)) {
var _start = match4.index;
var _end = regex.lastIndex;
if (_end > _start) {
chunks.push({ highlight: false, start: _start, end: _end });
}
if (match4.index === regex.lastIndex) {
regex.lastIndex++;
}
}
return chunks;
}, []);
};
exports2.findChunks = defaultFindChunks;
var fillInChunks = exports2.fillInChunks = function fillInChunks2(_ref42) {
var chunksToHighlight = _ref42.chunksToHighlight, totalLength = _ref42.totalLength;
var allChunks = [];
var append2 = function append3(start, end, highlight) {
if (end - start > 0) {
allChunks.push({
start,
end,
highlight
});
}
};
if (chunksToHighlight.length === 0) {
append2(0, totalLength, false);
} else {
var lastIndex = 0;
chunksToHighlight.forEach(function(chunk) {
append2(lastIndex, chunk.start, false);
append2(chunk.start, chunk.end, true);
lastIndex = chunk.end;
});
append2(lastIndex, totalLength, false);
}
return allChunks;
};
function defaultSanitize(string) {
return string;
}
function escapeRegExpFn(string) {
return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
})
/******/
]);
}
});
// package-external:@wordpress/rich-text
var require_rich_text = __commonJS({
"package-external:@wordpress/rich-text"(exports, module) {
module.exports = window.wp.richText;
}
});
// package-external:@wordpress/a11y
var require_a11y = __commonJS({
"package-external:@wordpress/a11y"(exports, module) {
module.exports = window.wp.a11y;
}
});
// 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(match4) {
return characterMap[match4];
}
var removeAccents4 = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents4;
module.exports.has = hasAccents;
module.exports.remove = removeAccents4;
}
});
// package-external:@wordpress/is-shallow-equal
var require_is_shallow_equal = __commonJS({
"package-external:@wordpress/is-shallow-equal"(exports, module) {
module.exports = window.wp.isShallowEqual;
}
});
// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
"package-external:@wordpress/private-apis"(exports, module) {
module.exports = window.wp.privateApis;
}
});
// node_modules/gradient-parser/build/node.js
var require_node = __commonJS({
"node_modules/gradient-parser/build/node.js"(exports) {
var GradientParser = GradientParser || {};
GradientParser.stringify = /* @__PURE__ */ (function() {
var visitor = {
"visit_linear-gradient": function(node2) {
return visitor.visit_gradient(node2);
},
"visit_repeating-linear-gradient": function(node2) {
return visitor.visit_gradient(node2);
},
"visit_radial-gradient": function(node2) {
return visitor.visit_gradient(node2);
},
"visit_repeating-radial-gradient": function(node2) {
return visitor.visit_gradient(node2);
},
"visit_gradient": function(node2) {
var orientation = visitor.visit(node2.orientation);
if (orientation) {
orientation += ", ";
}
return node2.type + "(" + orientation + visitor.visit(node2.colorStops) + ")";
},
"visit_shape": function(node2) {
var result = node2.value, at = visitor.visit(node2.at), style2 = visitor.visit(node2.style);
if (style2) {
result += " " + style2;
}
if (at) {
result += " at " + at;
}
return result;
},
"visit_default-radial": function(node2) {
var result = "", at = visitor.visit(node2.at);
if (at) {
result += at;
}
return result;
},
"visit_extent-keyword": function(node2) {
var result = node2.value, at = visitor.visit(node2.at);
if (at) {
result += " at " + at;
}
return result;
},
"visit_position-keyword": function(node2) {
return node2.value;
},
"visit_position": function(node2) {
return visitor.visit(node2.value.x) + " " + visitor.visit(node2.value.y);
},
"visit_%": function(node2) {
return node2.value + "%";
},
"visit_em": function(node2) {
return node2.value + "em";
},
"visit_px": function(node2) {
return node2.value + "px";
},
"visit_calc": function(node2) {
return "calc(" + node2.value + ")";
},
"visit_literal": function(node2) {
return visitor.visit_color(node2.value, node2);
},
"visit_hex": function(node2) {
return visitor.visit_color("#" + node2.value, node2);
},
"visit_rgb": function(node2) {
return visitor.visit_color("rgb(" + node2.value.join(", ") + ")", node2);
},
"visit_rgba": function(node2) {
return visitor.visit_color("rgba(" + node2.value.join(", ") + ")", node2);
},
"visit_hsl": function(node2) {
return visitor.visit_color("hsl(" + node2.value[0] + ", " + node2.value[1] + "%, " + node2.value[2] + "%)", node2);
},
"visit_hsla": function(node2) {
return visitor.visit_color("hsla(" + node2.value[0] + ", " + node2.value[1] + "%, " + node2.value[2] + "%, " + node2.value[3] + ")", node2);
},
"visit_var": function(node2) {
return visitor.visit_color("var(" + node2.value + ")", node2);
},
"visit_color": function(resultColor, node2) {
var result = resultColor, length2 = visitor.visit(node2.length);
if (length2) {
result += " " + length2;
}
return result;
},
"visit_angular": function(node2) {
return node2.value + "deg";
},
"visit_directional": function(node2) {
return "to " + node2.value;
},
"visit_array": function(elements2) {
var result = "", size4 = elements2.length;
elements2.forEach(function(element, i3) {
result += visitor.visit(element);
if (i3 < size4 - 1) {
result += ", ";
}
});
return result;
},
"visit_object": function(obj) {
if (obj.width && obj.height) {
return visitor.visit(obj.width) + " " + visitor.visit(obj.height);
}
return "";
},
"visit": function(element) {
if (!element) {
return "";
}
var result = "";
if (element instanceof Array) {
return visitor.visit_array(element);
} else if (typeof element === "object" && !element.type) {
return visitor.visit_object(element);
} else if (element.type) {
var nodeVisitor = visitor["visit_" + element.type];
if (nodeVisitor) {
return nodeVisitor(element);
} else {
throw Error("Missing visitor visit_" + element.type);
}
} else {
throw Error("Invalid node.");
}
}
};
return function(root) {
return visitor.visit(root);
};
})();
var GradientParser = GradientParser || {};
GradientParser.parse = /* @__PURE__ */ (function() {
var tokens = {
linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
positionKeywords: /^(left|center|right|top|bottom)/i,
pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
radianValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,
startCall: /^\(/,
endCall: /^\)/,
comma: /^,/,
hexColor: /^\#([0-9a-fA-F]+)/,
literalColor: /^([a-zA-Z]+)/,
rgbColor: /^rgb/i,
rgbaColor: /^rgba/i,
varColor: /^var/i,
calcValue: /^calc/i,
variableName: /^(--[a-zA-Z0-9-,\s\#]+)/,
number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,
hslColor: /^hsl/i,
hslaColor: /^hsla/i
};
var input = "";
function error(msg) {
var err = new Error(input + ": " + msg);
err.source = input;
throw err;
}
function getAST() {
var ast = matchListDefinitions();
if (input.length > 0) {
error("Invalid input not EOF");
}
return ast;
}
function matchListDefinitions() {
return matchListing(matchDefinition);
}
function matchDefinition() {
return matchGradient(
"linear-gradient",
tokens.linearGradient,
matchLinearOrientation
) || matchGradient(
"repeating-linear-gradient",
tokens.repeatingLinearGradient,
matchLinearOrientation
) || matchGradient(
"radial-gradient",
tokens.radialGradient,
matchListRadialOrientations
) || matchGradient(
"repeating-radial-gradient",
tokens.repeatingRadialGradient,
matchListRadialOrientations
);
}
function matchGradient(gradientType, pattern, orientationMatcher) {
return matchCall(pattern, function(captures) {
var orientation = orientationMatcher();
if (orientation) {
if (!scan(tokens.comma)) {
error("Missing comma before color stops");
}
}
return {
type: gradientType,
orientation,
colorStops: matchListing(matchColorStop)
};
});
}
function matchCall(pattern, callback) {
var captures = scan(pattern);
if (captures) {
if (!scan(tokens.startCall)) {
error("Missing (");
}
var result = callback(captures);
if (!scan(tokens.endCall)) {
error("Missing )");
}
return result;
}
}
function matchLinearOrientation() {
var sideOrCorner = matchSideOrCorner();
if (sideOrCorner) {
return sideOrCorner;
}
var legacyDirection = match4("position-keyword", tokens.positionKeywords, 1);
if (legacyDirection) {
return {
type: "directional",
value: legacyDirection.value
};
}
return matchAngle();
}
function matchSideOrCorner() {
return match4("directional", tokens.sideOrCorner, 1);
}
function matchAngle() {
return match4("angular", tokens.angleValue, 1) || match4("angular", tokens.radianValue, 1);
}
function matchListRadialOrientations() {
var radialOrientations, radialOrientation = matchRadialOrientation(), lookaheadCache;
if (radialOrientation) {
radialOrientations = [];
radialOrientations.push(radialOrientation);
lookaheadCache = input;
if (scan(tokens.comma)) {
radialOrientation = matchRadialOrientation();
if (radialOrientation) {
radialOrientations.push(radialOrientation);
} else {
input = lookaheadCache;
}
}
}
return radialOrientations;
}
function matchRadialOrientation() {
var radialType = matchCircle() || matchEllipse();
if (radialType) {
radialType.at = matchAtPosition();
} else {
var extent = matchExtentKeyword();
if (extent) {
radialType = extent;
var positionAt = matchAtPosition();
if (positionAt) {
radialType.at = positionAt;
}
} else {
var atPosition = matchAtPosition();
if (atPosition) {
radialType = {
type: "default-radial",
at: atPosition
};
} else {
var defaultPosition = matchPositioning();
if (defaultPosition) {
radialType = {
type: "default-radial",
at: defaultPosition
};
}
}
}
}
return radialType;
}
function matchCircle() {
var circle = match4("shape", /^(circle)/i, 0);
if (circle) {
circle.style = matchLength() || matchExtentKeyword();
}
return circle;
}
function matchEllipse() {
var ellipse = match4("shape", /^(ellipse)/i, 0);
if (ellipse) {
ellipse.style = matchPositioning() || matchDistance() || matchExtentKeyword();
}
return ellipse;
}
function matchExtentKeyword() {
return match4("extent-keyword", tokens.extentKeywords, 1);
}
function matchAtPosition() {
if (match4("position", /^at/, 0)) {
var positioning = matchPositioning();
if (!positioning) {
error("Missing positioning value");
}
return positioning;
}
}
function matchPositioning() {
var location = matchCoordinates();
if (location.x || location.y) {
return {
type: "position",
value: location
};
}
}
function matchCoordinates() {
return {
x: matchDistance(),
y: matchDistance()
};
}
function matchListing(matcher) {
var captures = matcher(), result = [];
if (captures) {
result.push(captures);
while (scan(tokens.comma)) {
captures = matcher();
if (captures) {
result.push(captures);
} else {
error("One extra comma");
}
}
}
return result;
}
function matchColorStop() {
var color2 = matchColor();
if (!color2) {
error("Expected color definition");
}
color2.length = matchDistance();
return color2;
}
function matchColor() {
return matchHexColor() || matchHSLAColor() || matchHSLColor() || matchRGBAColor() || matchRGBColor() || matchVarColor() || matchLiteralColor();
}
function matchLiteralColor() {
return match4("literal", tokens.literalColor, 0);
}
function matchHexColor() {
return match4("hex", tokens.hexColor, 1);
}
function matchRGBColor() {
return matchCall(tokens.rgbColor, function() {
return {
type: "rgb",
value: matchListing(matchNumber)
};
});
}
function matchRGBAColor() {
return matchCall(tokens.rgbaColor, function() {
return {
type: "rgba",
value: matchListing(matchNumber)
};
});
}
function matchVarColor() {
return matchCall(tokens.varColor, function() {
return {
type: "var",
value: matchVariableName()
};
});
}
function matchHSLColor() {
return matchCall(tokens.hslColor, function() {
var lookahead = scan(tokens.percentageValue);
if (lookahead) {
error("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");
}
var hue = matchNumber();
scan(tokens.comma);
var captures = scan(tokens.percentageValue);
var sat = captures ? captures[1] : null;
scan(tokens.comma);
captures = scan(tokens.percentageValue);
var light = captures ? captures[1] : null;
if (!sat || !light) {
error("Expected percentage value for saturation and lightness in HSL");
}
return {
type: "hsl",
value: [hue, sat, light]
};
});
}
function matchHSLAColor() {
return matchCall(tokens.hslaColor, function() {
var hue = matchNumber();
scan(tokens.comma);
var captures = scan(tokens.percentageValue);
var sat = captures ? captures[1] : null;
scan(tokens.comma);
captures = scan(tokens.percentageValue);
var light = captures ? captures[1] : null;
scan(tokens.comma);
var alpha2 = matchNumber();
if (!sat || !light) {
error("Expected percentage value for saturation and lightness in HSLA");
}
return {
type: "hsla",
value: [hue, sat, light, alpha2]
};
});
}
function matchPercentage() {
var captures = scan(tokens.percentageValue);
return captures ? captures[1] : null;
}
function matchVariableName() {
return scan(tokens.variableName)[1];
}
function matchNumber() {
return scan(tokens.number)[1];
}
function matchDistance() {
return match4("%", tokens.percentageValue, 1) || matchPositionKeyword() || matchCalc() || matchLength();
}
function matchPositionKeyword() {
return match4("position-keyword", tokens.positionKeywords, 1);
}
function matchCalc() {
return matchCall(tokens.calcValue, function() {
var openParenCount = 1;
var i3 = 0;
while (openParenCount > 0 && i3 < input.length) {
var char2 = input.charAt(i3);
if (char2 === "(") {
openParenCount++;
} else if (char2 === ")") {
openParenCount--;
}
i3++;
}
if (openParenCount > 0) {
error("Missing closing parenthesis in calc() expression");
}
var calcContent = input.substring(0, i3 - 1);
consume(i3 - 1);
return {
type: "calc",
value: calcContent
};
});
}
function matchLength() {
return match4("px", tokens.pixelValue, 1) || match4("em", tokens.emValue, 1);
}
function match4(type, pattern, captureIndex) {
var captures = scan(pattern);
if (captures) {
return {
type,
value: captures[captureIndex]
};
}
}
function scan(regexp) {
var captures, blankCaptures;
blankCaptures = /^[\n\r\t\s]+/.exec(input);
if (blankCaptures) {
consume(blankCaptures[0].length);
}
captures = regexp.exec(input);
if (captures) {
consume(captures[0].length);
}
return captures;
}
function consume(size4) {
input = input.substr(size4);
}
return function(code) {
input = code.toString().trim();
if (input.endsWith(";")) {
input = input.slice(0, -1);
}
return getAST();
};
})();
exports.parse = GradientParser.parse;
exports.stringify = GradientParser.stringify;
}
});
// package-external:@wordpress/dom
var require_dom = __commonJS({
"package-external:@wordpress/dom"(exports, module) {
module.exports = window.wp.dom;
}
});
// package-external:@wordpress/date
var require_date = __commonJS({
"package-external:@wordpress/date"(exports, module) {
module.exports = window.wp.date;
}
});
// package-external:@wordpress/escape-html
var require_escape_html = __commonJS({
"package-external:@wordpress/escape-html"(exports, module) {
module.exports = window.wp.escapeHtml;
}
});
// package-external:@wordpress/html-entities
var require_html_entities = __commonJS({
"package-external:@wordpress/html-entities"(exports, module) {
module.exports = window.wp.htmlEntities;
}
});
// node_modules/fast-memoize/src/index.js
var require_src = __commonJS({
"node_modules/fast-memoize/src/index.js"(exports, module) {
function memoize3(fn, options2) {
var cache2 = options2 && options2.cache ? options2.cache : cacheDefault;
var serializer = options2 && options2.serializer ? options2.serializer : serializerDefault;
var strategy = options2 && options2.strategy ? options2.strategy : strategyDefault;
return strategy(fn, {
cache: cache2,
serializer
});
}
function isPrimitive(value) {
return value == null || typeof value === "number" || typeof value === "boolean";
}
function monadic(fn, cache2, serializer, arg) {
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
var computedValue = cache2.get(cacheKey);
if (typeof computedValue === "undefined") {
computedValue = fn.call(this, arg);
cache2.set(cacheKey, computedValue);
}
return computedValue;
}
function variadic(fn, cache2, serializer) {
var args = Array.prototype.slice.call(arguments, 3);
var cacheKey = serializer(args);
var computedValue = cache2.get(cacheKey);
if (typeof computedValue === "undefined") {
computedValue = fn.apply(this, args);
cache2.set(cacheKey, computedValue);
}
return computedValue;
}
function assemble(fn, context, strategy, cache2, serialize2) {
return strategy.bind(
context,
fn,
cache2,
serialize2
);
}
function strategyDefault(fn, options2) {
var strategy = fn.length === 1 ? monadic : variadic;
return assemble(
fn,
this,
strategy,
options2.cache.create(),
options2.serializer
);
}
function strategyVariadic(fn, options2) {
var strategy = variadic;
return assemble(
fn,
this,
strategy,
options2.cache.create(),
options2.serializer
);
}
function strategyMonadic(fn, options2) {
var strategy = monadic;
return assemble(
fn,
this,
strategy,
options2.cache.create(),
options2.serializer
);
}
function serializerDefault() {
return JSON.stringify(arguments);
}
function ObjectWithoutPrototypeCache() {
this.cache = /* @__PURE__ */ Object.create(null);
}
ObjectWithoutPrototypeCache.prototype.has = function(key) {
return key in this.cache;
};
ObjectWithoutPrototypeCache.prototype.get = function(key) {
return this.cache[key];
};
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
this.cache[key] = value;
};
var cacheDefault = {
create: function create2() {
return new ObjectWithoutPrototypeCache();
}
};
module.exports = memoize3;
module.exports.strategies = {
variadic: strategyVariadic,
monadic: strategyMonadic
};
}
});
// package-external:@wordpress/hooks
var require_hooks = __commonJS({
"package-external:@wordpress/hooks"(exports, module) {
module.exports = window.wp.hooks;
}
});
// packages/components/build-module/index.mjs
var index_exports = {};
__export(index_exports, {
AlignmentMatrixControl: () => alignment_matrix_control_default,
AnglePickerControl: () => angle_picker_control_default,
Animate: () => animate_default,
Autocomplete: () => Autocomplete,
BaseControl: () => base_control_default,
BlockQuotation: () => import_primitives35.BlockQuotation,
BorderBoxControl: () => component_default24,
BorderControl: () => component_default21,
BoxControl: () => box_control_default,
Button: () => button_default,
ButtonGroup: () => button_group_default,
Card: () => component_default27,
CardBody: () => component_default29,
CardDivider: () => component_default31,
CardFooter: () => component_default32,
CardHeader: () => component_default33,
CardMedia: () => component_default34,
CheckboxControl: () => checkbox_control_default,
Circle: () => import_primitives35.Circle,
ClipboardButton: () => ClipboardButton,
ColorIndicator: () => color_indicator_default,
ColorPalette: () => color_palette_default,
ColorPicker: () => LegacyAdapter,
ComboboxControl: () => combobox_control_default,
Composite: () => Composite22,
CustomGradientPicker: () => custom_gradient_picker_default,
CustomSelectControl: () => custom_select_control_default,
Dashicon: () => dashicon_default,
DatePicker: () => date_picker_default,
DateTimePicker: () => date_time_default2,
Disabled: () => disabled_default,
Draggable: () => draggable_default,
DropZone: () => drop_zone_default,
DropZoneProvider: () => DropZoneProvider,
Dropdown: () => dropdown_default,
DropdownMenu: () => dropdown_menu_default,
DuotonePicker: () => duotone_picker_default,
DuotoneSwatch: () => duotone_swatch_default,
ExternalLink: () => external_link_default,
Fill: () => Fill,
Flex: () => component_default3,
FlexBlock: () => component_default5,
FlexItem: () => component_default4,
FocalPointPicker: () => focal_point_picker_default,
FocusReturnProvider: () => Provider3,
FocusableIframe: () => FocusableIframe,
FontSizePicker: () => font_size_picker_default,
FormFileUpload: () => form_file_upload_default,
FormToggle: () => form_toggle_default,
FormTokenField: () => form_token_field_default,
G: () => import_primitives35.G,
GradientPicker: () => gradient_picker_default,
Guide: () => guide_default,
GuidePage: () => GuidePage,
HorizontalRule: () => import_primitives35.HorizontalRule,
Icon: () => icon_default3,
IconButton: () => deprecated_default,
IsolatedEventContainer: () => isolated_event_container_default,
KeyboardShortcuts: () => keyboard_shortcuts_default,
Line: () => import_primitives35.Line,
MenuGroup: () => menu_group_default,
MenuItem: () => menu_item_default,
MenuItemsChoice: () => menu_items_choice_default,
Modal: () => modal_default,
NavigableMenu: () => menu_default2,
Navigator: () => Navigator3,
Notice: () => notice_default,
NoticeList: () => list_default,
Panel: () => panel_default,
PanelBody: () => body_default,
PanelHeader: () => header_default,
PanelRow: () => row_default,
Path: () => import_primitives35.Path,
Placeholder: () => placeholder_default,
Polygon: () => import_primitives35.Polygon,
Popover: () => popover_default,
ProgressBar: () => progress_bar_default,
QueryControls: () => query_controls_default,
RadioControl: () => radio_control_default,
RangeControl: () => range_control_default,
Rect: () => import_primitives35.Rect,
ResizableBox: () => resizable_box_default,
ResponsiveWrapper: () => responsive_wrapper_default,
SVG: () => import_primitives35.SVG,
SandBox: () => sandbox_default,
ScrollLock: () => scroll_lock_default,
SearchControl: () => search_control_default,
SelectControl: () => select_control_default,
Slot: () => Slot3,
SlotFillProvider: () => Provider,
Snackbar: () => snackbar_default,
SnackbarList: () => list_default2,
Spinner: () => spinner_default,
TabPanel: () => tab_panel_default,
TabbableContainer: () => tabbable_default,
TextControl: () => text_control_default,
TextHighlight: () => text_highlight_default,
TextareaControl: () => textarea_control_default,
TimePicker: () => time_picker_default,
Tip: () => tip_default2,
ToggleControl: () => toggle_control_default,
Toolbar: () => toolbar_default,
ToolbarButton: () => toolbar_button_default,
ToolbarDropdownMenu: () => toolbar_dropdown_menu_default,
ToolbarGroup: () => toolbar_group_default,
ToolbarItem: () => toolbar_item_default,
Tooltip: () => tooltip_default,
TreeSelect: () => tree_select_default,
VisuallyHidden: () => component_default2,
__experimentalAlignmentMatrixControl: () => alignment_matrix_control_default,
__experimentalBorderBoxControl: () => component_default24,
__experimentalBorderControl: () => component_default21,
__experimentalBoxControl: () => box_control_default,
__experimentalConfirmDialog: () => component_default37,
__experimentalDivider: () => component_default30,
__experimentalDropdownContentWrapper: () => dropdown_content_wrapper_default,
__experimentalElevation: () => component_default25,
__experimentalGrid: () => component_default22,
__experimentalHStack: () => component_default9,
__experimentalHasSplitBorders: () => hasSplitBorders,
__experimentalHeading: () => component_default19,
__experimentalInputControl: () => input_control_default,
__experimentalInputControlPrefixWrapper: () => input_prefix_wrapper_default,
__experimentalInputControlSuffixWrapper: () => input_suffix_wrapper_default,
__experimentalIsDefinedBorder: () => isDefinedBorder,
__experimentalIsEmptyBorder: () => isEmptyBorder,
__experimentalItem: () => component_default35,
__experimentalItemGroup: () => component_default36,
__experimentalNavigatorBackButton: () => NavigatorBackButton2,
__experimentalNavigatorButton: () => NavigatorButton2,
__experimentalNavigatorProvider: () => NavigatorProvider,
__experimentalNavigatorScreen: () => NavigatorScreen2,
__experimentalNavigatorToParentButton: () => NavigatorToParentButton2,
__experimentalNumberControl: () => number_control_default,
__experimentalPaletteEdit: () => palette_edit_default,
__experimentalParseQuantityAndUnitFromRawValue: () => parseQuantityAndUnitFromRawValue,
__experimentalRadio: () => radio_default,
__experimentalRadioGroup: () => radio_group_default,
__experimentalScrollable: () => component_default28,
__experimentalSpacer: () => component_default6,
__experimentalStyleProvider: () => style_provider_default,
__experimentalSurface: () => component_default26,
__experimentalText: () => component_default8,
__experimentalToggleGroupControl: () => component_default12,
__experimentalToggleGroupControlOption: () => component_default14,
__experimentalToggleGroupControlOptionIcon: () => component_default15,
__experimentalToolbarContext: () => toolbar_context_default,
__experimentalToolsPanel: () => component_default39,
__experimentalToolsPanelContext: () => ToolsPanelContext,
__experimentalToolsPanelItem: () => component_default40,
__experimentalTreeGrid: () => tree_grid_default,
__experimentalTreeGridCell: () => cell_default,
__experimentalTreeGridItem: () => item_default2,
__experimentalTreeGridRow: () => row_default2,
__experimentalTruncate: () => component_default7,
__experimentalUnitControl: () => unit_control_default,
__experimentalUseCustomUnits: () => useCustomUnits,
__experimentalUseNavigator: () => useNavigator,
__experimentalUseSlot: () => useSlot,
__experimentalUseSlotFills: () => useSlotFills,
__experimentalVStack: () => component_default18,
__experimentalView: () => component_default,
__experimentalZStack: () => component_default41,
__unstableAnimatePresence: () => AnimatePresence,
__unstableComposite: () => Composite4,
__unstableCompositeGroup: () => CompositeGroup4,
__unstableCompositeItem: () => CompositeItem4,
__unstableDisclosureContent: () => DisclosureContent22,
__unstableGetAnimateClassName: () => getAnimateClassName,
__unstableMotion: () => motion,
__unstableUseAutocompleteProps: () => useAutocompleteProps,
__unstableUseCompositeState: () => useCompositeState,
__unstableUseNavigateRegions: () => useNavigateRegions,
createSlotFill: () => createSlotFill,
navigateRegions: () => navigate_regions_default,
privateApis: () => privateApis,
useBaseControlProps: () => useBaseControlProps,
useNavigator: () => useNavigator,
withConstrainedTabbing: () => with_constrained_tabbing_default,
withFallbackStyles: () => with_fallback_styles_default,
withFilters: () => withFilters,
withFocusOutside: () => with_focus_outside_default,
withFocusReturn: () => with_focus_return_default,
withNotices: () => with_notices_default,
withSpokenMessages: () => with_spoken_messages_default
});
var import_primitives35 = __toESM(require_primitives(), 1);
// node_modules/clsx/dist/clsx.mjs
function r(e3) {
var t4, f3, n3 = "";
if ("string" == typeof e3 || "number" == typeof e3) n3 += e3;
else if ("object" == typeof e3) if (Array.isArray(e3)) {
var o4 = e3.length;
for (t4 = 0; t4 < o4; t4++) e3[t4] && (f3 = r(e3[t4])) && (n3 && (n3 += " "), n3 += f3);
} else for (f3 in e3) e3[f3] && (n3 && (n3 += " "), n3 += f3);
return n3;
}
function clsx() {
for (var e3, t4, f3 = 0, n3 = "", o4 = arguments.length; f3 < o4; f3++) (e3 = arguments[f3]) && (t4 = r(e3)) && (n3 && (n3 += " "), n3 += t4);
return n3;
}
var clsx_default = clsx;
// packages/components/build-module/alignment-matrix-control/index.mjs
var import_i18n4 = __toESM(require_i18n(), 1);
var import_compose2 = __toESM(require_compose(), 1);
var import_element19 = __toESM(require_element(), 1);
// node_modules/@ariakit/react-components/dist/focusable/focusable-context.js
var import_react = __toESM(require_react(), 1);
var FocusableContext = (0, import_react.createContext)(true);
// node_modules/@ariakit/utils/dist/index.js
function toArray(arg) {
if (Array.isArray(arg)) return arg;
return typeof arg !== "undefined" ? [arg] : [];
}
function flatten2DArray(array) {
const flattened = [];
for (const row of array) flattened.push(...row);
return flattened;
}
function reverseArray(array) {
return array.slice().reverse();
}
function noop(..._2) {
}
function shallowEqual(a3, b3) {
if (a3 === b3) return true;
if (!a3) return false;
if (!b3) return false;
if (typeof a3 !== "object") return false;
if (typeof b3 !== "object") return false;
const aKeys = Object.keys(a3);
const bKeys = Object.keys(b3);
const { length: length2 } = aKeys;
if (bKeys.length !== length2) return false;
for (const key of aKeys) if (a3[key] !== b3[key]) return false;
return true;
}
function applyState(argument, currentValue) {
if (isUpdater(argument)) return argument(isLazyValue(currentValue) ? currentValue() : currentValue);
return argument;
}
function isUpdater(argument) {
return typeof argument === "function";
}
function isLazyValue(value) {
return typeof value === "function";
}
function hasOwnProperty(object, prop) {
if (typeof Object.hasOwn === "function") return Object.hasOwn(object, prop);
return Object.prototype.hasOwnProperty.call(object, prop);
}
function chain(...fns) {
return (...args) => {
for (const fn of fns) if (typeof fn === "function") fn(...args);
};
}
function normalizeString(str) {
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function omit(object, keys) {
const result = { ...object };
for (const key of keys) if (hasOwnProperty(result, key)) delete result[key];
return result;
}
function pick(object, paths) {
const result = {};
for (const key of paths) if (hasOwnProperty(object, key)) result[key] = object[key];
return result;
}
function identity(value) {
return value;
}
function afterPaint(cb = noop) {
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(cb);
});
return () => cancelAnimationFrame(raf);
}
function invariant(condition, message2) {
if (condition) return;
if (typeof message2 !== "string") throw new Error("Invariant failed");
throw new Error(message2);
}
function getKeys(obj) {
return Object.keys(obj);
}
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
if (result == null) return false;
return !result;
}
function disabledFromProps(props) {
return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
}
function disabledFromElement(element) {
if (element.getAttribute("aria-disabled") === "true") return true;
if ("disabled" in element && element.disabled === true) return true;
return false;
}
function removeUndefinedValues(obj) {
const result = {};
for (const key in obj) if (obj[key] !== void 0) result[key] = obj[key];
return result;
}
function defaultValue(...values) {
for (const value of values) if (value !== void 0) return value;
}
var canUseDOM = checkIsBrowser();
function checkIsBrowser() {
return typeof window !== "undefined" && !!window.document?.createElement;
}
function getDocument(node2) {
if (!node2) return document;
if ("self" in node2) return node2.document;
return node2.ownerDocument || document;
}
function getWindow(node2) {
if (!node2) return self;
if ("self" in node2) return node2.self;
return getDocument(node2).defaultView || window;
}
function getActiveElement(node2, activeDescendant = false) {
const { activeElement } = getDocument(node2);
if (!activeElement?.nodeName) return null;
if (isFrame(activeElement) && activeElement.contentDocument?.body) return getActiveElement(activeElement.contentDocument.body, activeDescendant);
if (activeDescendant) {
const id3 = activeElement.getAttribute("aria-activedescendant");
if (id3) {
const element = getDocument(activeElement).getElementById(id3);
if (element) return element;
}
}
return activeElement;
}
function contains(parent, child) {
return parent === child || parent.contains(child);
}
function isElement(target) {
return target?.nodeType === 1;
}
function isNode(target) {
return typeof target?.nodeType === "number";
}
function isFrame(element) {
return element.tagName === "IFRAME";
}
function isButton(element) {
const tagName = element.tagName.toLowerCase();
if (tagName === "button") return true;
if (tagName === "input" && element.type) return buttonInputTypes.indexOf(element.type) !== -1;
return false;
}
var buttonInputTypes = [
"button",
"color",
"file",
"image",
"reset",
"submit"
];
function isVisible(element) {
if (typeof element.checkVisibility === "function") return element.checkVisibility();
const htmlElement = element;
return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isTextField(element) {
try {
if (element.tagName === "TEXTAREA") return true;
if (element.tagName !== "INPUT") return false;
return element.selectionStart !== null;
} catch (_error) {
return false;
}
}
function isTextbox(element) {
return element.isContentEditable || isTextField(element);
}
function getTextboxValue(element) {
if (isTextField(element)) return element.value;
if (element.isContentEditable) {
const range = getDocument(element).createRange();
range.selectNodeContents(element);
return range.toString();
}
return "";
}
function getTextboxSelection(element) {
let start = 0;
let end = 0;
if (isTextField(element)) {
start = element.selectionStart || 0;
end = element.selectionEnd || 0;
} else if (element.isContentEditable) {
const selection = getDocument(element).getSelection();
if (selection?.rangeCount && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) {
const range = selection.getRangeAt(0);
const nextRange = range.cloneRange();
nextRange.selectNodeContents(element);
nextRange.setEnd(range.startContainer, range.startOffset);
start = nextRange.toString().length;
nextRange.setEnd(range.endContainer, range.endOffset);
end = nextRange.toString().length;
}
}
return {
start,
end
};
}
var allowedPopupRoles = [
"dialog",
"menu",
"listbox",
"tree",
"grid"
];
var itemRoleByPopupRole = {
menu: "menuitem",
listbox: "option",
tree: "treeitem"
};
function getPopupRole(element, fallback) {
const role = element?.getAttribute("role");
if (role && allowedPopupRoles.indexOf(role) !== -1) return role;
return fallback;
}
function getItemRoleByPopupRole(popupRole) {
if (popupRole == null) return;
if (!hasOwnProperty(itemRoleByPopupRole, popupRole)) return;
return itemRoleByPopupRole[popupRole];
}
function getPopupItemRole(element, fallback) {
const popupRole = getPopupRole(element);
if (typeof popupRole !== "string") return fallback;
return getItemRoleByPopupRole(popupRole) ?? fallback;
}
function getScrollingElement(element) {
if (!element) return null;
const isScrollableOverflow = (overflow) => {
if (overflow === "auto") return true;
if (overflow === "scroll") return true;
return false;
};
if (element.clientHeight && element.scrollHeight > element.clientHeight) {
const { overflowY } = getComputedStyle(element);
if (isScrollableOverflow(overflowY)) return element;
} else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
const { overflowX } = getComputedStyle(element);
if (isScrollableOverflow(overflowX)) return element;
}
const doc = getDocument(element);
return getScrollingElement(element.parentElement) || doc.scrollingElement || doc.body;
}
function sortBasedOnDOMPosition(items, getElement) {
const pairs = items.map((item2, index2) => [index2, item2]);
let isOrderDifferent = false;
pairs.sort(([indexA, a3], [indexB, b3]) => {
const elementA = getElement(a3);
const elementB = getElement(b3);
if (elementA === elementB) return 0;
if (!elementA || !elementB) return 0;
if (isElementPreceding(elementA, elementB)) {
if (indexA > indexB) isOrderDifferent = true;
return -1;
}
if (indexA < indexB) isOrderDifferent = true;
return 1;
});
if (isOrderDifferent) return pairs.map(([_2, item2]) => item2);
return items;
}
function isElementPreceding(a3, b3) {
return Boolean(b3.compareDocumentPosition(a3) & Node.DOCUMENT_POSITION_PRECEDING);
}
function isTouchDevice() {
return canUseDOM && !!navigator.maxTouchPoints;
}
function isApple() {
if (!canUseDOM) return false;
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
}
function isSafari() {
return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
}
function isFirefox() {
return canUseDOM && /firefox\//i.test(navigator.userAgent);
}
function isMac() {
return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
}
function isPortalEvent(event) {
const { currentTarget, target } = event;
if (!currentTarget) return false;
if (!isNode(target)) return true;
return !contains(currentTarget, target);
}
function isSelfTarget(event) {
return event.target === event.currentTarget;
}
function isActivatableNavigationTarget(element) {
if (!isElement(element)) return false;
const target = element;
const tagName = target.tagName.toLowerCase();
if (tagName === "a") return true;
if (tagName === "button" && target.type === "submit") return true;
if (tagName === "input" && target.type === "submit") return true;
return false;
}
function isOpeningInNewTab(event) {
const isAppleDevice = isApple();
if (isAppleDevice && !event.metaKey) return false;
if (!isAppleDevice && !event.ctrlKey) return false;
return isActivatableNavigationTarget(event.currentTarget);
}
function isDownloading(event) {
if (!event.altKey) return false;
return isActivatableNavigationTarget(event.currentTarget);
}
function fireEvent(element, type, eventInit) {
const event = new Event(type, eventInit);
return element.dispatchEvent(event);
}
function fireBlurEvent(element, eventInit) {
const event = new FocusEvent("blur", eventInit);
const defaultAllowed = element.dispatchEvent(event);
const bubbleInit = {
...eventInit,
bubbles: true
};
element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
return defaultAllowed;
}
function fireKeyboardEvent(element, type, eventInit) {
const event = new KeyboardEvent(type, eventInit);
return element.dispatchEvent(event);
}
function fireClickEvent(element, eventInit) {
const event = new MouseEvent("click", eventInit);
return element.dispatchEvent(event);
}
function isFocusEventOutside(event, container) {
const containerElement = container || event.currentTarget;
const relatedTarget = event.relatedTarget;
return !isNode(relatedTarget) || !contains(containerElement, relatedTarget);
}
function queueBeforeEvent(element, type, callback, timeout) {
const createTimer = (callback2) => {
if (timeout) {
const timerId2 = setTimeout(callback2, timeout);
return () => clearTimeout(timerId2);
}
const timerId = requestAnimationFrame(callback2);
return () => cancelAnimationFrame(timerId);
};
const cancelTimer = createTimer(() => {
element.removeEventListener(type, callSync, true);
callback();
});
const callSync = () => {
cancelTimer();
callback();
};
element.addEventListener(type, callSync, {
once: true,
capture: true
});
return () => {
cancelTimer();
element.removeEventListener(type, callSync, true);
};
}
function addGlobalEventListener(type, listener, options2, scope = window) {
const children = [];
try {
scope.document.addEventListener(type, listener, options2);
for (const frame2 of Array.from(scope.frames)) children.push(addGlobalEventListener(type, listener, options2, frame2));
} catch {
}
const removeEventListener = () => {
try {
scope.document.removeEventListener(type, listener, options2);
} catch {
}
for (const remove of children) remove();
};
return removeEventListener;
}
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
function hasNegativeTabIndex(element) {
return Number.parseInt(element.getAttribute("tabindex") || "0", 10) < 0;
}
function isFocusable(element) {
if (!element.matches(selector)) return false;
if (!isVisible(element)) return false;
if (element.closest("[inert]")) return false;
return true;
}
function isTabbable(element) {
if (!isFocusable(element)) return false;
if (hasNegativeTabIndex(element)) return false;
if (!("form" in element)) return true;
if (!element.form) return true;
if (element.checked) return true;
if (element.type !== "radio") return true;
const radioGroup = element.form.elements.namedItem(element.name);
if (!radioGroup) return true;
if (!("length" in radioGroup)) return true;
const activeElement = getActiveElement(element);
if (!activeElement) return true;
if (activeElement === element) return true;
if (!("form" in activeElement)) return true;
if (activeElement.form !== element.form) return true;
if (activeElement.name !== element.name) return true;
return false;
}
function getAllFocusableIn(container, includeContainer) {
const elements2 = Array.from(container.querySelectorAll(selector));
if (includeContainer) elements2.unshift(container);
const focusableElements2 = elements2.filter(isFocusable);
focusableElements2.forEach((element, i3) => {
if (!isFrame(element)) return;
const frameBody = element.contentDocument?.body;
if (!frameBody) return;
focusableElements2.splice(i3, 1, ...getAllFocusableIn(frameBody));
});
return focusableElements2;
}
function getFirstFocusableIn(container, includeContainer) {
const [first] = getAllFocusableIn(container, includeContainer);
return first || null;
}
function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
const tabbableElements = Array.from(container.querySelectorAll(selector)).filter(isTabbable);
if (includeContainer && isTabbable(container)) tabbableElements.unshift(container);
tabbableElements.forEach((element, i3) => {
if (!isFrame(element)) return;
const frameBody = element.contentDocument?.body;
if (!frameBody) return;
const allFrameTabbable = getAllTabbableIn(frameBody, false, fallbackToFocusable);
tabbableElements.splice(i3, 1, ...allFrameTabbable);
});
if (!tabbableElements.length && fallbackToFocusable) return getAllFocusableIn(container);
return tabbableElements;
}
function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
if (includeContainer && isTabbable(container)) {
if (!isFrame(container)) return container;
const containerFrameBody = container.contentDocument?.body;
if (!containerFrameBody) return container;
const frameTabbable = getFirstTabbableIn(containerFrameBody, false, fallbackToFocusable);
if (frameTabbable) return frameTabbable;
}
const elements2 = container.querySelectorAll(selector);
for (const element of elements2) {
if (!isTabbable(element)) continue;
if (isFrame(element)) {
const frameBody = element.contentDocument?.body;
if (!frameBody) return element;
const frameTabbable = getFirstTabbableIn(frameBody, false, fallbackToFocusable);
if (frameTabbable) return frameTabbable;
continue;
}
return element;
}
if (fallbackToFocusable) return getFirstFocusableIn(container);
return null;
}
function getTabbableInDirection({ container, includeContainer, reverse, fallbackToEdge, fallbackToFocusable }) {
const activeElement = getActiveElement(container);
const allFocusable = getAllFocusableIn(container, includeContainer);
if (reverse) allFocusable.reverse();
const activeIndex = allFocusable.indexOf(activeElement);
const candidates = allFocusable.slice(activeIndex + 1);
return candidates.find(isTabbable) || (fallbackToEdge ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? candidates[0] : null) || null;
}
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
return getTabbableInDirection({
container,
includeContainer,
fallbackToEdge: fallbackToFirst,
fallbackToFocusable
});
}
function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
return getNextTabbableIn(document.body, false, fallbackToFirst, fallbackToFocusable);
}
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
return getTabbableInDirection({
container,
includeContainer,
reverse: true,
fallbackToEdge: fallbackToLast,
fallbackToFocusable
});
}
function getPreviousTabbable(fallbackToLast, fallbackToFocusable) {
return getPreviousTabbableIn(document.body, false, fallbackToLast, fallbackToFocusable);
}
function hasFocus(element) {
const activeElement = getActiveElement(element);
if (!activeElement) return false;
if (activeElement === element) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
return activeDescendant === element.id;
}
function hasFocusWithin(element) {
const activeElement = getActiveElement(element);
if (!activeElement) return false;
if (contains(element, activeElement)) return true;
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
if (!("id" in element)) return false;
if (activeDescendant === element.id) return true;
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
}
function disableFocus(element) {
const currentTabindex = element.getAttribute("tabindex") ?? "";
element.setAttribute("data-tabindex", currentTabindex);
element.setAttribute("tabindex", "-1");
}
function disableFocusIn(container, includeContainer) {
const tabbableElements = getAllTabbableIn(container, includeContainer);
for (const element of tabbableElements) disableFocus(element);
}
function restoreFocusIn(container) {
const elements2 = container.querySelectorAll("[data-tabindex]");
const restoreTabIndex = (element) => {
const tabindex = element.getAttribute("data-tabindex");
element.removeAttribute("data-tabindex");
if (tabindex) element.setAttribute("tabindex", tabindex);
else element.removeAttribute("tabindex");
};
if (container.hasAttribute("data-tabindex")) restoreTabIndex(container);
for (const element of elements2) restoreTabIndex(element);
}
function focusIntoView(element, options2) {
if (!("scrollIntoView" in element)) element.focus();
else {
element.focus({ preventScroll: true });
element.scrollIntoView({
block: "nearest",
inline: "nearest",
...options2
});
}
}
function createUndoCallback(callback) {
return async () => {
const redo = await callback?.();
return createUndoCallback(async () => {
await redo?.();
return callback;
});
};
}
var UndoManager = createUndoManager();
function createUndoManager({ limit = 100 } = {}) {
const undoStack = [];
let redoStack = [];
let currentGroup = null;
const canUndo = () => undoStack.length > 0;
const canRedo = () => redoStack.length > 0;
const undo = async () => {
if (!canUndo()) return;
currentGroup = null;
redoStack.push(await undoStack.pop()?.());
};
const redo = async () => {
if (!canRedo()) return;
currentGroup = null;
undoStack.push(await redoStack.pop()?.());
};
const execute = async (callback, group) => {
if (!callback) return;
const sameGroup = group === currentGroup;
currentGroup = group ?? null;
const nextIndex = sameGroup ? Math.max(0, undoStack.length - 1) : undoStack.length;
const undoCallback = await callback();
if (!undoCallback) return;
redoStack = [];
const currentUndo = undoStack[nextIndex];
undoStack[nextIndex] = createUndoCallback(async () => {
await undoCallback?.();
const currentRedo = await currentUndo?.();
return async () => {
await currentRedo?.();
await callback?.();
};
});
while (undoStack.length > limit) undoStack.shift();
};
return {
canUndo,
canRedo,
undo,
redo,
execute
};
}
// node_modules/@ariakit/react-utils/dist/index.js
var React = __toESM(require_react(), 1);
var import_react2 = __toESM(require_react(), 1);
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
function setRef(ref, value) {
if (typeof ref === "function") {
const cleanup = ref(value);
if (typeof cleanup === "function") return cleanup;
} else if (ref) ref.current = value;
}
function isValidElementWithRef(element) {
if (!element) return false;
if (!(0, import_react2.isValidElement)(element)) return false;
if ("ref" in element.props) return true;
if ("ref" in element) return true;
return false;
}
function getRefProperty(element) {
if (!isValidElementWithRef(element)) return null;
return { ...element.props }.ref || element.ref;
}
function mergeProps(base, overrides) {
const props = { ...base };
for (const key in overrides) {
if (!hasOwnProperty(overrides, key)) continue;
if (key === "className") {
const prop = "className";
const baseClass = base[prop];
const overrideClass = overrides[prop];
if (baseClass && overrideClass) props[prop] = `${baseClass} ${overrideClass}`;
else props[prop] = overrideClass || baseClass;
continue;
}
if (key === "style") {
const prop = "style";
props[prop] = base[prop] ? {
...base[prop],
...overrides[prop]
} : overrides[prop];
continue;
}
const overrideValue = overrides[key];
if (key.startsWith("on")) {
if (typeof overrideValue !== "function") continue;
const baseValue = base[key];
if (typeof baseValue === "function") {
props[key] = (...args) => {
overrideValue(...args);
baseValue(...args);
};
continue;
}
}
props[key] = overrideValue;
}
return props;
}
var _React = { ...React };
var useReactId = _React.useId;
var useReactDeferredValue = _React.useDeferredValue;
var useReactInsertionEffect = _React.useInsertionEffect;
var useSafeLayoutEffect = canUseDOM ? import_react2.useLayoutEffect : import_react2.useEffect;
function useInitialValue(value) {
const [initialValue2] = (0, import_react2.useState)(value);
return initialValue2;
}
function useLiveRef(value) {
const ref = (0, import_react2.useRef)(value);
useSafeLayoutEffect(() => {
ref.current = value;
});
return ref;
}
function useEvent(callback) {
const ref = (0, import_react2.useRef)(() => {
throw new Error("Cannot call an event handler while rendering.");
});
if (useReactInsertionEffect) useReactInsertionEffect(() => {
ref.current = callback;
});
else ref.current = callback;
return (0, import_react2.useCallback)((...args) => ref.current?.(...args), []);
}
function useTransactionState(callback) {
const [state, setState] = (0, import_react2.useState)(null);
useSafeLayoutEffect(() => {
if (state == null) return;
if (!callback) return;
let prevState = null;
callback((prev2) => {
prevState = prev2;
return state;
});
return () => {
callback(prevState);
};
}, [state, callback]);
return [state, setState];
}
function useMergeRefs(...refs) {
return (0, import_react2.useMemo)(() => {
if (!refs.some(Boolean)) return;
return (value) => {
const refEffects = [];
for (const ref of refs) {
if (!ref) continue;
const cleanup = setRef(ref, value);
refEffects.push({
ref,
cleanup: typeof cleanup === "function" ? cleanup : void 0
});
}
if (!refEffects.some((effect) => effect.cleanup)) return;
return () => {
for (const { ref, cleanup } of refEffects) if (cleanup) cleanup();
else setRef(ref, null);
};
};
}, refs);
}
function useId(defaultId) {
if (useReactId) {
const reactId = useReactId();
if (defaultId) return defaultId;
return reactId;
}
const [id3, setId] = (0, import_react2.useState)(defaultId);
useSafeLayoutEffect(() => {
if (defaultId || id3) return;
setId(`id-${Math.random().toString(36).slice(2, 8)}`);
}, [defaultId, id3]);
return defaultId || id3;
}
function useTagName(refOrElement, type) {
const stringOrUndefined = (type2) => {
if (typeof type2 !== "string") return;
return type2;
};
const [tagName, setTagName] = (0, import_react2.useState)(() => stringOrUndefined(type));
useSafeLayoutEffect(() => {
setTagName((refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement)?.tagName.toLowerCase() || stringOrUndefined(type));
}, [refOrElement, type]);
return tagName;
}
function useUpdateEffect(effect, deps) {
const mounted = (0, import_react2.useRef)(false);
(0, import_react2.useEffect)(() => {
if (mounted.current) return effect();
mounted.current = true;
}, deps);
(0, import_react2.useEffect)(() => () => {
mounted.current = false;
}, []);
}
function useForceUpdate() {
return (0, import_react2.useReducer)(() => [], []);
}
function useBooleanEvent(booleanOrCallback) {
return useEvent(typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback);
}
function useWrapElement(props, callback, deps = []) {
const wrapElement = (0, import_react2.useCallback)((element) => {
if (props.wrapElement) element = props.wrapElement(element);
return callback(element);
}, [...deps, props.wrapElement]);
return {
...props,
wrapElement
};
}
function usePortalRef(portalProp = false, portalRefProp) {
const [portalNode, setPortalNode] = (0, import_react2.useState)(null);
return {
portalRef: useMergeRefs(setPortalNode, portalRefProp),
portalNode,
domReady: !portalProp || portalNode
};
}
function useMetadataProps(props, key, value) {
const parent = props.onLoadedMetadataCapture;
const onLoadedMetadataCapture = (0, import_react2.useMemo)(() => {
return Object.assign(() => {
}, parent, ...value !== void 0 ? [{ [key]: value }] : []);
}, [
parent,
key,
value
]);
return [parent?.[key], { onLoadedMetadataCapture }];
}
var hasInstalledGlobalEventListeners = false;
function useIsMouseMoving() {
(0, import_react2.useEffect)(() => {
if (hasInstalledGlobalEventListeners) return;
addGlobalEventListener("mousemove", setMouseMoving, true);
addGlobalEventListener("mousedown", resetMouseMoving, true);
addGlobalEventListener("mouseup", resetMouseMoving, true);
addGlobalEventListener("keydown", resetMouseMoving, true);
addGlobalEventListener("scroll", resetMouseMoving, true);
hasInstalledGlobalEventListeners = true;
}, []);
return useEvent(() => mouseMoving);
}
var mouseMoving = false;
var previousScreenX = 0;
var previousScreenY = 0;
function hasMouseMovement(event) {
const movementX = event.movementX || event.screenX - previousScreenX;
const movementY = event.movementY || event.screenY - previousScreenY;
previousScreenX = event.screenX;
previousScreenY = event.screenY;
return movementX || movementY || false;
}
function setMouseMoving(event) {
if (!hasMouseMovement(event)) return;
mouseMoving = true;
}
function resetMouseMoving() {
mouseMoving = false;
}
function forwardRef2(render) {
const Role3 = React.forwardRef((props, ref) => render({
...props,
ref
}));
Role3.displayName = render.displayName || render.name;
return Role3;
}
function memo2(Component7, propsAreEqual) {
return React.memo(Component7, propsAreEqual);
}
function createElement(Type, props) {
const { wrapElement, render, ...rest } = props;
const mergedRef = useMergeRefs(props.ref, getRefProperty(render));
let element;
if (React.isValidElement(render)) {
const renderProps = {
...render.props,
ref: mergedRef
};
element = React.cloneElement(render, mergeProps(rest, renderProps));
} else if (render) element = render(rest);
else element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Type, { ...rest });
if (wrapElement) return wrapElement(element);
return element;
}
function createHook(useProps) {
const useRole3 = (props = {}) => {
return useProps(props);
};
useRole3.displayName = useProps.name;
return useRole3;
}
function createStoreContext(providers = [], scopedProviders = []) {
const context = React.createContext(void 0);
const scopedContext = React.createContext(void 0);
const useContext66 = () => React.useContext(context);
const useScopedContext = (onlyScoped = false) => {
const scoped = React.useContext(scopedContext);
const store = useContext66();
if (onlyScoped) return scoped;
return scoped || store;
};
const useProviderContext = () => {
const scoped = React.useContext(scopedContext);
const store = useContext66();
if (scoped && scoped === store) return;
return store;
};
const ContextProvider = (props) => {
return providers.reduceRight((children, Provider4) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider4, {
...props,
children
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(context.Provider, { ...props }));
};
const ScopedContextProvider = (props) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContextProvider, {
...props,
children: scopedProviders.reduceRight((children, Provider4) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider4, {
...props,
children
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(scopedContext.Provider, { ...props }))
});
};
return {
context,
scopedContext,
useContext: useContext66,
useScopedContext,
useProviderContext,
ContextProvider,
ScopedContextProvider
};
}
// node_modules/@ariakit/react-components/dist/focusable/focusable.js
var import_react3 = __toESM(require_react(), 1);
var TagName = "div";
var accessibleWhenDisabledSymbol = /* @__PURE__ */ Symbol("accessibleWhenDisabled");
var isSafariBrowser = isSafari();
var alwaysFocusVisibleInputTypes = [
"text",
"search",
"url",
"tel",
"email",
"password",
"number",
"date",
"month",
"week",
"time",
"datetime",
"datetime-local"
];
function isAlwaysFocusVisible(element) {
const { tagName, readOnly, type } = element;
if (tagName === "TEXTAREA" && !readOnly) return true;
if (tagName === "SELECT" && !readOnly) return true;
if (tagName === "INPUT" && !readOnly) return alwaysFocusVisibleInputTypes.includes(type);
if (element.isContentEditable) return true;
if (element.getAttribute("role") === "combobox" && element.dataset.name) return true;
return false;
}
function isNativeTabbable(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
}
function supportsDisabledAttribute(tagName) {
if (!tagName) return true;
return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
}
function isNativeSubmitControl(element) {
if (element.tagName === "BUTTON") {
const { type } = element;
return type === "submit";
}
if (element.tagName === "INPUT") {
const { type } = element;
return type === "submit" || type === "image";
}
return false;
}
function getTabIndex({ focusable, trulyDisabled, nativeTabbable, supportsDisabled, safariTabIndex, tabIndexProp }) {
if (!focusable) return tabIndexProp;
if (trulyDisabled) {
if (nativeTabbable && !supportsDisabled) return -1;
return;
}
if (nativeTabbable) {
if (safariTabIndex && tabIndexProp == null) return 0;
return tabIndexProp;
}
return tabIndexProp ?? 0;
}
function useDisableEvent(onEvent, disabled) {
return useEvent((event) => {
onEvent?.(event);
if (event.defaultPrevented) return;
if (disabled) {
event.stopPropagation();
event.preventDefault();
}
});
}
var hasInstalledGlobalEventListeners2 = false;
var isKeyboardModality = true;
function onGlobalMouseDown(event) {
const target = event.target;
if (isElement(target) && !target.hasAttribute("data-focus-visible")) isKeyboardModality = false;
}
function onGlobalKeyDown(event) {
if (event.metaKey) return;
if (event.ctrlKey) return;
if (event.altKey) return;
isKeyboardModality = true;
}
var useFocusable = createHook(function useFocusable2({ focusable = true, accessibleWhenDisabled, autoFocus, onFocusVisible, ...props }) {
const ref = (0, import_react3.useRef)(null);
const [parentAccessibleWhenDisabled, metadataProps] = useMetadataProps(props, accessibleWhenDisabledSymbol, accessibleWhenDisabled);
accessibleWhenDisabled ??= parentAccessibleWhenDisabled;
(0, import_react3.useEffect)(() => {
if (!focusable) return;
if (hasInstalledGlobalEventListeners2) return;
addGlobalEventListener("mousedown", onGlobalMouseDown, true);
addGlobalEventListener("keydown", onGlobalKeyDown, true);
hasInstalledGlobalEventListeners2 = true;
}, [focusable]);
const disabled = focusable && disabledFromProps(props);
const trulyDisabled = disabled && !accessibleWhenDisabled;
const [focusVisible, setFocusVisible] = (0, import_react3.useState)(false);
const focusVisibleRef = (0, import_react3.useRef)(false);
const nativeSubmitObserverCleanupRef = (0, import_react3.useRef)(null);
const cleanupFocusVisible = useEvent((element) => {
nativeSubmitObserverCleanupRef.current?.();
nativeSubmitObserverCleanupRef.current = null;
focusVisibleRef.current = false;
element?.removeAttribute("data-focus-visible");
});
(0, import_react3.useEffect)(() => {
if (!focusable) return;
if (!trulyDisabled) return;
cleanupFocusVisible(ref.current);
if (focusVisible) setFocusVisible(false);
}, [
focusable,
trulyDisabled,
focusVisible,
cleanupFocusVisible
]);
(0, import_react3.useEffect)(() => {
if (!focusable) return;
if (!focusVisible) return;
const element = ref.current;
if (!element) return;
if (typeof IntersectionObserver === "undefined") return;
const observer = new IntersectionObserver(() => {
if (!isFocusable(element)) {
focusVisibleRef.current = false;
setFocusVisible(false);
}
});
observer.observe(element);
return () => observer.disconnect();
}, [focusable, focusVisible]);
(0, import_react3.useEffect)(() => {
return () => nativeSubmitObserverCleanupRef.current?.();
}, []);
const onKeyPressCapture = useDisableEvent(props.onKeyPressCapture, disabled);
const onMouseDownCapture = useDisableEvent(props.onMouseDownCapture, disabled);
const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
const handleFocusVisible = (event, currentTarget) => {
if (currentTarget) event.currentTarget = currentTarget;
if (!focusable) return;
const element = event.currentTarget;
if (!element) return;
if (!hasFocus(element)) return;
onFocusVisible?.(event);
if (event.defaultPrevented) return;
element.dataset.focusVisible = "true";
focusVisibleRef.current = true;
if (isNativeSubmitControl(element)) {
nativeSubmitObserverCleanupRef.current?.();
nativeSubmitObserverCleanupRef.current = null;
if (typeof IntersectionObserver !== "undefined") {
const observer = new IntersectionObserver(() => {
if (isFocusable(element)) return;
cleanupFocusVisible(element);
});
observer.observe(element);
nativeSubmitObserverCleanupRef.current = () => observer.disconnect();
}
return;
}
setFocusVisible(true);
};
const onKeyDownCaptureProp = props.onKeyDownCapture;
const onKeyDownCapture = useEvent((event) => {
onKeyDownCaptureProp?.(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (focusVisible) return;
if (focusVisibleRef.current) return;
if (event.metaKey) return;
if (event.altKey) return;
if (event.ctrlKey) return;
if (!isSelfTarget(event)) return;
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
queueBeforeEvent(element, "focusout", applyFocusVisible);
});
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp?.(event);
if (event.defaultPrevented) return;
if (!focusable) return;
if (!isSelfTarget(event)) {
setFocusVisible(false);
return;
}
const element = event.currentTarget;
const applyFocusVisible = () => handleFocusVisible(event, element);
if (isKeyboardModality || isAlwaysFocusVisible(event.target)) queueBeforeEvent(event.target, "focusout", applyFocusVisible);
else setFocusVisible(false);
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
onBlurProp?.(event);
if (!focusable) return;
if (!isFocusEventOutside(event)) return;
cleanupFocusVisible(event.currentTarget);
setFocusVisible(false);
});
const autoFocusOnShow = (0, import_react3.useContext)(FocusableContext);
const autoFocusRef = useEvent((element) => {
if (!focusable) return;
if (!autoFocus) return;
if (!element) return;
if (!autoFocusOnShow) return;
queueMicrotask(() => {
if (hasFocus(element)) return;
if (!isFocusable(element)) return;
element.focus();
});
});
const tagName = useTagName(ref);
const nativeTabbable = focusable && isNativeTabbable(tagName);
const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
const [safariTabIndex, setSafariTabIndex] = (0, import_react3.useState)(false);
if (isSafariBrowser) (0, import_react3.useEffect)(() => {
if (!focusable) return;
const element = ref.current;
if (!element) return;
const { type } = element;
const isNativeCheckboxOrRadio = element.tagName === "INPUT" && (type === "checkbox" || type === "radio");
setSafariTabIndex(isButton(element) || isNativeCheckboxOrRadio);
}, [focusable]);
const styleProp = props.style;
const style2 = (0, import_react3.useMemo)(() => {
if (trulyDisabled) return {
pointerEvents: "none",
...styleProp
};
return styleProp;
}, [trulyDisabled, styleProp]);
props = {
"data-focus-visible": focusable && focusVisible || void 0,
"data-autofocus": autoFocus || void 0,
"aria-disabled": disabled || void 0,
...props,
...metadataProps,
ref: useMergeRefs(ref, autoFocusRef, props.ref),
style: style2,
tabIndex: getTabIndex({
focusable,
trulyDisabled,
nativeTabbable,
supportsDisabled,
safariTabIndex,
tabIndexProp: props.tabIndex
}),
disabled: supportsDisabled && trulyDisabled ? true : void 0,
contentEditable: disabled ? void 0 : props.contentEditable,
onKeyPressCapture,
onClickCapture,
onMouseDownCapture,
onKeyDownCapture,
onFocusCapture,
onBlur
};
return removeUndefinedValues(props);
});
var Focusable = forwardRef2(function Focusable2(props) {
return createElement(TagName, useFocusable(props));
});
// node_modules/@ariakit/react-components/dist/command/command.js
var import_react4 = __toESM(require_react(), 1);
var TagName2 = "button";
function isNativeClick(event) {
if (!event.isTrusted) return false;
const element = event.currentTarget;
if (event.key === "Enter") return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
if (event.key === " ") return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
return false;
}
var symbol = /* @__PURE__ */ Symbol("command");
var useCommand = createHook(function useCommand2({ clickOnEnter = true, clickOnSpace = true, ...props }) {
const ref = (0, import_react4.useRef)(null);
const [isNativeButton, setIsNativeButton] = (0, import_react4.useState)(false);
(0, import_react4.useEffect)(() => {
if (!ref.current) return;
setIsNativeButton(isButton(ref.current));
}, []);
const [active, setActive] = (0, import_react4.useState)(false);
const activeRef = (0, import_react4.useRef)(false);
const disabled = disabledFromProps(props);
const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true);
useSafeLayoutEffect(() => {
if (!disabled) return;
activeRef.current = false;
setActive(false);
}, [disabled]);
const onKeyDownProp = props.onKeyDown;
const onKeyDown = useEvent((event) => {
onKeyDownProp?.(event);
const element = event.currentTarget;
if (event.defaultPrevented) return;
if (isDuplicate) return;
if (disabled) return;
if (!isSelfTarget(event)) return;
if (isTextField(element)) return;
if (element.isContentEditable) return;
const isEnter = clickOnEnter && event.key === "Enter";
const isSpace = clickOnSpace && event.key === " ";
const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
const shouldPreventSpace = event.key === " " && !clickOnSpace;
if (shouldPreventEnter || shouldPreventSpace) {
event.preventDefault();
return;
}
if (isEnter || isSpace) {
const nativeClick = isNativeClick(event);
if (isEnter) {
if (!nativeClick) {
event.preventDefault();
const { view, ...eventInit } = event;
const click = () => fireClickEvent(element, eventInit);
if (isFirefox()) queueBeforeEvent(element, "keyup", click);
else queueMicrotask(click);
}
} else if (isSpace) {
activeRef.current = true;
if (!nativeClick) {
event.preventDefault();
setActive(true);
}
}
}
});
const onKeyUpProp = props.onKeyUp;
const onKeyUp = useEvent((event) => {
onKeyUpProp?.(event);
if (isDuplicate) return;
const isSpace = clickOnSpace && event.key === " ";
if (!activeRef.current || !isSpace) return;
const nativeClick = isNativeClick(event);
activeRef.current = false;
if (!nativeClick) setActive(false);
if (event.defaultPrevented) return;
if (!isSelfTarget(event)) return;
if (disabled) return;
if (event.metaKey) return;
if (nativeClick) return;
event.preventDefault();
const element = event.currentTarget;
const { view, ...eventInit } = event;
queueMicrotask(() => fireClickEvent(element, eventInit));
});
const onBlurProp = props.onBlur;
const onBlur = useEvent((event) => {
onBlurProp?.(event);
if (!activeRef.current) return;
activeRef.current = false;
setActive(false);
});
props = {
"data-active": active || void 0,
type: isNativeButton ? "button" : void 0,
...metadataProps,
...props,
ref: useMergeRefs(ref, props.ref),
onKeyDown,
onKeyUp,
onBlur
};
props = useFocusable(props);
return props;
});
var Command = forwardRef2(function Command2(props) {
return createElement(TagName2, useCommand(props));
});
// node_modules/@ariakit/react-components/dist/collection/collection-context.js
var ctx = createStoreContext();
var useCollectionContext = ctx.useContext;
var useCollectionScopedContext = ctx.useScopedContext;
var useCollectionProviderContext = ctx.useProviderContext;
var CollectionContextProvider = ctx.ContextProvider;
var CollectionScopedContextProvider = ctx.ScopedContextProvider;
// node_modules/@ariakit/react-components/dist/collection/collection-item.js
var import_react5 = __toESM(require_react(), 1);
var TagName3 = "div";
var useCollectionItem = createHook(function useCollectionItem2({ store, shouldRegisterItem = true, getItem = identity, element, ...props }) {
const context = useCollectionContext();
store = store || context;
const id3 = useId(props.id);
const ref = (0, import_react5.useRef)(element);
(0, import_react5.useEffect)(() => {
const element2 = ref.current;
if (!id3) return;
if (!element2) return;
if (!shouldRegisterItem) return;
const item2 = getItem({
id: id3,
element: element2
});
return store?.renderItem(item2);
}, [
id3,
shouldRegisterItem,
getItem,
store
]);
props = {
...props,
ref: useMergeRefs(ref, props.ref)
};
return removeUndefinedValues(props);
});
var CollectionItem = forwardRef2(function CollectionItem2(props) {
return createElement(TagName3, useCollectionItem(props));
});
// node_modules/@ariakit/react-components/dist/composite/composite-context.js
var import_react6 = __toESM(require_react(), 1);
var ctx2 = createStoreContext([CollectionContextProvider], [CollectionScopedContextProvider]);
var useCompositeContext = ctx2.useContext;
var useCompositeScopedContext = ctx2.useScopedContext;
var useCompositeProviderContext = ctx2.useProviderContext;
var CompositeContextProvider = ctx2.ContextProvider;
var CompositeScopedContextProvider = ctx2.ScopedContextProvider;
var CompositeItemContext = (0, import_react6.createContext)(void 0);
var CompositeRowContext = (0, import_react6.createContext)(void 0);
// node_modules/@ariakit/store/dist/index.js
function getInternal(store, key) {
const internals = store.__unstableInternals;
invariant(internals, "Invalid store");
return internals[key];
}
function hasUpdatedKey(keys, updatedKey) {
if (!keys) return true;
for (const currentKey of keys) if (updatedKey instanceof Set) {
if (updatedKey.has(currentKey)) return true;
} else if (currentKey === updatedKey) return true;
return false;
}
function isSameValue(value, other) {
return value === other || value !== value && other !== other;
}
function getCleanupPrevState(prevState, state, stateBeforeCleanup, updatedKey) {
let cleanupPrevState;
for (const key of getKeys(state)) {
if (isSameValue(state[key], stateBeforeCleanup[key])) continue;
if (updatedKey !== void 0 && hasUpdatedKey([key], updatedKey)) continue;
cleanupPrevState ??= { ...prevState };
cleanupPrevState[key] = state[key];
}
return cleanupPrevState;
}
var MAX_REPAIR_PASSES = 100;
function addKeyedListener(map, keys, listener) {
if (!keys) return;
for (const key of keys) {
let listeners = map.get(key);
if (!listeners) {
listeners = /* @__PURE__ */ new Set();
map.set(key, listeners);
}
listeners.add(listener);
}
}
function deleteKeyedListener(map, keys, listener) {
if (!map) return;
if (!keys) return;
for (const key of keys) {
const listeners = map.get(key);
if (!listeners) continue;
listeners.delete(listener);
if (!listeners.size) map.delete(key);
}
}
function getFastPathNotifiedListeners(frame2) {
const notifiedListeners = /* @__PURE__ */ new Set();
const currentListener = frame2.currentListener;
if (!currentListener) return notifiedListeners;
for (const listener of frame2.keyedListeners) {
notifiedListeners.add(listener);
if (listener === currentListener) return notifiedListeners;
}
notifiedListeners.clear();
notifiedListeners.add(currentListener);
return notifiedListeners;
}
function preserveFastPathNotifiedListeners(frame2) {
frame2.notifiedListeners ??= getFastPathNotifiedListeners(frame2);
}
function hasFastPathPassedListener(frame2, listener) {
if (!frame2.currentListener) return false;
let foundCurrentKeyedListener = false;
for (const currentListener of frame2.keyedListeners) {
if (currentListener === frame2.currentListener) {
foundCurrentKeyedListener = true;
continue;
}
if (!foundCurrentKeyedListener) continue;
if (currentListener === listener) return false;
}
let foundListener = false;
for (const currentListener of frame2.group.listeners) {
if (currentListener === frame2.currentListener) return foundListener;
if (currentListener === listener) foundListener = true;
}
return false;
}
function preserveFastPathFrames(fastPathFrames, group, listener) {
for (const frame2 of fastPathFrames) {
if (frame2.group !== group) continue;
if (frame2.recovering) continue;
if (listener && !frame2.keyedListeners.has(listener)) continue;
preserveFastPathNotifiedListeners(frame2);
for (const currentListener of frame2.group.listeners) {
if (currentListener === frame2.currentListener) break;
if (!hasFastPathPassedListener(frame2, currentListener)) continue;
frame2.notifiedListeners?.add(currentListener);
}
}
}
function preserveFastPathPassedListeners(fastPathFrames, group, listener) {
for (const frame2 of fastPathFrames) {
if (frame2.group !== group) continue;
if (frame2.recovering) continue;
if (!hasFastPathPassedListener(frame2, listener)) continue;
preserveFastPathNotifiedListeners(frame2);
frame2.notifiedListeners?.add(listener);
}
}
function preserveFastPathPassedKeyedListeners({ fastPathFrames, group, keys, listener }) {
const wasRegistered = group.listeners.has(listener);
for (const frame2 of fastPathFrames) {
if (frame2.group !== group) continue;
if (frame2.recovering) continue;
if (!keys.includes(frame2.updatedKey)) continue;
if (hasFastPathPassedListener(frame2, listener)) {
preserveFastPathNotifiedListeners(frame2);
frame2.notifiedListeners?.add(listener);
} else if (wasRegistered) {
preserveFastPathNotifiedListeners(frame2);
frame2.recoverToLive = true;
}
}
}
function clearFastPathNotifiedListener(fastPathFrames, group, listener) {
for (const frame2 of fastPathFrames) {
if (frame2.group !== group) continue;
frame2.notifiedListeners?.delete(listener);
}
}
function addFastPathKeyedListener({ fastPathFrames, group, keys, listener }) {
for (const frame2 of fastPathFrames) {
if (frame2.group !== group) continue;
if (frame2.recovering) continue;
if (!keys.includes(frame2.updatedKey)) continue;
frame2.keyedListeners.add(listener);
}
}
function runPendingCleanup(group, listener) {
if (!group.disposables.size) return;
const cleanup = group.disposables.get(listener);
if (!cleanup) return;
group.disposables.delete(listener);
cleanup();
}
function setListenerCleanup(group, listener, cleanup) {
const currentCleanup = group.disposables.get(listener);
if (!currentCleanup) {
group.disposables.set(listener, cleanup);
return;
}
group.disposables.set(listener, () => {
currentCleanup();
cleanup();
});
}
function notifyStoreListener(group, listener, state, prevState, getState, updatedKey) {
if (group.suspendCounts?.has(listener)) return;
const { disposables } = group;
const cleanup = disposables.size ? disposables.get(listener) : void 0;
if (cleanup) {
disposables.delete(listener);
const stateBeforeCleanup = state;
cleanup();
state = getState?.() ?? state;
if (state !== stateBeforeCleanup) prevState = getCleanupPrevState(prevState, state, stateBeforeCleanup, updatedKey) ?? prevState;
}
const result = listener(state, prevState);
if (result) setListenerCleanup(group, listener, result);
}
function runLiveListeners({ group, getState, prevState, updatedKey, notifiedListeners }) {
const allKeysListeners = group.allKeysListeners;
for (const listener of group.listeners) {
if (notifiedListeners?.has(listener)) continue;
if (!allKeysListeners?.has(listener)) {
if (!hasUpdatedKey(group.listenerKeys.get(listener), updatedKey)) continue;
}
notifiedListeners?.add(listener);
notifyStoreListener(group, listener, getState(), prevState, getState, updatedKey);
}
}
function createStore(initialState2, ...stores) {
let state = initialState2;
let prevStateBatch = state;
let destroy = noop;
let batchPending = false;
let inDispatch = false;
let updatedKeys = /* @__PURE__ */ new Set();
const instances = /* @__PURE__ */ new Set();
const setups = /* @__PURE__ */ new Set();
const syncListenerGroup = {
listeners: /* @__PURE__ */ new Set(),
disposables: /* @__PURE__ */ new Map(),
listenerKeys: /* @__PURE__ */ new WeakMap()
};
const batchListenerGroup = {
listeners: /* @__PURE__ */ new Set(),
disposables: /* @__PURE__ */ new Map(),
listenerKeys: /* @__PURE__ */ new WeakMap()
};
const storeSetup = (callback) => {
setups.add(callback);
return () => setups.delete(callback);
};
const storeInit = () => {
const initializedInstances = instances.size;
const instance = /* @__PURE__ */ Symbol();
instances.add(instance);
const maybeDestroy = () => {
if (!instances.delete(instance)) return;
if (instances.size) return;
destroy();
};
if (initializedInstances) return maybeDestroy;
const stateKeys = getKeys(state);
const desyncs = [];
for (const store of stores) {
const storeState = store?.getState?.();
if (!storeState) continue;
const keys = stateKeys.filter((key) => hasOwnProperty(storeState, key));
if (!keys.length) continue;
if (stores.length === 1 || keys.length === stateKeys.length) {
for (const key of keys) desyncs.push(sync(store, [key], (state2) => {
setState(key, state2[key], true);
}));
continue;
}
desyncs.push(subscribe(store, keys, (state2, prevState) => {
for (const key of keys) {
if (state2[key] === prevState[key]) continue;
setState(key, state2[key], true);
}
}));
for (const key of keys) {
const liveState = store?.getState?.();
if (!liveState) continue;
setState(key, liveState[key], true);
}
}
const teardowns = [];
for (const setup2 of setups) teardowns.push(setup2());
const cleanups2 = stores.map(init);
destroy = chain(...desyncs, ...teardowns, ...cleanups2);
return maybeDestroy;
};
const deleteListenerIndexes = (group, listener, keys) => {
if (keys === void 0) return;
if (keys) deleteKeyedListener(group.listenersByKey, keys, listener);
else group.allKeysListeners?.delete(listener);
};
const fastPathFrames = [];
const registerListener = (keys, listener, group = syncListenerGroup) => {
const listenerKeysValue = keys ? [...keys] : null;
const wasRegistered = group.listeners.has(listener);
if (!wasRegistered) clearFastPathNotifiedListener(fastPathFrames, group, listener);
if (!listenerKeysValue) {
if (wasRegistered) preserveFastPathFrames(fastPathFrames, group);
preserveFastPathPassedListeners(fastPathFrames, group, listener);
} else preserveFastPathPassedKeyedListeners({
fastPathFrames,
group,
keys: listenerKeysValue,
listener
});
if (wasRegistered) {
preserveFastPathFrames(fastPathFrames, group, listener);
deleteListenerIndexes(group, listener, group.listenerKeys.get(listener));
}
group.listeners.add(listener);
if (listenerKeysValue) {
group.listenersByKey ??= /* @__PURE__ */ new Map();
addKeyedListener(group.listenersByKey, listenerKeysValue, listener);
addFastPathKeyedListener({
fastPathFrames,
group,
keys: listenerKeysValue,
listener
});
} else {
group.allKeysListeners ??= /* @__PURE__ */ new Set();
group.allKeysListeners.add(listener);
}
group.listenerKeys.set(listener, listenerKeysValue);
return () => {
const cleanup = group.disposables.get(listener);
group.disposables.delete(listener);
preserveFastPathFrames(fastPathFrames, group, listener);
const currentKeys = group.listenerKeys.get(listener);
deleteListenerIndexes(group, listener, listenerKeysValue);
if (currentKeys !== listenerKeysValue) deleteListenerIndexes(group, listener, currentKeys);
group.listenerKeys.delete(listener);
group.listeners.delete(listener);
cleanup?.();
};
};
const storeSubscribe = (keys, listener) => registerListener(keys, listener);
const runInitialListener = (group, listener, prevState) => {
const shouldSuspend = group.listeners.has(listener);
if (shouldSuspend) {
group.suspendCounts ??= /* @__PURE__ */ new Map();
const count = group.suspendCounts.get(listener) ?? 0;
group.suspendCounts.set(listener, count + 1);
}
let cleanupPrevState;
try {
const stateBeforeCleanups = state;
runPendingCleanup(group, listener);
if (state !== stateBeforeCleanups) cleanupPrevState = getCleanupPrevState(prevState, state, stateBeforeCleanups);
const cleanup = listener(state, cleanupPrevState ?? prevState);
if (cleanup) setListenerCleanup(group, listener, cleanup);
} finally {
if (shouldSuspend) {
const suspendCounts = group.suspendCounts;
const count = suspendCounts?.get(listener);
if (count && count > 1) suspendCounts?.set(listener, count - 1);
else suspendCounts?.delete(listener);
if (!suspendCounts?.size) delete group.suspendCounts;
}
}
};
const storeSync = (keys, listener) => {
runInitialListener(syncListenerGroup, listener, state);
return registerListener(keys, listener);
};
const storeBatch = (keys, listener) => {
if (!batchListenerGroup.listeners.size && !inDispatch) prevStateBatch = state;
runInitialListener(batchListenerGroup, listener, prevStateBatch);
return registerListener(keys, listener, batchListenerGroup);
};
const storePick = (keys) => createStore(pick(state, keys), finalStore);
const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
const getState = () => state;
const runListeners = (group, prevState, updatedKey) => {
if (!(updatedKey instanceof Set) && !group.allKeysListeners?.size) {
const keyedListeners = group.listenersByKey?.get(updatedKey);
if (!keyedListeners) return;
const frame2 = {
group,
keyedListeners,
updatedKey,
currentListener: null
};
fastPathFrames.push(frame2);
try {
for (const listener of keyedListeners) {
if (frame2.notifiedListeners?.has(listener)) continue;
frame2.currentListener = listener;
frame2.notifiedListeners?.add(listener);
notifyStoreListener(group, listener, state, prevState, getState, updatedKey);
if (!group.allKeysListeners?.size && !frame2.recoverToLive) continue;
const notifiedListeners = frame2.notifiedListeners ?? getFastPathNotifiedListeners(frame2);
frame2.notifiedListeners = notifiedListeners;
frame2.recovering = true;
runLiveListeners({
group,
getState,
prevState,
updatedKey,
notifiedListeners
});
return;
}
} finally {
fastPathFrames.pop();
}
return;
}
runLiveListeners({
group,
getState,
prevState,
updatedKey
});
};
const setState = (key, value, fromStores = false) => {
if (!hasOwnProperty(state, key)) return;
const currentValue = state[key];
const nextValue = typeof value === "function" ? value(currentValue) : value;
if (isSameValue(nextValue, currentValue)) return;
const wasInDispatch = inDispatch;
inDispatch = true;
const prevState = state;
const nextState = {
...state,
[key]: nextValue
};
state = nextState;
let superseded = false;
try {
if (!fromStores && stores.length) {
for (const store of stores) {
store?.setState?.(key, nextValue);
if (isSameValue(state[key], nextValue)) continue;
superseded = true;
break;
}
if (superseded) {
let pass = 0;
for (; pass < MAX_REPAIR_PASSES; pass += 1) {
let changed = false;
for (const store of stores) {
const previousValue = state[key];
store?.setState?.(key, previousValue);
if (!isSameValue(state[key], previousValue)) changed = true;
}
if (!changed) break;
}
if (pass === MAX_REPAIR_PASSES) console.warn("Parent stores did not converge after a superseded fan-out; a parent listener may be rewriting this key in a cycle.");
}
}
if (!superseded) runListeners(syncListenerGroup, state === nextState ? prevState : {
...state,
[key]: prevState[key]
}, key);
} finally {
inDispatch = wasInDispatch;
}
if (!batchListenerGroup.listeners.size) {
if (!inDispatch) prevStateBatch = state;
return;
}
updatedKeys.add(key);
if (batchPending) return;
batchPending = true;
queueMicrotask(() => {
batchPending = false;
const snapshot = state;
const updatedKeysSnapshot = updatedKeys;
updatedKeys = /* @__PURE__ */ new Set();
const prevStateBatchBefore = prevStateBatch;
runListeners(batchListenerGroup, prevStateBatchBefore, updatedKeysSnapshot);
if (prevStateBatch === prevStateBatchBefore) prevStateBatch = snapshot;
});
};
const finalStore = {
getState,
setState,
__unstableInternals: {
setup: storeSetup,
init: storeInit,
subscribe: storeSubscribe,
sync: storeSync,
batch: storeBatch,
pick: storePick,
omit: storeOmit
}
};
return finalStore;
}
function setup(store, ...args) {
if (!store) return;
return getInternal(store, "setup")(...args);
}
function init(store, ...args) {
if (!store) return;
return getInternal(store, "init")(...args);
}
function subscribe(store, ...args) {
if (!store) return;
return getInternal(store, "subscribe")(...args);
}
function sync(store, ...args) {
if (!store) return;
return getInternal(store, "sync")(...args);
}
function batch(store, ...args) {
if (!store) return;
return getInternal(store, "batch")(...args);
}
function omit2(store, ...args) {
if (!store) return;
return getInternal(store, "omit")(...args);
}
function pick2(store, ...args) {
if (!store) return;
return getInternal(store, "pick")(...args);
}
function mergeStore(...stores) {
const initialState2 = {};
for (const store2 of stores) {
const nextState = store2?.getState?.();
if (nextState) Object.assign(initialState2, nextState);
}
const store = createStore(initialState2, ...stores);
return Object.assign({}, ...stores, store);
}
function throwOnConflictingProps(props, store) {
if (false) return;
if (!store) return;
const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
const stateKey = key.replace("default", "");
return `${stateKey[0]?.toLowerCase() || ""}${stateKey.slice(1)}`;
});
if (!defaultKeys.length) return;
const storeState = store.getState();
if (!defaultKeys.filter((key) => hasOwnProperty(storeState, key)).length) return;
throw new Error(`Passing a store prop in conjunction with a default state is not supported.
const store = useSelectStore();