1/******/ (() => { // webpackBootstrap
2/******/ var __webpack_modules__ = ({
3
4/***/ 66:
5/***/ ((module) => {
6
7"use strict";
8
9
10var isMergeableObject = function isMergeableObject(value) {
11 return isNonNullObject(value)
12 && !isSpecial(value)
13};
14
15function isNonNullObject(value) {
16 return !!value && typeof value === 'object'
17}
18
19function isSpecial(value) {
20 var stringValue = Object.prototype.toString.call(value);
21
22 return stringValue === '[object RegExp]'
23 || stringValue === '[object Date]'
24 || isReactElement(value)
25}
26
27// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
28var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
29var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
30
31function isReactElement(value) {
32 return value.$$typeof === REACT_ELEMENT_TYPE
33}
34
35function emptyTarget(val) {
36 return Array.isArray(val) ? [] : {}
37}
38
39function cloneUnlessOtherwiseSpecified(value, options) {
40 return (options.clone !== false && options.isMergeableObject(value))
41 ? deepmerge(emptyTarget(value), value, options)
42 : value
43}
44
45function defaultArrayMerge(target, source, options) {
46 return target.concat(source).map(function(element) {
47 return cloneUnlessOtherwiseSpecified(element, options)
48 })
49}
50
51function getMergeFunction(key, options) {
52 if (!options.customMerge) {
53 return deepmerge
54 }
55 var customMerge = options.customMerge(key);
56 return typeof customMerge === 'function' ? customMerge : deepmerge
57}
58
59function getEnumerableOwnPropertySymbols(target) {
60 return Object.getOwnPropertySymbols
61 ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
62 return Object.propertyIsEnumerable.call(target, symbol)
63 })
64 : []
65}
66
67function getKeys(target) {
68 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
69}
70
71function propertyIsOnObject(object, property) {
72 try {
73 return property in object
74 } catch(_) {
75 return false
76 }
77}
78
79// Protects from prototype poisoning and unexpected merging up the prototype chain.
80function propertyIsUnsafe(target, key) {
81 return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
82 && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
83 && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
84}
85
86function mergeObject(target, source, options) {
87 var destination = {};
88 if (options.isMergeableObject(target)) {
89 getKeys(target).forEach(function(key) {
90 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
91 });
92 }
93 getKeys(source).forEach(function(key) {
94 if (propertyIsUnsafe(target, key)) {
95 return
96 }
97
98 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
99 destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
100 } else {
101 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
102 }
103 });
104 return destination
105}
106
107function deepmerge(target, source, options) {
108 options = options || {};
109 options.arrayMerge = options.arrayMerge || defaultArrayMerge;
110 options.isMergeableObject = options.isMergeableObject || isMergeableObject;
111 // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
112 // implementations can use it. The caller may not replace it.
113 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
114
115 var sourceIsArray = Array.isArray(source);
116 var targetIsArray = Array.isArray(target);
117 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
118
119 if (!sourceAndTargetTypesMatch) {
120 return cloneUnlessOtherwiseSpecified(source, options)
121 } else if (sourceIsArray) {
122 return options.arrayMerge(target, source, options)
123 } else {
124 return mergeObject(target, source, options)
125 }
126}
127
128deepmerge.all = function deepmergeAll(array, options) {
129 if (!Array.isArray(array)) {
130 throw new Error('first argument should be an array')
131 }
132
133 return array.reduce(function(prev, next) {
134 return deepmerge(prev, next, options)
135 }, {})
136};
137
138var deepmerge_1 = deepmerge;
139
140module.exports = deepmerge_1;
141
142
143/***/ }),
144
145/***/ 83:
146/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
147
148"use strict";
149/**
150 * @license React
151 * use-sync-external-store-shim.production.js
152 *
153 * Copyright (c) Meta Platforms, Inc. and affiliates.
154 *
155 * This source code is licensed under the MIT license found in the
156 * LICENSE file in the root directory of this source tree.
157 */
158
159
160var React = __webpack_require__(1609);
161function is(x, y) {
162 return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
163}
164var objectIs = "function" === typeof Object.is ? Object.is : is,
165 useState = React.useState,
166 useEffect = React.useEffect,
167 useLayoutEffect = React.useLayoutEffect,
168 useDebugValue = React.useDebugValue;
169function useSyncExternalStore$2(subscribe, getSnapshot) {
170 var value = getSnapshot(),
171 _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
172 inst = _useState[0].inst,
173 forceUpdate = _useState[1];
174 useLayoutEffect(
175 function () {
176 inst.value = value;
177 inst.getSnapshot = getSnapshot;
178 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
179 },
180 [subscribe, value, getSnapshot]
181 );
182 useEffect(
183 function () {
184 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
185 return subscribe(function () {
186 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
187 });
188 },
189 [subscribe]
190 );
191 useDebugValue(value);
192 return value;
193}
194function checkIfSnapshotChanged(inst) {
195 var latestGetSnapshot = inst.getSnapshot;
196 inst = inst.value;
197 try {
198 var nextValue = latestGetSnapshot();
199 return !objectIs(inst, nextValue);
200 } catch (error) {
201 return !0;
202 }
203}
204function useSyncExternalStore$1(subscribe, getSnapshot) {
205 return getSnapshot();
206}
207var shim =
208 "undefined" === typeof window ||
209 "undefined" === typeof window.document ||
210 "undefined" === typeof window.document.createElement
211 ? useSyncExternalStore$1
212 : useSyncExternalStore$2;
213exports.useSyncExternalStore =
214 void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
215
216
217/***/ }),
218
219/***/ 422:
220/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
221
222"use strict";
223
224
225if (true) {
226 module.exports = __webpack_require__(83);
227} else {}
228
229
230/***/ }),
231
232/***/ 1178:
233/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
234
235"use strict";
236
237
238if (true) {
239 module.exports = __webpack_require__(2950);
240} else {}
241
242
243/***/ }),
244
245/***/ 1609:
246/***/ ((module) => {
247
248"use strict";
249module.exports = window["React"];
250
251/***/ }),
252
253/***/ 1880:
254/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
255
256"use strict";
257
258
259var reactIs = __webpack_require__(1178);
260
261/**
262 * Copyright 2015, Yahoo! Inc.
263 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
264 */
265var REACT_STATICS = {
266 childContextTypes: true,
267 contextType: true,
268 contextTypes: true,
269 defaultProps: true,
270 displayName: true,
271 getDefaultProps: true,
272 getDerivedStateFromError: true,
273 getDerivedStateFromProps: true,
274 mixins: true,
275 propTypes: true,
276 type: true
277};
278var KNOWN_STATICS = {
279 name: true,
280 length: true,
281 prototype: true,
282 caller: true,
283 callee: true,
284 arguments: true,
285 arity: true
286};
287var FORWARD_REF_STATICS = {
288 '$$typeof': true,
289 render: true,
290 defaultProps: true,
291 displayName: true,
292 propTypes: true
293};
294var MEMO_STATICS = {
295 '$$typeof': true,
296 compare: true,
297 defaultProps: true,
298 displayName: true,
299 propTypes: true,
300 type: true
301};
302var TYPE_STATICS = {};
303TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
304TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
305
306function getStatics(component) {
307 // React v16.11 and below
308 if (reactIs.isMemo(component)) {
309 return MEMO_STATICS;
310 } // React v16.12 and above
311
312
313 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
314}
315
316var defineProperty = Object.defineProperty;
317var getOwnPropertyNames = Object.getOwnPropertyNames;
318var getOwnPropertySymbols = Object.getOwnPropertySymbols;
319var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
320var getPrototypeOf = Object.getPrototypeOf;
321var objectPrototype = Object.prototype;
322function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
323 if (typeof sourceComponent !== 'string') {
324 // don't hoist over string (html) components
325 if (objectPrototype) {
326 var inheritedComponent = getPrototypeOf(sourceComponent);
327
328 if (inheritedComponent && inheritedComponent !== objectPrototype) {
329 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
330 }
331 }
332
333 var keys = getOwnPropertyNames(sourceComponent);
334
335 if (getOwnPropertySymbols) {
336 keys = keys.concat(getOwnPropertySymbols(sourceComponent));
337 }
338
339 var targetStatics = getStatics(targetComponent);
340 var sourceStatics = getStatics(sourceComponent);
341
342 for (var i = 0; i < keys.length; ++i) {
343 var key = keys[i];
344
345 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
346 var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
347
348 try {
349 // Avoid failures from read-only properties
350 defineProperty(targetComponent, key, descriptor);
351 } catch (e) {}
352 }
353 }
354 }
355
356 return targetComponent;
357}
358
359module.exports = hoistNonReactStatics;
360
361
362/***/ }),
363
364/***/ 2950:
365/***/ ((__unused_webpack_module, exports) => {
366
367"use strict";
368/** @license React v16.13.1
369 * react-is.production.min.js
370 *
371 * Copyright (c) Facebook, Inc. and its affiliates.
372 *
373 * This source code is licensed under the MIT license found in the
374 * LICENSE file in the root directory of this source tree.
375 */
376
377var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
378Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
379function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
380exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
381exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
382exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
383
384
385/***/ }),
386
387/***/ 7734:
388/***/ ((module) => {
389
390"use strict";
391
392
393// do not edit .js files directly - edit src/index.jst
394
395
396 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
397
398
399module.exports = function equal(a, b) {
400 if (a === b) return true;
401
402 if (a && b && typeof a == 'object' && typeof b == 'object') {
403 if (a.constructor !== b.constructor) return false;
404
405 var length, i, keys;
406 if (Array.isArray(a)) {
407 length = a.length;
408 if (length != b.length) return false;
409 for (i = length; i-- !== 0;)
410 if (!equal(a[i], b[i])) return false;
411 return true;
412 }
413
414
415 if ((a instanceof Map) && (b instanceof Map)) {
416 if (a.size !== b.size) return false;
417 for (i of a.entries())
418 if (!b.has(i[0])) return false;
419 for (i of a.entries())
420 if (!equal(i[1], b.get(i[0]))) return false;
421 return true;
422 }
423
424 if ((a instanceof Set) && (b instanceof Set)) {
425 if (a.size !== b.size) return false;
426 for (i of a.entries())
427 if (!b.has(i[0])) return false;
428 return true;
429 }
430
431 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
432 length = a.length;
433 if (length != b.length) return false;
434 for (i = length; i-- !== 0;)
435 if (a[i] !== b[i]) return false;
436 return true;
437 }
438
439
440 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
441 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
442 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
443
444 keys = Object.keys(a);
445 length = keys.length;
446 if (length !== Object.keys(b).length) return false;
447
448 for (i = length; i-- !== 0;)
449 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
450
451 for (i = length; i-- !== 0;) {
452 var key = keys[i];
453
454 if (!equal(a[key], b[key])) return false;
455 }
456
457 return true;
458 }
459
460 // true if both NaN, false otherwise
461 return a!==a && b!==b;
462};
463
464
465/***/ }),
466
467/***/ 8924:
468/***/ ((__unused_webpack_module, exports) => {
469
470// Copyright (c) 2014 Rafael Caricio. All rights reserved.
471// Use of this source code is governed by a BSD-style license that can be
472// found in the LICENSE file.
473
474var GradientParser = (GradientParser || {});
475
476GradientParser.stringify = (function() {
477
478 var visitor = {
479
480 'visit_linear-gradient': function(node) {
481 return visitor.visit_gradient(node);
482 },
483
484 'visit_repeating-linear-gradient': function(node) {
485 return visitor.visit_gradient(node);
486 },
487
488 'visit_radial-gradient': function(node) {
489 return visitor.visit_gradient(node);
490 },
491
492 'visit_repeating-radial-gradient': function(node) {
493 return visitor.visit_gradient(node);
494 },
495
496 'visit_gradient': function(node) {
497 var orientation = visitor.visit(node.orientation);
498 if (orientation) {
499 orientation += ', ';
500 }
501
502 return node.type + '(' + orientation + visitor.visit(node.colorStops) + ')';
503 },
504
505 'visit_shape': function(node) {
506 var result = node.value,
507 at = visitor.visit(node.at),
508 style = visitor.visit(node.style);
509
510 if (style) {
511 result += ' ' + style;
512 }
513
514 if (at) {
515 result += ' at ' + at;
516 }
517
518 return result;
519 },
520
521 'visit_default-radial': function(node) {
522 var result = '',
523 at = visitor.visit(node.at);
524
525 if (at) {
526 result += at;
527 }
528 return result;
529 },
530
531 'visit_extent-keyword': function(node) {
532 var result = node.value,
533 at = visitor.visit(node.at);
534
535 if (at) {
536 result += ' at ' + at;
537 }
538
539 return result;
540 },
541
542 'visit_position-keyword': function(node) {
543 return node.value;
544 },
545
546 'visit_position': function(node) {
547 return visitor.visit(node.value.x) + ' ' + visitor.visit(node.value.y);
548 },
549
550 'visit_%': function(node) {
551 return node.value + '%';
552 },
553
554 'visit_em': function(node) {
555 return node.value + 'em';
556 },
557
558 'visit_px': function(node) {
559 return node.value + 'px';
560 },
561
562 'visit_calc': function(node) {
563 return 'calc(' + node.value + ')';
564 },
565
566 'visit_literal': function(node) {
567 return visitor.visit_color(node.value, node);
568 },
569
570 'visit_hex': function(node) {
571 return visitor.visit_color('#' + node.value, node);
572 },
573
574 'visit_rgb': function(node) {
575 return visitor.visit_color('rgb(' + node.value.join(', ') + ')', node);
576 },
577
578 'visit_rgba': function(node) {
579 return visitor.visit_color('rgba(' + node.value.join(', ') + ')', node);
580 },
581
582 'visit_hsl': function(node) {
583 return visitor.visit_color('hsl(' + node.value[0] + ', ' + node.value[1] + '%, ' + node.value[2] + '%)', node);
584 },
585
586 'visit_hsla': function(node) {
587 return visitor.visit_color('hsla(' + node.value[0] + ', ' + node.value[1] + '%, ' + node.value[2] + '%, ' + node.value[3] + ')', node);
588 },
589
590 'visit_var': function(node) {
591 return visitor.visit_color('var(' + node.value + ')', node);
592 },
593
594 'visit_color': function(resultColor, node) {
595 var result = resultColor,
596 length = visitor.visit(node.length);
597
598 if (length) {
599 result += ' ' + length;
600 }
601 return result;
602 },
603
604 'visit_angular': function(node) {
605 return node.value + 'deg';
606 },
607
608 'visit_directional': function(node) {
609 return 'to ' + node.value;
610 },
611
612 'visit_array': function(elements) {
613 var result = '',
614 size = elements.length;
615
616 elements.forEach(function(element, i) {
617 result += visitor.visit(element);
618 if (i < size - 1) {
619 result += ', ';
620 }
621 });
622
623 return result;
624 },
625
626 'visit_object': function(obj) {
627 if (obj.width && obj.height) {
628 return visitor.visit(obj.width) + ' ' + visitor.visit(obj.height);
629 }
630 return '';
631 },
632
633 'visit': function(element) {
634 if (!element) {
635 return '';
636 }
637 var result = '';
638
639 if (element instanceof Array) {
640 return visitor.visit_array(element);
641 } else if (typeof element === 'object' && !element.type) {
642 return visitor.visit_object(element);
643 } else if (element.type) {
644 var nodeVisitor = visitor['visit_' + element.type];
645 if (nodeVisitor) {
646 return nodeVisitor(element);
647 } else {
648 throw Error('Missing visitor visit_' + element.type);
649 }
650 } else {
651 throw Error('Invalid node.');
652 }
653 }
654
655 };
656
657 return function(root) {
658 return visitor.visit(root);
659 };
660})();
661
662// Copyright (c) 2014 Rafael Caricio. All rights reserved.
663// Use of this source code is governed by a BSD-style license that can be
664// found in the LICENSE file.
665
666var GradientParser = (GradientParser || {});
667
668GradientParser.parse = (function() {
669
670 var tokens = {
671 linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
672 repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
673 radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
674 repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
675 sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,
676 extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
677 positionKeywords: /^(left|center|right|top|bottom)/i,
678 pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
679 percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
680 emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
681 angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
682 radianValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,
683 startCall: /^\(/,
684 endCall: /^\)/,
685 comma: /^,/,
686 hexColor: /^\#([0-9a-fA-F]+)/,
687 literalColor: /^([a-zA-Z]+)/,
688 rgbColor: /^rgb/i,
689 rgbaColor: /^rgba/i,
690 varColor: /^var/i,
691 calcValue: /^calc/i,
692 variableName: /^(--[a-zA-Z0-9-,\s\#]+)/,
693 number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,
694 hslColor: /^hsl/i,
695 hslaColor: /^hsla/i,
696 };
697
698 var input = '';
699
700 function error(msg) {
701 var err = new Error(input + ': ' + msg);
702 err.source = input;
703 throw err;
704 }
705
706 function getAST() {
707 var ast = matchListDefinitions();
708
709 if (input.length > 0) {
710 error('Invalid input not EOF');
711 }
712
713 return ast;
714 }
715
716 function matchListDefinitions() {
717 return matchListing(matchDefinition);
718 }
719
720 function matchDefinition() {
721 return matchGradient(
722 'linear-gradient',
723 tokens.linearGradient,
724 matchLinearOrientation) ||
725
726 matchGradient(
727 'repeating-linear-gradient',
728 tokens.repeatingLinearGradient,
729 matchLinearOrientation) ||
730
731 matchGradient(
732 'radial-gradient',
733 tokens.radialGradient,
734 matchListRadialOrientations) ||
735
736 matchGradient(
737 'repeating-radial-gradient',
738 tokens.repeatingRadialGradient,
739 matchListRadialOrientations);
740 }
741
742 function matchGradient(gradientType, pattern, orientationMatcher) {
743 return matchCall(pattern, function(captures) {
744
745 var orientation = orientationMatcher();
746 if (orientation) {
747 if (!scan(tokens.comma)) {
748 error('Missing comma before color stops');
749 }
750 }
751
752 return {
753 type: gradientType,
754 orientation: orientation,
755 colorStops: matchListing(matchColorStop)
756 };
757 });
758 }
759
760 function matchCall(pattern, callback) {
761 var captures = scan(pattern);
762
763 if (captures) {
764 if (!scan(tokens.startCall)) {
765 error('Missing (');
766 }
767
768 var result = callback(captures);
769
770 if (!scan(tokens.endCall)) {
771 error('Missing )');
772 }
773
774 return result;
775 }
776 }
777
778 function matchLinearOrientation() {
779 // Check for standard CSS3 "to" direction
780 var sideOrCorner = matchSideOrCorner();
781 if (sideOrCorner) {
782 return sideOrCorner;
783 }
784
785 // Check for legacy single keyword direction (e.g., "right", "top")
786 var legacyDirection = match('position-keyword', tokens.positionKeywords, 1);
787 if (legacyDirection) {
788 // For legacy syntax, we convert to the directional type
789 return {
790 type: 'directional',
791 value: legacyDirection.value
792 };
793 }
794
795 // If neither, check for angle
796 return matchAngle();
797 }
798
799 function matchSideOrCorner() {
800 return match('directional', tokens.sideOrCorner, 1);
801 }
802
803 function matchAngle() {
804 return match('angular', tokens.angleValue, 1) ||
805 match('angular', tokens.radianValue, 1);
806 }
807
808 function matchListRadialOrientations() {
809 var radialOrientations,
810 radialOrientation = matchRadialOrientation(),
811 lookaheadCache;
812
813 if (radialOrientation) {
814 radialOrientations = [];
815 radialOrientations.push(radialOrientation);
816
817 lookaheadCache = input;
818 if (scan(tokens.comma)) {
819 radialOrientation = matchRadialOrientation();
820 if (radialOrientation) {
821 radialOrientations.push(radialOrientation);
822 } else {
823 input = lookaheadCache;
824 }
825 }
826 }
827
828 return radialOrientations;
829 }
830
831 function matchRadialOrientation() {
832 var radialType = matchCircle() ||
833 matchEllipse();
834
835 if (radialType) {
836 radialType.at = matchAtPosition();
837 } else {
838 var extent = matchExtentKeyword();
839 if (extent) {
840 radialType = extent;
841 var positionAt = matchAtPosition();
842 if (positionAt) {
843 radialType.at = positionAt;
844 }
845 } else {
846 // Check for "at" position first, which is a common browser output format
847 var atPosition = matchAtPosition();
848 if (atPosition) {
849 radialType = {
850 type: 'default-radial',
851 at: atPosition
852 };
853 } else {
854 var defaultPosition = matchPositioning();
855 if (defaultPosition) {
856 radialType = {
857 type: 'default-radial',
858 at: defaultPosition
859 };
860 }
861 }
862 }
863 }
864
865 return radialType;
866 }
867
868 function matchCircle() {
869 var circle = match('shape', /^(circle)/i, 0);
870
871 if (circle) {
872 circle.style = matchLength() || matchExtentKeyword();
873 }
874
875 return circle;
876 }
877
878 function matchEllipse() {
879 var ellipse = match('shape', /^(ellipse)/i, 0);
880
881 if (ellipse) {
882 ellipse.style = matchPositioning() || matchDistance() || matchExtentKeyword();
883 }
884
885 return ellipse;
886 }
887
888 function matchExtentKeyword() {
889 return match('extent-keyword', tokens.extentKeywords, 1);
890 }
891
892 function matchAtPosition() {
893 if (match('position', /^at/, 0)) {
894 var positioning = matchPositioning();
895
896 if (!positioning) {
897 error('Missing positioning value');
898 }
899
900 return positioning;
901 }
902 }
903
904 function matchPositioning() {
905 var location = matchCoordinates();
906
907 if (location.x || location.y) {
908 return {
909 type: 'position',
910 value: location
911 };
912 }
913 }
914
915 function matchCoordinates() {
916 return {
917 x: matchDistance(),
918 y: matchDistance()
919 };
920 }
921
922 function matchListing(matcher) {
923 var captures = matcher(),
924 result = [];
925
926 if (captures) {
927 result.push(captures);
928 while (scan(tokens.comma)) {
929 captures = matcher();
930 if (captures) {
931 result.push(captures);
932 } else {
933 error('One extra comma');
934 }
935 }
936 }
937
938 return result;
939 }
940
941 function matchColorStop() {
942 var color = matchColor();
943
944 if (!color) {
945 error('Expected color definition');
946 }
947
948 color.length = matchDistance();
949 return color;
950 }
951
952 function matchColor() {
953 return matchHexColor() ||
954 matchHSLAColor() ||
955 matchHSLColor() ||
956 matchRGBAColor() ||
957 matchRGBColor() ||
958 matchVarColor() ||
959 matchLiteralColor();
960 }
961
962 function matchLiteralColor() {
963 return match('literal', tokens.literalColor, 0);
964 }
965
966 function matchHexColor() {
967 return match('hex', tokens.hexColor, 1);
968 }
969
970 function matchRGBColor() {
971 return matchCall(tokens.rgbColor, function() {
972 return {
973 type: 'rgb',
974 value: matchListing(matchNumber)
975 };
976 });
977 }
978
979 function matchRGBAColor() {
980 return matchCall(tokens.rgbaColor, function() {
981 return {
982 type: 'rgba',
983 value: matchListing(matchNumber)
984 };
985 });
986 }
987
988 function matchVarColor() {
989 return matchCall(tokens.varColor, function () {
990 return {
991 type: 'var',
992 value: matchVariableName()
993 };
994 });
995 }
996
997 function matchHSLColor() {
998 return matchCall(tokens.hslColor, function() {
999 // Check for percentage before trying to parse the hue
1000 var lookahead = scan(tokens.percentageValue);
1001 if (lookahead) {
1002 error('HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage');
1003 }
1004
1005 var hue = matchNumber();
1006 scan(tokens.comma);
1007 var captures = scan(tokens.percentageValue);
1008 var sat = captures ? captures[1] : null;
1009 scan(tokens.comma);
1010 captures = scan(tokens.percentageValue);
1011 var light = captures ? captures[1] : null;
1012 if (!sat || !light) {
1013 error('Expected percentage value for saturation and lightness in HSL');
1014 }
1015 return {
1016 type: 'hsl',
1017 value: [hue, sat, light]
1018 };
1019 });
1020 }
1021
1022 function matchHSLAColor() {
1023 return matchCall(tokens.hslaColor, function() {
1024 var hue = matchNumber();
1025 scan(tokens.comma);
1026 var captures = scan(tokens.percentageValue);
1027 var sat = captures ? captures[1] : null;
1028 scan(tokens.comma);
1029 captures = scan(tokens.percentageValue);
1030 var light = captures ? captures[1] : null;
1031 scan(tokens.comma);
1032 var alpha = matchNumber();
1033 if (!sat || !light) {
1034 error('Expected percentage value for saturation and lightness in HSLA');
1035 }
1036 return {
1037 type: 'hsla',
1038 value: [hue, sat, light, alpha]
1039 };
1040 });
1041 }
1042
1043 function matchPercentage() {
1044 var captures = scan(tokens.percentageValue);
1045 return captures ? captures[1] : null;
1046 }
1047
1048 function matchVariableName() {
1049 return scan(tokens.variableName)[1];
1050 }
1051
1052 function matchNumber() {
1053 return scan(tokens.number)[1];
1054 }
1055
1056 function matchDistance() {
1057 return match('%', tokens.percentageValue, 1) ||
1058 matchPositionKeyword() ||
1059 matchCalc() ||
1060 matchLength();
1061 }
1062
1063 function matchPositionKeyword() {
1064 return match('position-keyword', tokens.positionKeywords, 1);
1065 }
1066
1067 function matchCalc() {
1068 return matchCall(tokens.calcValue, function() {
1069 var openParenCount = 1; // Start with the opening parenthesis from calc(
1070 var i = 0;
1071
1072 // Parse through the content looking for balanced parentheses
1073 while (openParenCount > 0 && i < input.length) {
1074 var char = input.charAt(i);
1075 if (char === '(') {
1076 openParenCount++;
1077 } else if (char === ')') {
1078 openParenCount--;
1079 }
1080 i++;
1081 }
1082
1083 // If we exited because we ran out of input but still have open parentheses, error
1084 if (openParenCount > 0) {
1085 error('Missing closing parenthesis in calc() expression');
1086 }
1087
1088 // Get the content inside the calc() without the last closing paren
1089 var calcContent = input.substring(0, i - 1);
1090
1091 // Consume the calc expression content
1092 consume(i - 1); // -1 because we don't want to consume the closing parenthesis
1093
1094 return {
1095 type: 'calc',
1096 value: calcContent
1097 };
1098 });
1099 }
1100
1101 function matchLength() {
1102 return match('px', tokens.pixelValue, 1) ||
1103 match('em', tokens.emValue, 1);
1104 }
1105
1106 function match(type, pattern, captureIndex) {
1107 var captures = scan(pattern);
1108 if (captures) {
1109 return {
1110 type: type,
1111 value: captures[captureIndex]
1112 };
1113 }
1114 }
1115
1116 function scan(regexp) {
1117 var captures,
1118 blankCaptures;
1119
1120 blankCaptures = /^[\n\r\t\s]+/.exec(input);
1121 if (blankCaptures) {
1122 consume(blankCaptures[0].length);
1123 }
1124
1125 captures = regexp.exec(input);
1126 if (captures) {
1127 consume(captures[0].length);
1128 }
1129
1130 return captures;
1131 }
1132
1133 function consume(size) {
1134 input = input.substr(size);
1135 }
1136
1137 return function(code) {
1138 input = code.toString().trim();
1139 // Remove trailing semicolon if present
1140 if (input.endsWith(';')) {
1141 input = input.slice(0, -1);
1142 }
1143 return getAST();
1144 };
1145})();
1146
1147exports.parse = GradientParser.parse;
1148exports.stringify = GradientParser.stringify;
1149
1150
1151/***/ }),
1152
1153/***/ 9664:
1154/***/ ((module) => {
1155
1156module.exports =
1157/******/ (function(modules) { // webpackBootstrap
1158/******/ // The module cache
1159/******/ var installedModules = {};
1160/******/
1161/******/ // The require function
1162/******/ function __nested_webpack_require_187__(moduleId) {
1163/******/
1164/******/ // Check if module is in cache
1165/******/ if(installedModules[moduleId])
1166/******/ return installedModules[moduleId].exports;
1167/******/
1168/******/ // Create a new module (and put it into the cache)
1169/******/ var module = installedModules[moduleId] = {
1170/******/ exports: {},
1171/******/ id: moduleId,
1172/******/ loaded: false
1173/******/ };
1174/******/
1175/******/ // Execute the module function
1176/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__);
1177/******/
1178/******/ // Flag the module as loaded
1179/******/ module.loaded = true;
1180/******/
1181/******/ // Return the exports of the module
1182/******/ return module.exports;
1183/******/ }
1184/******/
1185/******/
1186/******/ // expose the modules object (__webpack_modules__)
1187/******/ __nested_webpack_require_187__.m = modules;
1188/******/
1189/******/ // expose the module cache
1190/******/ __nested_webpack_require_187__.c = installedModules;
1191/******/
1192/******/ // __webpack_public_path__
1193/******/ __nested_webpack_require_187__.p = "";
1194/******/
1195/******/ // Load entry module and return exports
1196/******/ return __nested_webpack_require_187__(0);
1197/******/ })
1198/************************************************************************/
1199/******/ ([
1200/* 0 */
1201/***/ (function(module, exports, __nested_webpack_require_1468__) {
1202
1203 module.exports = __nested_webpack_require_1468__(1);
1204
1205
1206/***/ }),
1207/* 1 */
1208/***/ (function(module, exports, __nested_webpack_require_1587__) {
1209
1210 'use strict';
1211
1212 Object.defineProperty(exports, "__esModule", {
1213 value: true
1214 });
1215
1216 var _utils = __nested_webpack_require_1587__(2);
1217
1218 Object.defineProperty(exports, 'combineChunks', {
1219 enumerable: true,
1220 get: function get() {
1221 return _utils.combineChunks;
1222 }
1223 });
1224 Object.defineProperty(exports, 'fillInChunks', {
1225 enumerable: true,
1226 get: function get() {
1227 return _utils.fillInChunks;
1228 }
1229 });
1230 Object.defineProperty(exports, 'findAll', {
1231 enumerable: true,
1232 get: function get() {
1233 return _utils.findAll;
1234 }
1235 });
1236 Object.defineProperty(exports, 'findChunks', {
1237 enumerable: true,
1238 get: function get() {
1239 return _utils.findChunks;
1240 }
1241 });
1242
1243/***/ }),
1244/* 2 */
1245/***/ (function(module, exports) {
1246
1247 'use strict';
1248
1249 Object.defineProperty(exports, "__esModule", {
1250 value: true
1251 });
1252
1253
1254 /**
1255 * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
1256 * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
1257 */
1258 var findAll = exports.findAll = function findAll(_ref) {
1259 var autoEscape = _ref.autoEscape,
1260 _ref$caseSensitive = _ref.caseSensitive,
1261 caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
1262 _ref$findChunks = _ref.findChunks,
1263 findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
1264 sanitize = _ref.sanitize,
1265 searchWords = _ref.searchWords,
1266 textToHighlight = _ref.textToHighlight;
1267 return fillInChunks({
1268 chunksToHighlight: combineChunks({
1269 chunks: findChunks({
1270 autoEscape: autoEscape,
1271 caseSensitive: caseSensitive,
1272 sanitize: sanitize,
1273 searchWords: searchWords,
1274 textToHighlight: textToHighlight
1275 })
1276 }),
1277 totalLength: textToHighlight ? textToHighlight.length : 0
1278 });
1279 };
1280
1281 /**
1282 * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
1283 * @return {start:number, end:number}[]
1284 */
1285
1286
1287 var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
1288 var chunks = _ref2.chunks;
1289
1290 chunks = chunks.sort(function (first, second) {
1291 return first.start - second.start;
1292 }).reduce(function (processedChunks, nextChunk) {
1293 // First chunk just goes straight in the array...
1294 if (processedChunks.length === 0) {
1295 return [nextChunk];
1296 } else {
1297 // ... subsequent chunks get checked to see if they overlap...
1298 var prevChunk = processedChunks.pop();
1299 if (nextChunk.start <= prevChunk.end) {
1300 // It may be the case that prevChunk completely surrounds nextChunk, so take the
1301 // largest of the end indeces.
1302 var endIndex = Math.max(prevChunk.end, nextChunk.end);
1303 processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
1304 } else {
1305 processedChunks.push(prevChunk, nextChunk);
1306 }
1307 return processedChunks;
1308 }
1309 }, []);
1310
1311 return chunks;
1312 };
1313
1314 /**
1315 * Examine text for any matches.
1316 * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
1317 * @return {start:number, end:number}[]
1318 */
1319 var defaultFindChunks = function defaultFindChunks(_ref3) {
1320 var autoEscape = _ref3.autoEscape,
1321 caseSensitive = _ref3.caseSensitive,
1322 _ref3$sanitize = _ref3.sanitize,
1323 sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize,
1324 searchWords = _ref3.searchWords,
1325 textToHighlight = _ref3.textToHighlight;
1326
1327 textToHighlight = sanitize(textToHighlight);
1328
1329 return searchWords.filter(function (searchWord) {
1330 return searchWord;
1331 }) // Remove empty words
1332 .reduce(function (chunks, searchWord) {
1333 searchWord = sanitize(searchWord);
1334
1335 if (autoEscape) {
1336 searchWord = escapeRegExpFn(searchWord);
1337 }
1338
1339 var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
1340
1341 var match = void 0;
1342 while (match = regex.exec(textToHighlight)) {
1343 var _start = match.index;
1344 var _end = regex.lastIndex;
1345 // We do not return zero-length matches
1346 if (_end > _start) {
1347 chunks.push({ highlight: false, start: _start, end: _end });
1348 }
1349
1350 // Prevent browsers like Firefox from getting stuck in an infinite loop
1351 // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
1352 if (match.index === regex.lastIndex) {
1353 regex.lastIndex++;
1354 }
1355 }
1356
1357 return chunks;
1358 }, []);
1359 };
1360 // Allow the findChunks to be overridden in findAll,
1361 // but for backwards compatibility we export as the old name
1362 exports.findChunks = defaultFindChunks;
1363
1364 /**
1365 * Given a set of chunks to highlight, create an additional set of chunks
1366 * to represent the bits of text between the highlighted text.
1367 * @param chunksToHighlight {start:number, end:number}[]
1368 * @param totalLength number
1369 * @return {start:number, end:number, highlight:boolean}[]
1370 */
1371
1372 var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
1373 var chunksToHighlight = _ref4.chunksToHighlight,
1374 totalLength = _ref4.totalLength;
1375
1376 var allChunks = [];
1377 var append = function append(start, end, highlight) {
1378 if (end - start > 0) {
1379 allChunks.push({
1380 start: start,
1381 end: end,
1382 highlight: highlight
1383 });
1384 }
1385 };
1386
1387 if (chunksToHighlight.length === 0) {
1388 append(0, totalLength, false);
1389 } else {
1390 var lastIndex = 0;
1391 chunksToHighlight.forEach(function (chunk) {
1392 append(lastIndex, chunk.start, false);
1393 append(chunk.start, chunk.end, true);
1394 lastIndex = chunk.end;
1395 });
1396 append(lastIndex, totalLength, false);
1397 }
1398 return allChunks;
1399 };
1400
1401 function defaultSanitize(string) {
1402 return string;
1403 }
1404
1405 function escapeRegExpFn(string) {
1406 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
1407 }
1408
1409/***/ })
1410/******/ ]);
1411
1412
1413/***/ }),
1414
1415/***/ 9681:
1416/***/ ((module) => {
1417
1418var characterMap = {
1419 "À": "A",
1420 "Á": "A",
1421 "Â": "A",
1422 "Ã": "A",
1423 "Ä": "A",
1424 "Å": "A",
1425 "Ấ": "A",
1426 "Ắ": "A",
1427 "Ẳ": "A",
1428 "Ẵ": "A",
1429 "Ặ": "A",
1430 "Æ": "AE",
1431 "Ầ": "A",
1432 "Ằ": "A",
1433 "Ȃ": "A",
1434 "Ả": "A",
1435 "Ạ": "A",
1436 "Ẩ": "A",
1437 "Ẫ": "A",
1438 "Ậ": "A",
1439 "Ç": "C",
1440 "Ḉ": "C",
1441 "È": "E",
1442 "É": "E",
1443 "Ê": "E",
1444 "Ë": "E",
1445 "Ế": "E",
1446 "Ḗ": "E",
1447 "Ề": "E",
1448 "Ḕ": "E",
1449 "Ḝ": "E",
1450 "Ȇ": "E",
1451 "Ẻ": "E",
1452 "Ẽ": "E",
1453 "Ẹ": "E",
1454 "Ể": "E",
1455 "Ễ": "E",
1456 "Ệ": "E",
1457 "Ì": "I",
1458 "Í": "I",
1459 "Î": "I",
1460 "Ï": "I",
1461 "Ḯ": "I",
1462 "Ȋ": "I",
1463 "Ỉ": "I",
1464 "Ị": "I",
1465 "Ð": "D",
1466 "Ñ": "N",
1467 "Ò": "O",
1468 "Ó": "O",
1469 "Ô": "O",
1470 "Õ": "O",
1471 "Ö": "O",
1472 "Ø": "O",
1473 "Ố": "O",
1474 "Ṍ": "O",
1475 "Ṓ": "O",
1476 "Ȏ": "O",
1477 "Ỏ": "O",
1478 "Ọ": "O",
1479 "Ổ": "O",
1480 "Ỗ": "O",
1481 "Ộ": "O",
1482 "Ờ": "O",
1483 "Ở": "O",
1484 "Ỡ": "O",
1485 "Ớ": "O",
1486 "Ợ": "O",
1487 "Ù": "U",
1488 "Ú": "U",
1489 "Û": "U",
1490 "Ü": "U",
1491 "Ủ": "U",
1492 "Ụ": "U",
1493 "Ử": "U",
1494 "Ữ": "U",
1495 "Ự": "U",
1496 "Ý": "Y",
1497 "à": "a",
1498 "á": "a",
1499 "â": "a",
1500 "ã": "a",
1501 "ä": "a",
1502 "å": "a",
1503 "ấ": "a",
1504 "ắ": "a",
1505 "ẳ": "a",
1506 "ẵ": "a",
1507 "ặ": "a",
1508 "æ": "ae",
1509 "ầ": "a",
1510 "ằ": "a",
1511 "ȃ": "a",
1512 "ả": "a",
1513 "ạ": "a",
1514 "ẩ": "a",
1515 "ẫ": "a",
1516 "ậ": "a",
1517 "ç": "c",
1518 "ḉ": "c",
1519 "è": "e",
1520 "é": "e",
1521 "ê": "e",
1522 "ë": "e",
1523 "ế": "e",
1524 "ḗ": "e",
1525 "ề": "e",
1526 "ḕ": "e",
1527 "ḝ": "e",
1528 "ȇ": "e",
1529 "ẻ": "e",
1530 "ẽ": "e",
1531 "ẹ": "e",
1532 "ể": "e",
1533 "ễ": "e",
1534 "ệ": "e",
1535 "ì": "i",
1536 "í": "i",
1537 "î": "i",
1538 "ï": "i",
1539 "ḯ": "i",
1540 "ȋ": "i",
1541 "ỉ": "i",
1542 "ị": "i",
1543 "ð": "d",
1544 "ñ": "n",
1545 "ò": "o",
1546 "ó": "o",
1547 "ô": "o",
1548 "õ": "o",
1549 "ö": "o",
1550 "ø": "o",
1551 "ố": "o",
1552 "ṍ": "o",
1553 "ṓ": "o",
1554 "ȏ": "o",
1555 "ỏ": "o",
1556 "ọ": "o",
1557 "ổ": "o",
1558 "ỗ": "o",
1559 "ộ": "o",
1560 "ờ": "o",
1561 "ở": "o",
1562 "ỡ": "o",
1563 "ớ": "o",
1564 "ợ": "o",
1565 "ù": "u",
1566 "ú": "u",
1567 "û": "u",
1568 "ü": "u",
1569 "ủ": "u",
1570 "ụ": "u",
1571 "ử": "u",
1572 "ữ": "u",
1573 "ự": "u",
1574 "ý": "y",
1575 "ÿ": "y",
1576 "Ā": "A",
1577 "ā": "a",
1578 "Ă": "A",
1579 "ă": "a",
1580 "Ą": "A",
1581 "ą": "a",
1582 "Ć": "C",
1583 "ć": "c",
1584 "Ĉ": "C",
1585 "ĉ": "c",
1586 "Ċ": "C",
1587 "ċ": "c",
1588 "Č": "C",
1589 "č": "c",
1590 "C̆": "C",
1591 "c̆": "c",
1592 "Ď": "D",
1593 "ď": "d",
1594 "Đ": "D",
1595 "đ": "d",
1596 "Ē": "E",
1597 "ē": "e",
1598 "Ĕ": "E",
1599 "ĕ": "e",
1600 "Ė": "E",
1601 "ė": "e",
1602 "Ę": "E",
1603 "ę": "e",
1604 "Ě": "E",
1605 "ě": "e",
1606 "Ĝ": "G",
1607 "Ǵ": "G",
1608 "ĝ": "g",
1609 "ǵ": "g",
1610 "Ğ": "G",
1611 "ğ": "g",
1612 "Ġ": "G",
1613 "ġ": "g",
1614 "Ģ": "G",
1615 "ģ": "g",
1616 "Ĥ": "H",
1617 "ĥ": "h",
1618 "Ħ": "H",
1619 "ħ": "h",
1620 "Ḫ": "H",
1621 "ḫ": "h",
1622 "Ĩ": "I",
1623 "ĩ": "i",
1624 "Ī": "I",
1625 "ī": "i",
1626 "Ĭ": "I",
1627 "ĭ": "i",
1628 "Į": "I",
1629 "į": "i",
1630 "İ": "I",
1631 "ı": "i",
1632 "IJ": "IJ",
1633 "ij": "ij",
1634 "Ĵ": "J",
1635 "ĵ": "j",
1636 "Ķ": "K",
1637 "ķ": "k",
1638 "Ḱ": "K",
1639 "ḱ": "k",
1640 "K̆": "K",
1641 "k̆": "k",
1642 "Ĺ": "L",
1643 "ĺ": "l",
1644 "Ļ": "L",
1645 "ļ": "l",
1646 "Ľ": "L",
1647 "ľ": "l",
1648 "Ŀ": "L",
1649 "ŀ": "l",
1650 "Ł": "l",
1651 "ł": "l",
1652 "Ḿ": "M",
1653 "ḿ": "m",
1654 "M̆": "M",
1655 "m̆": "m",
1656 "Ń": "N",
1657 "ń": "n",
1658 "Ņ": "N",
1659 "ņ": "n",
1660 "Ň": "N",
1661 "ň": "n",
1662 "ʼn": "n",
1663 "N̆": "N",
1664 "n̆": "n",
1665 "Ō": "O",
1666 "ō": "o",
1667 "Ŏ": "O",
1668 "ŏ": "o",
1669 "Ő": "O",
1670 "ő": "o",
1671 "Œ": "OE",
1672 "œ": "oe",
1673 "P̆": "P",
1674 "p̆": "p",
1675 "Ŕ": "R",
1676 "ŕ": "r",
1677 "Ŗ": "R",
1678 "ŗ": "r",
1679 "Ř": "R",
1680 "ř": "r",
1681 "R̆": "R",
1682 "r̆": "r",
1683 "Ȓ": "R",
1684 "ȓ": "r",
1685 "Ś": "S",
1686 "ś": "s",
1687 "Ŝ": "S",
1688 "ŝ": "s",
1689 "Ş": "S",
1690 "Ș": "S",
1691 "ș": "s",
1692 "ş": "s",
1693 "Š": "S",
1694 "š": "s",
1695 "Ţ": "T",
1696 "ţ": "t",
1697 "ț": "t",
1698 "Ț": "T",
1699 "Ť": "T",
1700 "ť": "t",
1701 "Ŧ": "T",
1702 "ŧ": "t",
1703 "T̆": "T",
1704 "t̆": "t",
1705 "Ũ": "U",
1706 "ũ": "u",
1707 "Ū": "U",
1708 "ū": "u",
1709 "Ŭ": "U",
1710 "ŭ": "u",
1711 "Ů": "U",
1712 "ů": "u",
1713 "Ű": "U",
1714 "ű": "u",
1715 "Ų": "U",
1716 "ų": "u",
1717 "Ȗ": "U",
1718 "ȗ": "u",
1719 "V̆": "V",
1720 "v̆": "v",
1721 "Ŵ": "W",
1722 "ŵ": "w",
1723 "Ẃ": "W",
1724 "ẃ": "w",
1725 "X̆": "X",
1726 "x̆": "x",
1727 "Ŷ": "Y",
1728 "ŷ": "y",
1729 "Ÿ": "Y",
1730 "Y̆": "Y",
1731 "y̆": "y",
1732 "Ź": "Z",
1733 "ź": "z",
1734 "Ż": "Z",
1735 "ż": "z",
1736 "Ž": "Z",
1737 "ž": "z",
1738 "ſ": "s",
1739 "ƒ": "f",
1740 "Ơ": "O",
1741 "ơ": "o",
1742 "Ư": "U",
1743 "ư": "u",
1744 "Ǎ": "A",
1745 "ǎ": "a",
1746 "Ǐ": "I",
1747 "ǐ": "i",
1748 "Ǒ": "O",
1749 "ǒ": "o",
1750 "Ǔ": "U",
1751 "ǔ": "u",
1752 "Ǖ": "U",
1753 "ǖ": "u",
1754 "Ǘ": "U",
1755 "ǘ": "u",
1756 "Ǚ": "U",
1757 "ǚ": "u",
1758 "Ǜ": "U",
1759 "ǜ": "u",
1760 "Ứ": "U",
1761 "ứ": "u",
1762 "Ṹ": "U",
1763 "ṹ": "u",
1764 "Ǻ": "A",
1765 "ǻ": "a",
1766 "Ǽ": "AE",
1767 "ǽ": "ae",
1768 "Ǿ": "O",
1769 "ǿ": "o",
1770 "Þ": "TH",
1771 "þ": "th",
1772 "Ṕ": "P",
1773 "ṕ": "p",
1774 "Ṥ": "S",
1775 "ṥ": "s",
1776 "X́": "X",
1777 "x́": "x",
1778 "Ѓ": "Г",
1779 "ѓ": "г",
1780 "Ќ": "К",
1781 "ќ": "к",
1782 "A̋": "A",
1783 "a̋": "a",
1784 "E̋": "E",
1785 "e̋": "e",
1786 "I̋": "I",
1787 "i̋": "i",
1788 "Ǹ": "N",
1789 "ǹ": "n",
1790 "Ồ": "O",
1791 "ồ": "o",
1792 "Ṑ": "O",
1793 "ṑ": "o",
1794 "Ừ": "U",
1795 "ừ": "u",
1796 "Ẁ": "W",
1797 "ẁ": "w",
1798 "Ỳ": "Y",
1799 "ỳ": "y",
1800 "Ȁ": "A",
1801 "ȁ": "a",
1802 "Ȅ": "E",
1803 "ȅ": "e",
1804 "Ȉ": "I",
1805 "ȉ": "i",
1806 "Ȍ": "O",
1807 "ȍ": "o",
1808 "Ȑ": "R",
1809 "ȑ": "r",
1810 "Ȕ": "U",
1811 "ȕ": "u",
1812 "B̌": "B",
1813 "b̌": "b",
1814 "Č̣": "C",
1815 "č̣": "c",
1816 "Ê̌": "E",
1817 "ê̌": "e",
1818 "F̌": "F",
1819 "f̌": "f",
1820 "Ǧ": "G",
1821 "ǧ": "g",
1822 "Ȟ": "H",
1823 "ȟ": "h",
1824 "J̌": "J",
1825 "ǰ": "j",
1826 "Ǩ": "K",
1827 "ǩ": "k",
1828 "M̌": "M",
1829 "m̌": "m",
1830 "P̌": "P",
1831 "p̌": "p",
1832 "Q̌": "Q",
1833 "q̌": "q",
1834 "Ř̩": "R",
1835 "ř̩": "r",
1836 "Ṧ": "S",
1837 "ṧ": "s",
1838 "V̌": "V",
1839 "v̌": "v",
1840 "W̌": "W",
1841 "w̌": "w",
1842 "X̌": "X",
1843 "x̌": "x",
1844 "Y̌": "Y",
1845 "y̌": "y",
1846 "A̧": "A",
1847 "a̧": "a",
1848 "B̧": "B",
1849 "b̧": "b",
1850 "Ḑ": "D",
1851 "ḑ": "d",
1852 "Ȩ": "E",
1853 "ȩ": "e",
1854 "Ɛ̧": "E",
1855 "ɛ̧": "e",
1856 "Ḩ": "H",
1857 "ḩ": "h",
1858 "I̧": "I",
1859 "i̧": "i",
1860 "Ɨ̧": "I",
1861 "ɨ̧": "i",
1862 "M̧": "M",
1863 "m̧": "m",
1864 "O̧": "O",
1865 "o̧": "o",
1866 "Q̧": "Q",
1867 "q̧": "q",
1868 "U̧": "U",
1869 "u̧": "u",
1870 "X̧": "X",
1871 "x̧": "x",
1872 "Z̧": "Z",
1873 "z̧": "z",
1874 "й":"и",
1875 "Й":"И",
1876 "ё":"е",
1877 "Ё":"Е",
1878};
1879
1880var chars = Object.keys(characterMap).join('|');
1881var allAccents = new RegExp(chars, 'g');
1882var firstAccent = new RegExp(chars, '');
1883
1884function matcher(match) {
1885 return characterMap[match];
1886}
1887
1888var removeAccents = function(string) {
1889 return string.replace(allAccents, matcher);
1890};
1891
1892var hasAccents = function(string) {
1893 return !!string.match(firstAccent);
1894};
1895
1896module.exports = removeAccents;
1897module.exports.has = hasAccents;
1898module.exports.remove = removeAccents;
1899
1900
1901/***/ })
1902
1903/******/ });
1904/************************************************************************/
1905/******/ // The module cache
1906/******/ var __webpack_module_cache__ = {};
1907/******/
1908/******/ // The require function
1909/******/ function __webpack_require__(moduleId) {
1910/******/ // Check if module is in cache
1911/******/ var cachedModule = __webpack_module_cache__[moduleId];
1912/******/ if (cachedModule !== undefined) {
1913/******/ return cachedModule.exports;
1914/******/ }
1915/******/ // Create a new module (and put it into the cache)
1916/******/ var module = __webpack_module_cache__[moduleId] = {
1917/******/ // no module.id needed
1918/******/ // no module.loaded needed
1919/******/ exports: {}
1920/******/ };
1921/******/
1922/******/ // Execute the module function
1923/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1924/******/
1925/******/ // Return the exports of the module
1926/******/ return module.exports;
1927/******/ }
1928/******/
1929/************************************************************************/
1930/******/ /* webpack/runtime/compat get default export */
1931/******/ (() => {
1932/******/ // getDefaultExport function for compatibility with non-harmony modules
1933/******/ __webpack_require__.n = (module) => {
1934/******/ var getter = module && module.__esModule ?
1935/******/ () => (module['default']) :
1936/******/ () => (module);
1937/******/ __webpack_require__.d(getter, { a: getter });
1938/******/ return getter;
1939/******/ };
1940/******/ })();
1941/******/
1942/******/ /* webpack/runtime/create fake namespace object */
1943/******/ (() => {
1944/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
1945/******/ var leafPrototypes;
1946/******/ // create a fake namespace object
1947/******/ // mode & 1: value is a module id, require it
1948/******/ // mode & 2: merge all properties of value into the ns
1949/******/ // mode & 4: return value when already ns object
1950/******/ // mode & 16: return value when it's Promise-like
1951/******/ // mode & 8|1: behave like require
1952/******/ __webpack_require__.t = function(value, mode) {
1953/******/ if(mode & 1) value = this(value);
1954/******/ if(mode & 8) return value;
1955/******/ if(typeof value === 'object' && value) {
1956/******/ if((mode & 4) && value.__esModule) return value;
1957/******/ if((mode & 16) && typeof value.then === 'function') return value;
1958/******/ }
1959/******/ var ns = Object.create(null);
1960/******/ __webpack_require__.r(ns);
1961/******/ var def = {};
1962/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
1963/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
1964/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
1965/******/ }
1966/******/ def['default'] = () => (value);
1967/******/ __webpack_require__.d(ns, def);
1968/******/ return ns;
1969/******/ };
1970/******/ })();
1971/******/
1972/******/ /* webpack/runtime/define property getters */
1973/******/ (() => {
1974/******/ // define getter functions for harmony exports
1975/******/ __webpack_require__.d = (exports, definition) => {
1976/******/ for(var key in definition) {
1977/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1978/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1979/******/ }
1980/******/ }
1981/******/ };
1982/******/ })();
1983/******/
1984/******/ /* webpack/runtime/hasOwnProperty shorthand */
1985/******/ (() => {
1986/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1987/******/ })();
1988/******/
1989/******/ /* webpack/runtime/make namespace object */
1990/******/ (() => {
1991/******/ // define __esModule on exports
1992/******/ __webpack_require__.r = (exports) => {
1993/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1994/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1995/******/ }
1996/******/ Object.defineProperty(exports, '__esModule', { value: true });
1997/******/ };
1998/******/ })();
1999/******/
2000/******/ /* webpack/runtime/nonce */
2001/******/ (() => {
2002/******/ __webpack_require__.nc = undefined;
2003/******/ })();
2004/******/
2005/************************************************************************/
2006var __webpack_exports__ = {};
2007// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
2008(() => {
2009"use strict";
2010// ESM COMPAT FLAG
2011__webpack_require__.r(__webpack_exports__);
2012
2013// EXPORTS
2014__webpack_require__.d(__webpack_exports__, {
2015 AlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control_default),
2016 AnglePickerControl: () => (/* reexport */ angle_picker_control_default),
2017 Animate: () => (/* reexport */ animate_default),
2018 Autocomplete: () => (/* reexport */ Autocomplete),
2019 BaseControl: () => (/* reexport */ base_control_default),
2020 BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation),
2021 BorderBoxControl: () => (/* reexport */ border_box_control_component_component_default),
2022 BorderControl: () => (/* reexport */ border_control_component_component_default),
2023 BoxControl: () => (/* reexport */ box_control_default),
2024 Button: () => (/* reexport */ button_default),
2025 ButtonGroup: () => (/* reexport */ button_group_default),
2026 Card: () => (/* reexport */ card_component_component_default),
2027 CardBody: () => (/* reexport */ card_body_component_component_default),
2028 CardDivider: () => (/* reexport */ card_divider_component_component_default),
2029 CardFooter: () => (/* reexport */ card_footer_component_component_default),
2030 CardHeader: () => (/* reexport */ card_header_component_component_default),
2031 CardMedia: () => (/* reexport */ card_media_component_component_default),
2032 CheckboxControl: () => (/* reexport */ checkbox_control_default),
2033 Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle),
2034 ClipboardButton: () => (/* reexport */ ClipboardButton),
2035 ColorIndicator: () => (/* reexport */ color_indicator_default),
2036 ColorPalette: () => (/* reexport */ color_palette_default),
2037 ColorPicker: () => (/* reexport */ LegacyAdapter),
2038 ComboboxControl: () => (/* reexport */ combobox_control_default),
2039 Composite: () => (/* reexport */ composite_Composite),
2040 CustomGradientPicker: () => (/* reexport */ custom_gradient_picker_default),
2041 CustomSelectControl: () => (/* reexport */ custom_select_control_default),
2042 Dashicon: () => (/* reexport */ dashicon_default),
2043 DatePicker: () => (/* reexport */ date_default),
2044 DateTimePicker: () => (/* reexport */ date_time_date_time_default),
2045 Disabled: () => (/* reexport */ disabled_default),
2046 Draggable: () => (/* reexport */ draggable_default),
2047 DropZone: () => (/* reexport */ drop_zone_default),
2048 DropZoneProvider: () => (/* reexport */ DropZoneProvider),
2049 Dropdown: () => (/* reexport */ dropdown_default),
2050 DropdownMenu: () => (/* reexport */ dropdown_menu_default),
2051 DuotonePicker: () => (/* reexport */ duotone_picker_default),
2052 DuotoneSwatch: () => (/* reexport */ duotone_swatch_default),
2053 ExternalLink: () => (/* reexport */ external_link_default),
2054 Fill: () => (/* reexport */ slot_fill_Fill),
2055 Flex: () => (/* reexport */ flex_component_component_default),
2056 FlexBlock: () => (/* reexport */ flex_block_component_component_default),
2057 FlexItem: () => (/* reexport */ flex_item_component_component_default),
2058 FocalPointPicker: () => (/* reexport */ focal_point_picker_default),
2059 FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider),
2060 FocusableIframe: () => (/* reexport */ FocusableIframe),
2061 FontSizePicker: () => (/* reexport */ font_size_picker_default),
2062 FormFileUpload: () => (/* reexport */ form_file_upload_default),
2063 FormToggle: () => (/* reexport */ form_toggle_default),
2064 FormTokenField: () => (/* reexport */ form_token_field_default),
2065 G: () => (/* reexport */ external_wp_primitives_namespaceObject.G),
2066 GradientPicker: () => (/* reexport */ gradient_picker_default),
2067 Guide: () => (/* reexport */ guide_default),
2068 GuidePage: () => (/* reexport */ GuidePage),
2069 HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule),
2070 Icon: () => (/* reexport */ icon_icon_default),
2071 IconButton: () => (/* reexport */ deprecated_default),
2072 IsolatedEventContainer: () => (/* reexport */ isolated_event_container_default),
2073 KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts_default),
2074 Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line),
2075 MenuGroup: () => (/* reexport */ menu_group_default),
2076 MenuItem: () => (/* reexport */ menu_item_default),
2077 MenuItemsChoice: () => (/* reexport */ menu_items_choice_default),
2078 Modal: () => (/* reexport */ modal_default),
2079 NavigableMenu: () => (/* reexport */ menu_menu_default),
2080 Navigator: () => (/* reexport */ navigator_Navigator),
2081 Notice: () => (/* reexport */ notice_default),
2082 NoticeList: () => (/* reexport */ list_default),
2083 Panel: () => (/* reexport */ panel_default),
2084 PanelBody: () => (/* reexport */ body_default),
2085 PanelHeader: () => (/* reexport */ header_default),
2086 PanelRow: () => (/* reexport */ row_default),
2087 Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path),
2088 Placeholder: () => (/* reexport */ placeholder_default),
2089 Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon),
2090 Popover: () => (/* reexport */ popover_default),
2091 ProgressBar: () => (/* reexport */ progress_bar_default),
2092 QueryControls: () => (/* reexport */ query_controls_default),
2093 RadioControl: () => (/* reexport */ radio_control_default),
2094 RangeControl: () => (/* reexport */ range_control_default),
2095 Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect),
2096 ResizableBox: () => (/* reexport */ resizable_box_default),
2097 ResponsiveWrapper: () => (/* reexport */ responsive_wrapper_default),
2098 SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG),
2099 SandBox: () => (/* reexport */ sandbox_default),
2100 ScrollLock: () => (/* reexport */ scroll_lock_default),
2101 SearchControl: () => (/* reexport */ search_control_default),
2102 SelectControl: () => (/* reexport */ select_control_default),
2103 Slot: () => (/* reexport */ slot_fill_Slot),
2104 SlotFillProvider: () => (/* reexport */ Provider),
2105 Snackbar: () => (/* reexport */ snackbar_default),
2106 SnackbarList: () => (/* reexport */ list_list_default),
2107 Spinner: () => (/* reexport */ spinner_default),
2108 TabPanel: () => (/* reexport */ tab_panel_default),
2109 TabbableContainer: () => (/* reexport */ tabbable_default),
2110 TextControl: () => (/* reexport */ text_control_default),
2111 TextHighlight: () => (/* reexport */ text_highlight_default),
2112 TextareaControl: () => (/* reexport */ textarea_control_default),
2113 TimePicker: () => (/* reexport */ time_default),
2114 Tip: () => (/* reexport */ tip_tip_default),
2115 ToggleControl: () => (/* reexport */ toggle_control_default),
2116 Toolbar: () => (/* reexport */ toolbar_default),
2117 ToolbarButton: () => (/* reexport */ toolbar_button_default),
2118 ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu_default),
2119 ToolbarGroup: () => (/* reexport */ toolbar_group_default),
2120 ToolbarItem: () => (/* reexport */ toolbar_item_default),
2121 Tooltip: () => (/* reexport */ tooltip_default),
2122 TreeSelect: () => (/* reexport */ tree_select_default),
2123 VisuallyHidden: () => (/* reexport */ component_component_default),
2124 __experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control_default),
2125 __experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides),
2126 __experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component_component_default),
2127 __experimentalBorderControl: () => (/* reexport */ border_control_component_component_default),
2128 __experimentalBoxControl: () => (/* reexport */ box_control_default),
2129 __experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component_component_default),
2130 __experimentalDimensionControl: () => (/* reexport */ dimension_control_default),
2131 __experimentalDivider: () => (/* reexport */ divider_component_component_default),
2132 __experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper_default),
2133 __experimentalElevation: () => (/* reexport */ elevation_component_component_default),
2134 __experimentalGrid: () => (/* reexport */ grid_component_component_default),
2135 __experimentalHStack: () => (/* reexport */ h_stack_component_component_default),
2136 __experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders),
2137 __experimentalHeading: () => (/* reexport */ heading_component_component_default),
2138 __experimentalInputControl: () => (/* reexport */ input_control_default),
2139 __experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper_default),
2140 __experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper_default),
2141 __experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder),
2142 __experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder),
2143 __experimentalItem: () => (/* reexport */ item_component_component_default),
2144 __experimentalItemGroup: () => (/* reexport */ item_group_component_component_default),
2145 __experimentalNavigation: () => (/* reexport */ navigation_default),
2146 __experimentalNavigationBackButton: () => (/* reexport */ back_button_default),
2147 __experimentalNavigationGroup: () => (/* reexport */ group_default),
2148 __experimentalNavigationItem: () => (/* reexport */ item_item_default),
2149 __experimentalNavigationMenu: () => (/* reexport */ navigation_menu_menu_default),
2150 __experimentalNavigatorBackButton: () => (/* reexport */ legacy_NavigatorBackButton),
2151 __experimentalNavigatorButton: () => (/* reexport */ legacy_NavigatorButton),
2152 __experimentalNavigatorProvider: () => (/* reexport */ NavigatorProvider),
2153 __experimentalNavigatorScreen: () => (/* reexport */ legacy_NavigatorScreen),
2154 __experimentalNavigatorToParentButton: () => (/* reexport */ legacy_NavigatorToParentButton),
2155 __experimentalNumberControl: () => (/* reexport */ number_control_default),
2156 __experimentalPaletteEdit: () => (/* reexport */ palette_edit_default),
2157 __experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue),
2158 __experimentalRadio: () => (/* reexport */ radio_default),
2159 __experimentalRadioGroup: () => (/* reexport */ radio_group_default),
2160 __experimentalScrollable: () => (/* reexport */ scrollable_component_component_default),
2161 __experimentalSpacer: () => (/* reexport */ spacer_component_component_default),
2162 __experimentalStyleProvider: () => (/* reexport */ style_provider_default),
2163 __experimentalSurface: () => (/* reexport */ surface_component_component_default),
2164 __experimentalText: () => (/* reexport */ text_component_component_default),
2165 __experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component_component_default),
2166 __experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component_component_default),
2167 __experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component_component_default),
2168 __experimentalToolbarContext: () => (/* reexport */ toolbar_context_default),
2169 __experimentalToolsPanel: () => (/* reexport */ tools_panel_component_component_default),
2170 __experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext),
2171 __experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component_component_default),
2172 __experimentalTreeGrid: () => (/* reexport */ tree_grid_default),
2173 __experimentalTreeGridCell: () => (/* reexport */ cell_default),
2174 __experimentalTreeGridItem: () => (/* reexport */ tree_grid_item_item_default),
2175 __experimentalTreeGridRow: () => (/* reexport */ row_row_default),
2176 __experimentalTruncate: () => (/* reexport */ truncate_component_component_default),
2177 __experimentalUnitControl: () => (/* reexport */ unit_control_default),
2178 __experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits),
2179 __experimentalUseNavigator: () => (/* reexport */ useNavigator),
2180 __experimentalUseSlot: () => (/* reexport */ useSlot),
2181 __experimentalUseSlotFills: () => (/* reexport */ useSlotFills),
2182 __experimentalVStack: () => (/* reexport */ v_stack_component_component_default),
2183 __experimentalView: () => (/* reexport */ component_default),
2184 __experimentalZStack: () => (/* reexport */ z_stack_component_component_default),
2185 __unstableAnimatePresence: () => (/* reexport */ AnimatePresence),
2186 __unstableComposite: () => (/* reexport */ legacy_Composite),
2187 __unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup),
2188 __unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem),
2189 __unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent),
2190 __unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName),
2191 __unstableMotion: () => (/* reexport */ motion),
2192 __unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps),
2193 __unstableUseCompositeState: () => (/* reexport */ useCompositeState),
2194 __unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions),
2195 createSlotFill: () => (/* reexport */ createSlotFill),
2196 navigateRegions: () => (/* reexport */ navigate_regions_default),
2197 privateApis: () => (/* reexport */ privateApis),
2198 useBaseControlProps: () => (/* reexport */ useBaseControlProps),
2199 useNavigator: () => (/* reexport */ useNavigator),
2200 withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing_default),
2201 withFallbackStyles: () => (/* reexport */ with_fallback_styles_default),
2202 withFilters: () => (/* reexport */ withFilters),
2203 withFocusOutside: () => (/* reexport */ with_focus_outside_default),
2204 withFocusReturn: () => (/* reexport */ with_focus_return_default),
2205 withNotices: () => (/* reexport */ with_notices_default),
2206 withSpokenMessages: () => (/* reexport */ with_spoken_messages_default)
2207});
2208
2209// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js
2210var text_styles_namespaceObject = {};
2211__webpack_require__.r(text_styles_namespaceObject);
2212__webpack_require__.d(text_styles_namespaceObject, {
2213 Text: () => (Text),
2214 block: () => (styles_block),
2215 destructive: () => (destructive),
2216 highlighterText: () => (highlighterText),
2217 muted: () => (muted),
2218 positive: () => (positive),
2219 upperCase: () => (upperCase)
2220});
2221
2222// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js
2223var toggle_group_control_option_base_styles_namespaceObject = {};
2224__webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject);
2225__webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, {
2226 Rp: () => (ButtonContentView),
2227 y0: () => (LabelView),
2228 uG: () => (buttonView),
2229 eh: () => (labelBlock)
2230});
2231
2232// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/components/custom-components.js
2233var custom_components_namespaceObject = {};
2234__webpack_require__.r(custom_components_namespaceObject);
2235__webpack_require__.d(custom_components_namespaceObject, {
2236 Button: () => (Button_Button),
2237 CaptionLabel: () => (CaptionLabel),
2238 Chevron: () => (Chevron),
2239 Day: () => (Day_Day),
2240 DayButton: () => (DayButton_DayButton),
2241 Dropdown: () => (Dropdown_Dropdown),
2242 DropdownNav: () => (DropdownNav),
2243 Footer: () => (Footer_Footer),
2244 Month: () => (Month_Month),
2245 MonthCaption: () => (MonthCaption),
2246 MonthGrid: () => (MonthGrid),
2247 Months: () => (Months),
2248 MonthsDropdown: () => (MonthsDropdown),
2249 Nav: () => (Nav),
2250 NextMonthButton: () => (NextMonthButton),
2251 Option: () => (Option_Option),
2252 PreviousMonthButton: () => (PreviousMonthButton),
2253 Root: () => (Root_Root),
2254 Select: () => (Select_Select),
2255 Week: () => (Week),
2256 WeekNumber: () => (WeekNumber),
2257 WeekNumberHeader: () => (WeekNumberHeader),
2258 Weekday: () => (Weekday),
2259 Weekdays: () => (Weekdays),
2260 Weeks: () => (Weeks),
2261 YearsDropdown: () => (YearsDropdown)
2262});
2263
2264// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/formatters/index.js
2265var esm_formatters_namespaceObject = {};
2266__webpack_require__.r(esm_formatters_namespaceObject);
2267__webpack_require__.d(esm_formatters_namespaceObject, {
2268 formatCaption: () => (formatCaption),
2269 formatDay: () => (formatDay),
2270 formatMonthCaption: () => (formatMonthCaption),
2271 formatMonthDropdown: () => (formatMonthDropdown),
2272 formatWeekNumber: () => (formatWeekNumber),
2273 formatWeekNumberHeader: () => (formatWeekNumberHeader),
2274 formatWeekdayName: () => (formatWeekdayName),
2275 formatYearCaption: () => (formatYearCaption),
2276 formatYearDropdown: () => (formatYearDropdown)
2277});
2278
2279// NAMESPACE OBJECT: ./node_modules/react-day-picker/dist/esm/labels/index.js
2280var labels_namespaceObject = {};
2281__webpack_require__.r(labels_namespaceObject);
2282__webpack_require__.d(labels_namespaceObject, {
2283 labelCaption: () => (labelCaption),
2284 labelDay: () => (labelDay),
2285 labelDayButton: () => (labelDayButton),
2286 labelGrid: () => (labelGrid),
2287 labelGridcell: () => (labelGridcell),
2288 labelMonthDropdown: () => (labelMonthDropdown),
2289 labelNav: () => (labelNav),
2290 labelNext: () => (labelNext),
2291 labelPrevious: () => (labelPrevious),
2292 labelWeekNumber: () => (labelWeekNumber),
2293 labelWeekNumberHeader: () => (labelWeekNumberHeader),
2294 labelWeekday: () => (labelWeekday),
2295 labelYearDropdown: () => (labelYearDropdown)
2296});
2297
2298;// external ["wp","primitives"]
2299const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
2300;// ./node_modules/clsx/dist/clsx.mjs
2301function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
2302;// external ["wp","i18n"]
2303const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
2304;// external ["wp","compose"]
2305const external_wp_compose_namespaceObject = window["wp"]["compose"];
2306;// external ["wp","element"]
2307const external_wp_element_namespaceObject = window["wp"]["element"];
2308;// ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js
2309"use client";
2310var __defProp = Object.defineProperty;
2311var __defProps = Object.defineProperties;
2312var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2313var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2314var __hasOwnProp = Object.prototype.hasOwnProperty;
2315var __propIsEnum = Object.prototype.propertyIsEnumerable;
2316var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2317var _3YLGPPWQ_spreadValues = (a, b) => {
2318 for (var prop in b || (b = {}))
2319 if (__hasOwnProp.call(b, prop))
2320 __defNormalProp(a, prop, b[prop]);
2321 if (__getOwnPropSymbols)
2322 for (var prop of __getOwnPropSymbols(b)) {
2323 if (__propIsEnum.call(b, prop))
2324 __defNormalProp(a, prop, b[prop]);
2325 }
2326 return a;
2327};
2328var _3YLGPPWQ_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2329var __objRest = (source, exclude) => {
2330 var target = {};
2331 for (var prop in source)
2332 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2333 target[prop] = source[prop];
2334 if (source != null && __getOwnPropSymbols)
2335 for (var prop of __getOwnPropSymbols(source)) {
2336 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
2337 target[prop] = source[prop];
2338 }
2339 return target;
2340};
2341
2342
2343
2344;// ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js
2345"use client";
2346var _3YLGPPWQ_defProp = Object.defineProperty;
2347var _3YLGPPWQ_defProps = Object.defineProperties;
2348var _3YLGPPWQ_getOwnPropDescs = Object.getOwnPropertyDescriptors;
2349var _3YLGPPWQ_getOwnPropSymbols = Object.getOwnPropertySymbols;
2350var _3YLGPPWQ_hasOwnProp = Object.prototype.hasOwnProperty;
2351var _3YLGPPWQ_propIsEnum = Object.prototype.propertyIsEnumerable;
2352var _3YLGPPWQ_defNormalProp = (obj, key, value) => key in obj ? _3YLGPPWQ_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2353var _chunks_3YLGPPWQ_spreadValues = (a, b) => {
2354 for (var prop in b || (b = {}))
2355 if (_3YLGPPWQ_hasOwnProp.call(b, prop))
2356 _3YLGPPWQ_defNormalProp(a, prop, b[prop]);
2357 if (_3YLGPPWQ_getOwnPropSymbols)
2358 for (var prop of _3YLGPPWQ_getOwnPropSymbols(b)) {
2359 if (_3YLGPPWQ_propIsEnum.call(b, prop))
2360 _3YLGPPWQ_defNormalProp(a, prop, b[prop]);
2361 }
2362 return a;
2363};
2364var _chunks_3YLGPPWQ_spreadProps = (a, b) => _3YLGPPWQ_defProps(a, _3YLGPPWQ_getOwnPropDescs(b));
2365var _3YLGPPWQ_objRest = (source, exclude) => {
2366 var target = {};
2367 for (var prop in source)
2368 if (_3YLGPPWQ_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2369 target[prop] = source[prop];
2370 if (source != null && _3YLGPPWQ_getOwnPropSymbols)
2371 for (var prop of _3YLGPPWQ_getOwnPropSymbols(source)) {
2372 if (exclude.indexOf(prop) < 0 && _3YLGPPWQ_propIsEnum.call(source, prop))
2373 target[prop] = source[prop];
2374 }
2375 return target;
2376};
2377
2378
2379
2380;// ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js
2381"use client";
2382
2383
2384// src/utils/misc.ts
2385function PBFD2E7P_noop(..._) {
2386}
2387function shallowEqual(a, b) {
2388 if (a === b) return true;
2389 if (!a) return false;
2390 if (!b) return false;
2391 if (typeof a !== "object") return false;
2392 if (typeof b !== "object") return false;
2393 const aKeys = Object.keys(a);
2394 const bKeys = Object.keys(b);
2395 const { length } = aKeys;
2396 if (bKeys.length !== length) return false;
2397 for (const key of aKeys) {
2398 if (a[key] !== b[key]) {
2399 return false;
2400 }
2401 }
2402 return true;
2403}
2404function applyState(argument, currentValue) {
2405 if (isUpdater(argument)) {
2406 const value = isLazyValue(currentValue) ? currentValue() : currentValue;
2407 return argument(value);
2408 }
2409 return argument;
2410}
2411function isUpdater(argument) {
2412 return typeof argument === "function";
2413}
2414function isLazyValue(value) {
2415 return typeof value === "function";
2416}
2417function isObject(arg) {
2418 return typeof arg === "object" && arg != null;
2419}
2420function isEmpty(arg) {
2421 if (Array.isArray(arg)) return !arg.length;
2422 if (isObject(arg)) return !Object.keys(arg).length;
2423 if (arg == null) return true;
2424 if (arg === "") return true;
2425 return false;
2426}
2427function isInteger(arg) {
2428 if (typeof arg === "number") {
2429 return Math.floor(arg) === arg;
2430 }
2431 return String(Math.floor(Number(arg))) === arg;
2432}
2433function PBFD2E7P_hasOwnProperty(object, prop) {
2434 if (typeof Object.hasOwn === "function") {
2435 return Object.hasOwn(object, prop);
2436 }
2437 return Object.prototype.hasOwnProperty.call(object, prop);
2438}
2439function chain(...fns) {
2440 return (...args) => {
2441 for (const fn of fns) {
2442 if (typeof fn === "function") {
2443 fn(...args);
2444 }
2445 }
2446 };
2447}
2448function cx(...args) {
2449 return args.filter(Boolean).join(" ") || void 0;
2450}
2451function normalizeString(str) {
2452 return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
2453}
2454function omit(object, keys) {
2455 const result = _chunks_3YLGPPWQ_spreadValues({}, object);
2456 for (const key of keys) {
2457 if (PBFD2E7P_hasOwnProperty(result, key)) {
2458 delete result[key];
2459 }
2460 }
2461 return result;
2462}
2463function pick(object, paths) {
2464 const result = {};
2465 for (const key of paths) {
2466 if (PBFD2E7P_hasOwnProperty(object, key)) {
2467 result[key] = object[key];
2468 }
2469 }
2470 return result;
2471}
2472function identity(value) {
2473 return value;
2474}
2475function beforePaint(cb = PBFD2E7P_noop) {
2476 const raf = requestAnimationFrame(cb);
2477 return () => cancelAnimationFrame(raf);
2478}
2479function afterPaint(cb = PBFD2E7P_noop) {
2480 let raf = requestAnimationFrame(() => {
2481 raf = requestAnimationFrame(cb);
2482 });
2483 return () => cancelAnimationFrame(raf);
2484}
2485function invariant(condition, message) {
2486 if (condition) return;
2487 if (typeof message !== "string") throw new Error("Invariant failed");
2488 throw new Error(message);
2489}
2490function getKeys(obj) {
2491 return Object.keys(obj);
2492}
2493function isFalsyBooleanCallback(booleanOrCallback, ...args) {
2494 const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
2495 if (result == null) return false;
2496 return !result;
2497}
2498function disabledFromProps(props) {
2499 return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
2500}
2501function removeUndefinedValues(obj) {
2502 const result = {};
2503 for (const key in obj) {
2504 if (obj[key] !== void 0) {
2505 result[key] = obj[key];
2506 }
2507 }
2508 return result;
2509}
2510function defaultValue(...values) {
2511 for (const value of values) {
2512 if (value !== void 0) return value;
2513 }
2514 return void 0;
2515}
2516
2517
2518
2519// EXTERNAL MODULE: external "React"
2520var external_React_ = __webpack_require__(1609);
2521var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2);
2522var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
2523;// ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js
2524"use client";
2525
2526
2527// src/utils/misc.ts
2528
2529
2530function setRef(ref, value) {
2531 if (typeof ref === "function") {
2532 ref(value);
2533 } else if (ref) {
2534 ref.current = value;
2535 }
2536}
2537function isValidElementWithRef(element) {
2538 if (!element) return false;
2539 if (!(0,external_React_.isValidElement)(element)) return false;
2540 if ("ref" in element.props) return true;
2541 if ("ref" in element) return true;
2542 return false;
2543}
2544function getRefProperty(element) {
2545 if (!isValidElementWithRef(element)) return null;
2546 const props = _3YLGPPWQ_spreadValues({}, element.props);
2547 return props.ref || element.ref;
2548}
2549function mergeProps(base, overrides) {
2550 const props = _3YLGPPWQ_spreadValues({}, base);
2551 for (const key in overrides) {
2552 if (!PBFD2E7P_hasOwnProperty(overrides, key)) continue;
2553 if (key === "className") {
2554 const prop = "className";
2555 props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
2556 continue;
2557 }
2558 if (key === "style") {
2559 const prop = "style";
2560 props[prop] = base[prop] ? _3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop];
2561 continue;
2562 }
2563 const overrideValue = overrides[key];
2564 if (typeof overrideValue === "function" && key.startsWith("on")) {
2565 const baseValue = base[key];
2566 if (typeof baseValue === "function") {
2567 props[key] = (...args) => {
2568 overrideValue(...args);
2569 baseValue(...args);
2570 };
2571 continue;
2572 }
2573 }
2574 props[key] = overrideValue;
2575 }
2576 return props;
2577}
2578
2579
2580
2581;// ./node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js
2582"use client";
2583
2584// src/utils/dom.ts
2585var canUseDOM = checkIsBrowser();
2586function checkIsBrowser() {
2587 var _a;
2588 return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
2589}
2590function getDocument(node) {
2591 if (!node) return document;
2592 if ("self" in node) return node.document;
2593 return node.ownerDocument || document;
2594}
2595function getWindow(node) {
2596 if (!node) return self;
2597 if ("self" in node) return node.self;
2598 return getDocument(node).defaultView || window;
2599}
2600function getActiveElement(node, activeDescendant = false) {
2601 const { activeElement } = getDocument(node);
2602 if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
2603 return null;
2604 }
2605 if (isFrame(activeElement) && activeElement.contentDocument) {
2606 return getActiveElement(
2607 activeElement.contentDocument.body,
2608 activeDescendant
2609 );
2610 }
2611 if (activeDescendant) {
2612 const id = activeElement.getAttribute("aria-activedescendant");
2613 if (id) {
2614 const element = getDocument(activeElement).getElementById(id);
2615 if (element) {
2616 return element;
2617 }
2618 }
2619 }
2620 return activeElement;
2621}
2622function contains(parent, child) {
2623 return parent === child || parent.contains(child);
2624}
2625function isFrame(element) {
2626 return element.tagName === "IFRAME";
2627}
2628function isButton(element) {
2629 const tagName = element.tagName.toLowerCase();
2630 if (tagName === "button") return true;
2631 if (tagName === "input" && element.type) {
2632 return buttonInputTypes.indexOf(element.type) !== -1;
2633 }
2634 return false;
2635}
2636var buttonInputTypes = [
2637 "button",
2638 "color",
2639 "file",
2640 "image",
2641 "reset",
2642 "submit"
2643];
2644function isVisible(element) {
2645 if (typeof element.checkVisibility === "function") {
2646 return element.checkVisibility();
2647 }
2648 const htmlElement = element;
2649 return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
2650}
2651function isTextField(element) {
2652 try {
2653 const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
2654 const isTextArea = element.tagName === "TEXTAREA";
2655 return isTextInput || isTextArea || false;
2656 } catch (error) {
2657 return false;
2658 }
2659}
2660function isTextbox(element) {
2661 return element.isContentEditable || isTextField(element);
2662}
2663function getTextboxValue(element) {
2664 if (isTextField(element)) {
2665 return element.value;
2666 }
2667 if (element.isContentEditable) {
2668 const range = getDocument(element).createRange();
2669 range.selectNodeContents(element);
2670 return range.toString();
2671 }
2672 return "";
2673}
2674function getTextboxSelection(element) {
2675 let start = 0;
2676 let end = 0;
2677 if (isTextField(element)) {
2678 start = element.selectionStart || 0;
2679 end = element.selectionEnd || 0;
2680 } else if (element.isContentEditable) {
2681 const selection = getDocument(element).getSelection();
2682 if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) {
2683 const range = selection.getRangeAt(0);
2684 const nextRange = range.cloneRange();
2685 nextRange.selectNodeContents(element);
2686 nextRange.setEnd(range.startContainer, range.startOffset);
2687 start = nextRange.toString().length;
2688 nextRange.setEnd(range.endContainer, range.endOffset);
2689 end = nextRange.toString().length;
2690 }
2691 }
2692 return { start, end };
2693}
2694function getPopupRole(element, fallback) {
2695 const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
2696 const role = element == null ? void 0 : element.getAttribute("role");
2697 if (role && allowedPopupRoles.indexOf(role) !== -1) {
2698 return role;
2699 }
2700 return fallback;
2701}
2702function getPopupItemRole(element, fallback) {
2703 var _a;
2704 const itemRoleByPopupRole = {
2705 menu: "menuitem",
2706 listbox: "option",
2707 tree: "treeitem"
2708 };
2709 const popupRole = getPopupRole(element);
2710 if (!popupRole) return fallback;
2711 const key = popupRole;
2712 return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
2713}
2714function scrollIntoViewIfNeeded(element, arg) {
2715 if (isPartiallyHidden(element) && "scrollIntoView" in element) {
2716 element.scrollIntoView(arg);
2717 }
2718}
2719function getScrollingElement(element) {
2720 if (!element) return null;
2721 const isScrollableOverflow = (overflow) => {
2722 if (overflow === "auto") return true;
2723 if (overflow === "scroll") return true;
2724 return false;
2725 };
2726 if (element.clientHeight && element.scrollHeight > element.clientHeight) {
2727 const { overflowY } = getComputedStyle(element);
2728 if (isScrollableOverflow(overflowY)) return element;
2729 } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
2730 const { overflowX } = getComputedStyle(element);
2731 if (isScrollableOverflow(overflowX)) return element;
2732 }
2733 return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
2734}
2735function isPartiallyHidden(element) {
2736 const elementRect = element.getBoundingClientRect();
2737 const scroller = getScrollingElement(element);
2738 if (!scroller) return false;
2739 const scrollerRect = scroller.getBoundingClientRect();
2740 const isHTML = scroller.tagName === "HTML";
2741 const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
2742 const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom;
2743 const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left;
2744 const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right;
2745 const top = elementRect.top < scrollerTop;
2746 const left = elementRect.left < scrollerLeft;
2747 const bottom = elementRect.bottom > scrollerBottom;
2748 const right = elementRect.right > scrollerRight;
2749 return top || left || bottom || right;
2750}
2751function setSelectionRange(element, ...args) {
2752 if (/text|search|password|tel|url/i.test(element.type)) {
2753 element.setSelectionRange(...args);
2754 }
2755}
2756function sortBasedOnDOMPosition(items, getElement) {
2757 const pairs = items.map((item, index) => [index, item]);
2758 let isOrderDifferent = false;
2759 pairs.sort(([indexA, a], [indexB, b]) => {
2760 const elementA = getElement(a);
2761 const elementB = getElement(b);
2762 if (elementA === elementB) return 0;
2763 if (!elementA || !elementB) return 0;
2764 if (isElementPreceding(elementA, elementB)) {
2765 if (indexA > indexB) {
2766 isOrderDifferent = true;
2767 }
2768 return -1;
2769 }
2770 if (indexA < indexB) {
2771 isOrderDifferent = true;
2772 }
2773 return 1;
2774 });
2775 if (isOrderDifferent) {
2776 return pairs.map(([_, item]) => item);
2777 }
2778 return items;
2779}
2780function isElementPreceding(a, b) {
2781 return Boolean(
2782 b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
2783 );
2784}
2785
2786
2787
2788;// ./node_modules/@ariakit/core/esm/__chunks/QAGXQEUG.js
2789"use client";
2790
2791
2792// src/utils/platform.ts
2793function isTouchDevice() {
2794 return canUseDOM && !!navigator.maxTouchPoints;
2795}
2796function isApple() {
2797 if (!canUseDOM) return false;
2798 return /mac|iphone|ipad|ipod/i.test(navigator.platform);
2799}
2800function isSafari() {
2801 return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
2802}
2803function isFirefox() {
2804 return canUseDOM && /firefox\//i.test(navigator.userAgent);
2805}
2806function isMac() {
2807 return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
2808}
2809
2810
2811
2812;// ./node_modules/@ariakit/core/esm/utils/events.js
2813"use client";
2814
2815
2816
2817
2818// src/utils/events.ts
2819function isPortalEvent(event) {
2820 return Boolean(
2821 event.currentTarget && !contains(event.currentTarget, event.target)
2822 );
2823}
2824function isSelfTarget(event) {
2825 return event.target === event.currentTarget;
2826}
2827function isOpeningInNewTab(event) {
2828 const element = event.currentTarget;
2829 if (!element) return false;
2830 const isAppleDevice = isApple();
2831 if (isAppleDevice && !event.metaKey) return false;
2832 if (!isAppleDevice && !event.ctrlKey) return false;
2833 const tagName = element.tagName.toLowerCase();
2834 if (tagName === "a") return true;
2835 if (tagName === "button" && element.type === "submit") return true;
2836 if (tagName === "input" && element.type === "submit") return true;
2837 return false;
2838}
2839function isDownloading(event) {
2840 const element = event.currentTarget;
2841 if (!element) return false;
2842 const tagName = element.tagName.toLowerCase();
2843 if (!event.altKey) return false;
2844 if (tagName === "a") return true;
2845 if (tagName === "button" && element.type === "submit") return true;
2846 if (tagName === "input" && element.type === "submit") return true;
2847 return false;
2848}
2849function fireEvent(element, type, eventInit) {
2850 const event = new Event(type, eventInit);
2851 return element.dispatchEvent(event);
2852}
2853function fireBlurEvent(element, eventInit) {
2854 const event = new FocusEvent("blur", eventInit);
2855 const defaultAllowed = element.dispatchEvent(event);
2856 const bubbleInit = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, eventInit), { bubbles: true });
2857 element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
2858 return defaultAllowed;
2859}
2860function fireFocusEvent(element, eventInit) {
2861 const event = new FocusEvent("focus", eventInit);
2862 const defaultAllowed = element.dispatchEvent(event);
2863 const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true });
2864 element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
2865 return defaultAllowed;
2866}
2867function fireKeyboardEvent(element, type, eventInit) {
2868 const event = new KeyboardEvent(type, eventInit);
2869 return element.dispatchEvent(event);
2870}
2871function fireClickEvent(element, eventInit) {
2872 const event = new MouseEvent("click", eventInit);
2873 return element.dispatchEvent(event);
2874}
2875function isFocusEventOutside(event, container) {
2876 const containerElement = container || event.currentTarget;
2877 const relatedTarget = event.relatedTarget;
2878 return !relatedTarget || !contains(containerElement, relatedTarget);
2879}
2880function getInputType(event) {
2881 const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
2882 if (!nativeEvent) return;
2883 if (!("inputType" in nativeEvent)) return;
2884 if (typeof nativeEvent.inputType !== "string") return;
2885 return nativeEvent.inputType;
2886}
2887function queueBeforeEvent(element, type, callback, timeout) {
2888 const createTimer = (callback2) => {
2889 if (timeout) {
2890 const timerId2 = setTimeout(callback2, timeout);
2891 return () => clearTimeout(timerId2);
2892 }
2893 const timerId = requestAnimationFrame(callback2);
2894 return () => cancelAnimationFrame(timerId);
2895 };
2896 const cancelTimer = createTimer(() => {
2897 element.removeEventListener(type, callSync, true);
2898 callback();
2899 });
2900 const callSync = () => {
2901 cancelTimer();
2902 callback();
2903 };
2904 element.addEventListener(type, callSync, { once: true, capture: true });
2905 return cancelTimer;
2906}
2907function addGlobalEventListener(type, listener, options, scope = window) {
2908 const children = [];
2909 try {
2910 scope.document.addEventListener(type, listener, options);
2911 for (const frame of Array.from(scope.frames)) {
2912 children.push(addGlobalEventListener(type, listener, options, frame));
2913 }
2914 } catch (e) {
2915 }
2916 const removeEventListener = () => {
2917 try {
2918 scope.document.removeEventListener(type, listener, options);
2919 } catch (e) {
2920 }
2921 for (const remove of children) {
2922 remove();
2923 }
2924 };
2925 return removeEventListener;
2926}
2927
2928
2929;// ./node_modules/@ariakit/react-core/esm/__chunks/ABQUS43J.js
2930"use client";
2931
2932
2933
2934// src/utils/hooks.ts
2935
2936
2937
2938
2939var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject);
2940var useReactId = _React.useId;
2941var useReactDeferredValue = _React.useDeferredValue;
2942var useReactInsertionEffect = _React.useInsertionEffect;
2943var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect;
2944function useInitialValue(value) {
2945 const [initialValue] = (0,external_React_.useState)(value);
2946 return initialValue;
2947}
2948function useLazyValue(init) {
2949 const ref = useRef();
2950 if (ref.current === void 0) {
2951 ref.current = init();
2952 }
2953 return ref.current;
2954}
2955function useLiveRef(value) {
2956 const ref = (0,external_React_.useRef)(value);
2957 useSafeLayoutEffect(() => {
2958 ref.current = value;
2959 });
2960 return ref;
2961}
2962function usePreviousValue(value) {
2963 const [previousValue, setPreviousValue] = useState(value);
2964 if (value !== previousValue) {
2965 setPreviousValue(value);
2966 }
2967 return previousValue;
2968}
2969function useEvent(callback) {
2970 const ref = (0,external_React_.useRef)(() => {
2971 throw new Error("Cannot call an event handler while rendering.");
2972 });
2973 if (useReactInsertionEffect) {
2974 useReactInsertionEffect(() => {
2975 ref.current = callback;
2976 });
2977 } else {
2978 ref.current = callback;
2979 }
2980 return (0,external_React_.useCallback)((...args) => {
2981 var _a;
2982 return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
2983 }, []);
2984}
2985function useTransactionState(callback) {
2986 const [state, setState] = (0,external_React_.useState)(null);
2987 useSafeLayoutEffect(() => {
2988 if (state == null) return;
2989 if (!callback) return;
2990 let prevState = null;
2991 callback((prev) => {
2992 prevState = prev;
2993 return state;
2994 });
2995 return () => {
2996 callback(prevState);
2997 };
2998 }, [state, callback]);
2999 return [state, setState];
3000}
3001function useMergeRefs(...refs) {
3002 return (0,external_React_.useMemo)(() => {
3003 if (!refs.some(Boolean)) return;
3004 return (value) => {
3005 for (const ref of refs) {
3006 setRef(ref, value);
3007 }
3008 };
3009 }, refs);
3010}
3011function useId(defaultId) {
3012 if (useReactId) {
3013 const reactId = useReactId();
3014 if (defaultId) return defaultId;
3015 return reactId;
3016 }
3017 const [id, setId] = (0,external_React_.useState)(defaultId);
3018 useSafeLayoutEffect(() => {
3019 if (defaultId || id) return;
3020 const random = Math.random().toString(36).slice(2, 8);
3021 setId(`id-${random}`);
3022 }, [defaultId, id]);
3023 return defaultId || id;
3024}
3025function useDeferredValue(value) {
3026 if (useReactDeferredValue) {
3027 return useReactDeferredValue(value);
3028 }
3029 const [deferredValue, setDeferredValue] = useState(value);
3030 useEffect(() => {
3031 const raf = requestAnimationFrame(() => setDeferredValue(value));
3032 return () => cancelAnimationFrame(raf);
3033 }, [value]);
3034 return deferredValue;
3035}
3036function useTagName(refOrElement, type) {
3037 const stringOrUndefined = (type2) => {
3038 if (typeof type2 !== "string") return;
3039 return type2;
3040 };
3041 const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type));
3042 useSafeLayoutEffect(() => {
3043 const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
3044 setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
3045 }, [refOrElement, type]);
3046 return tagName;
3047}
3048function useAttribute(refOrElement, attributeName, defaultValue) {
3049 const initialValue = useInitialValue(defaultValue);
3050 const [attribute, setAttribute] = (0,external_React_.useState)(initialValue);
3051 (0,external_React_.useEffect)(() => {
3052 const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
3053 if (!element) return;
3054 const callback = () => {
3055 const value = element.getAttribute(attributeName);
3056 setAttribute(value == null ? initialValue : value);
3057 };
3058 const observer = new MutationObserver(callback);
3059 observer.observe(element, { attributeFilter: [attributeName] });
3060 callback();
3061 return () => observer.disconnect();
3062 }, [refOrElement, attributeName, initialValue]);
3063 return attribute;
3064}
3065function useUpdateEffect(effect, deps) {
3066 const mounted = (0,external_React_.useRef)(false);
3067 (0,external_React_.useEffect)(() => {
3068 if (mounted.current) {
3069 return effect();
3070 }
3071 mounted.current = true;
3072 }, deps);
3073 (0,external_React_.useEffect)(
3074 () => () => {
3075 mounted.current = false;
3076 },
3077 []
3078 );
3079}
3080function useUpdateLayoutEffect(effect, deps) {
3081 const mounted = useRef(false);
3082 useSafeLayoutEffect(() => {
3083 if (mounted.current) {
3084 return effect();
3085 }
3086 mounted.current = true;
3087 }, deps);
3088 useSafeLayoutEffect(
3089 () => () => {
3090 mounted.current = false;
3091 },
3092 []
3093 );
3094}
3095function useForceUpdate() {
3096 return (0,external_React_.useReducer)(() => [], []);
3097}
3098function useBooleanEvent(booleanOrCallback) {
3099 return useEvent(
3100 typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
3101 );
3102}
3103function useWrapElement(props, callback, deps = []) {
3104 const wrapElement = (0,external_React_.useCallback)(
3105 (element) => {
3106 if (props.wrapElement) {
3107 element = props.wrapElement(element);
3108 }
3109 return callback(element);
3110 },
3111 [...deps, props.wrapElement]
3112 );
3113 return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { wrapElement });
3114}
3115function usePortalRef(portalProp = false, portalRefProp) {
3116 const [portalNode, setPortalNode] = (0,external_React_.useState)(null);
3117 const portalRef = useMergeRefs(setPortalNode, portalRefProp);
3118 const domReady = !portalProp || portalNode;
3119 return { portalRef, portalNode, domReady };
3120}
3121function useMetadataProps(props, key, value) {
3122 const parent = props.onLoadedMetadataCapture;
3123 const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => {
3124 return Object.assign(() => {
3125 }, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, parent), { [key]: value }));
3126 }, [parent, key, value]);
3127 return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
3128}
3129function useIsMouseMoving() {
3130 (0,external_React_.useEffect)(() => {
3131 addGlobalEventListener("mousemove", setMouseMoving, true);
3132 addGlobalEventListener("mousedown", resetMouseMoving, true);
3133 addGlobalEventListener("mouseup", resetMouseMoving, true);
3134 addGlobalEventListener("keydown", resetMouseMoving, true);
3135 addGlobalEventListener("scroll", resetMouseMoving, true);
3136 }, []);
3137 const isMouseMoving = useEvent(() => mouseMoving);
3138 return isMouseMoving;
3139}
3140var mouseMoving = false;
3141var previousScreenX = 0;
3142var previousScreenY = 0;
3143function hasMouseMovement(event) {
3144 const movementX = event.movementX || event.screenX - previousScreenX;
3145 const movementY = event.movementY || event.screenY - previousScreenY;
3146 previousScreenX = event.screenX;
3147 previousScreenY = event.screenY;
3148 return movementX || movementY || "production" === "test";
3149}
3150function setMouseMoving(event) {
3151 if (!hasMouseMovement(event)) return;
3152 mouseMoving = true;
3153}
3154function resetMouseMoving() {
3155 mouseMoving = false;
3156}
3157
3158
3159
3160;// ./node_modules/@ariakit/core/esm/__chunks/BCALMBPZ.js
3161"use client";
3162
3163
3164
3165// src/utils/store.ts
3166function getInternal(store, key) {
3167 const internals = store.__unstableInternals;
3168 invariant(internals, "Invalid store");
3169 return internals[key];
3170}
3171function createStore(initialState, ...stores) {
3172 let state = initialState;
3173 let prevStateBatch = state;
3174 let lastUpdate = Symbol();
3175 let destroy = PBFD2E7P_noop;
3176 const instances = /* @__PURE__ */ new Set();
3177 const updatedKeys = /* @__PURE__ */ new Set();
3178 const setups = /* @__PURE__ */ new Set();
3179 const listeners = /* @__PURE__ */ new Set();
3180 const batchListeners = /* @__PURE__ */ new Set();
3181 const disposables = /* @__PURE__ */ new WeakMap();
3182 const listenerKeys = /* @__PURE__ */ new WeakMap();
3183 const storeSetup = (callback) => {
3184 setups.add(callback);
3185 return () => setups.delete(callback);
3186 };
3187 const storeInit = () => {
3188 const initialized = instances.size;
3189 const instance = Symbol();
3190 instances.add(instance);
3191 const maybeDestroy = () => {
3192 instances.delete(instance);
3193 if (instances.size) return;
3194 destroy();
3195 };
3196 if (initialized) return maybeDestroy;
3197 const desyncs = getKeys(state).map(
3198 (key) => chain(
3199 ...stores.map((store) => {
3200 var _a;
3201 const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
3202 if (!storeState) return;
3203 if (!PBFD2E7P_hasOwnProperty(storeState, key)) return;
3204 return sync(store, [key], (state2) => {
3205 setState(
3206 key,
3207 state2[key],
3208 // @ts-expect-error - Not public API. This is just to prevent
3209 // infinite loops.
3210 true
3211 );
3212 });
3213 })
3214 )
3215 );
3216 const teardowns = [];
3217 for (const setup2 of setups) {
3218 teardowns.push(setup2());
3219 }
3220 const cleanups = stores.map(init);
3221 destroy = chain(...desyncs, ...teardowns, ...cleanups);
3222 return maybeDestroy;
3223 };
3224 const sub = (keys, listener, set = listeners) => {
3225 set.add(listener);
3226 listenerKeys.set(listener, keys);
3227 return () => {
3228 var _a;
3229 (_a = disposables.get(listener)) == null ? void 0 : _a();
3230 disposables.delete(listener);
3231 listenerKeys.delete(listener);
3232 set.delete(listener);
3233 };
3234 };
3235 const storeSubscribe = (keys, listener) => sub(keys, listener);
3236 const storeSync = (keys, listener) => {
3237 disposables.set(listener, listener(state, state));
3238 return sub(keys, listener);
3239 };
3240 const storeBatch = (keys, listener) => {
3241 disposables.set(listener, listener(state, prevStateBatch));
3242 return sub(keys, listener, batchListeners);
3243 };
3244 const storePick = (keys) => createStore(pick(state, keys), finalStore);
3245 const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
3246 const getState = () => state;
3247 const setState = (key, value, fromStores = false) => {
3248 var _a;
3249 if (!PBFD2E7P_hasOwnProperty(state, key)) return;
3250 const nextValue = applyState(value, state[key]);
3251 if (nextValue === state[key]) return;
3252 if (!fromStores) {
3253 for (const store of stores) {
3254 (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
3255 }
3256 }
3257 const prevState = state;
3258 state = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, state), { [key]: nextValue });
3259 const thisUpdate = Symbol();
3260 lastUpdate = thisUpdate;
3261 updatedKeys.add(key);
3262 const run = (listener, prev, uKeys) => {
3263 var _a2;
3264 const keys = listenerKeys.get(listener);
3265 const updated = (k) => uKeys ? uKeys.has(k) : k === key;
3266 if (!keys || keys.some(updated)) {
3267 (_a2 = disposables.get(listener)) == null ? void 0 : _a2();
3268 disposables.set(listener, listener(state, prev));
3269 }
3270 };
3271 for (const listener of listeners) {
3272 run(listener, prevState);
3273 }
3274 queueMicrotask(() => {
3275 if (lastUpdate !== thisUpdate) return;
3276 const snapshot = state;
3277 for (const listener of batchListeners) {
3278 run(listener, prevStateBatch, updatedKeys);
3279 }
3280 prevStateBatch = snapshot;
3281 updatedKeys.clear();
3282 });
3283 };
3284 const finalStore = {
3285 getState,
3286 setState,
3287 __unstableInternals: {
3288 setup: storeSetup,
3289 init: storeInit,
3290 subscribe: storeSubscribe,
3291 sync: storeSync,
3292 batch: storeBatch,
3293 pick: storePick,
3294 omit: storeOmit
3295 }
3296 };
3297 return finalStore;
3298}
3299function setup(store, ...args) {
3300 if (!store) return;
3301 return getInternal(store, "setup")(...args);
3302}
3303function init(store, ...args) {
3304 if (!store) return;
3305 return getInternal(store, "init")(...args);
3306}
3307function subscribe(store, ...args) {
3308 if (!store) return;
3309 return getInternal(store, "subscribe")(...args);
3310}
3311function sync(store, ...args) {
3312 if (!store) return;
3313 return getInternal(store, "sync")(...args);
3314}
3315function batch(store, ...args) {
3316 if (!store) return;
3317 return getInternal(store, "batch")(...args);
3318}
3319function omit2(store, ...args) {
3320 if (!store) return;
3321 return getInternal(store, "omit")(...args);
3322}
3323function pick2(store, ...args) {
3324 if (!store) return;
3325 return getInternal(store, "pick")(...args);
3326}
3327function mergeStore(...stores) {
3328 const initialState = stores.reduce((state, store2) => {
3329 var _a;
3330 const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
3331 if (!nextState) return state;
3332 return Object.assign(state, nextState);
3333 }, {});
3334 const store = createStore(initialState, ...stores);
3335 return Object.assign({}, ...stores, store);
3336}
3337function throwOnConflictingProps(props, store) {
3338 if (true) return;
3339 if (!store) return;
3340 const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
3341 var _a;
3342 const stateKey = key.replace("default", "");
3343 return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
3344 });
3345 if (!defaultKeys.length) return;
3346 const storeState = store.getState();
3347 const conflictingProps = defaultKeys.filter(
3348 (key) => PBFD2E7P_hasOwnProperty(storeState, key)
3349 );
3350 if (!conflictingProps.length) return;
3351 throw new Error(
3352 `Passing a store prop in conjunction with a default state is not supported.
3353
3354const store = useSelectStore();
3355<SelectProvider store={store} defaultValue="Apple" />
3356 ^ ^
3357
3358Instead, pass the default state to the topmost store:
3359
3360const store = useSelectStore({ defaultValue: "Apple" });
3361<SelectProvider store={store} />
3362
3363See https://github.com/ariakit/ariakit/pull/2745 for more details.
3364
3365If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
3366`
3367 );
3368}
3369
3370
3371
3372// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js
3373var shim = __webpack_require__(422);
3374;// ./node_modules/@ariakit/react-core/esm/__chunks/YV4JVR4I.js
3375"use client";
3376
3377
3378
3379// src/utils/store.tsx
3380
3381
3382
3383
3384var { useSyncExternalStore } = shim;
3385var noopSubscribe = () => () => {
3386};
3387function useStoreState(store, keyOrSelector = identity) {
3388 const storeSubscribe = external_React_.useCallback(
3389 (callback) => {
3390 if (!store) return noopSubscribe();
3391 return subscribe(store, null, callback);
3392 },
3393 [store]
3394 );
3395 const getSnapshot = () => {
3396 const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
3397 const selector = typeof keyOrSelector === "function" ? keyOrSelector : null;
3398 const state = store == null ? void 0 : store.getState();
3399 if (selector) return selector(state);
3400 if (!state) return;
3401 if (!key) return;
3402 if (!PBFD2E7P_hasOwnProperty(state, key)) return;
3403 return state[key];
3404 };
3405 return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
3406}
3407function useStoreStateObject(store, object) {
3408 const objRef = external_React_.useRef(
3409 {}
3410 );
3411 const storeSubscribe = external_React_.useCallback(
3412 (callback) => {
3413 if (!store) return noopSubscribe();
3414 return subscribe(store, null, callback);
3415 },
3416 [store]
3417 );
3418 const getSnapshot = () => {
3419 const state = store == null ? void 0 : store.getState();
3420 let updated = false;
3421 const obj = objRef.current;
3422 for (const prop in object) {
3423 const keyOrSelector = object[prop];
3424 if (typeof keyOrSelector === "function") {
3425 const value = keyOrSelector(state);
3426 if (value !== obj[prop]) {
3427 obj[prop] = value;
3428 updated = true;
3429 }
3430 }
3431 if (typeof keyOrSelector === "string") {
3432 if (!state) continue;
3433 if (!PBFD2E7P_hasOwnProperty(state, keyOrSelector)) continue;
3434 const value = state[keyOrSelector];
3435 if (value !== obj[prop]) {
3436 obj[prop] = value;
3437 updated = true;
3438 }
3439 }
3440 }
3441 if (updated) {
3442 objRef.current = _3YLGPPWQ_spreadValues({}, obj);
3443 }
3444 return objRef.current;
3445 };
3446 return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
3447}
3448function useStoreProps(store, props, key, setKey) {
3449 const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0;
3450 const setValue = setKey ? props[setKey] : void 0;
3451 const propsRef = useLiveRef({ value, setValue });
3452 useSafeLayoutEffect(() => {
3453 return sync(store, [key], (state, prev) => {
3454 const { value: value2, setValue: setValue2 } = propsRef.current;
3455 if (!setValue2) return;
3456 if (state[key] === prev[key]) return;
3457 if (state[key] === value2) return;
3458 setValue2(state[key]);
3459 });
3460 }, [store, key]);
3461 useSafeLayoutEffect(() => {
3462 if (value === void 0) return;
3463 store.setState(key, value);
3464 return batch(store, [key], () => {
3465 if (value === void 0) return;
3466 store.setState(key, value);
3467 });
3468 });
3469}
3470function YV4JVR4I_useStore(createStore, props) {
3471 const [store, setStore] = external_React_.useState(() => createStore(props));
3472 useSafeLayoutEffect(() => init(store), [store]);
3473 const useState2 = external_React_.useCallback(
3474 (keyOrSelector) => useStoreState(store, keyOrSelector),
3475 [store]
3476 );
3477 const memoizedStore = external_React_.useMemo(
3478 () => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { useState: useState2 }),
3479 [store, useState2]
3480 );
3481 const updateStore = useEvent(() => {
3482 setStore((store2) => createStore(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, props), store2.getState())));
3483 });
3484 return [memoizedStore, updateStore];
3485}
3486
3487
3488
3489;// ./node_modules/@ariakit/react-core/esm/__chunks/C3IKGW5T.js
3490"use client";
3491
3492
3493
3494// src/collection/collection-store.ts
3495
3496function useCollectionStoreProps(store, update, props) {
3497 useUpdateEffect(update, [props.store]);
3498 useStoreProps(store, props, "items", "setItems");
3499 return store;
3500}
3501function useCollectionStore(props = {}) {
3502 const [store, update] = useStore(Core.createCollectionStore, props);
3503 return useCollectionStoreProps(store, update, props);
3504}
3505
3506
3507
3508;// ./node_modules/@ariakit/core/esm/__chunks/CYQWQL4J.js
3509"use client";
3510
3511
3512
3513
3514
3515// src/collection/collection-store.ts
3516function getCommonParent(items) {
3517 var _a;
3518 const firstItem = items.find((item) => !!item.element);
3519 const lastItem = [...items].reverse().find((item) => !!item.element);
3520 let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;
3521 while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {
3522 const parent = parentElement;
3523 if (lastItem && parent.contains(lastItem.element)) {
3524 return parentElement;
3525 }
3526 parentElement = parentElement.parentElement;
3527 }
3528 return getDocument(parentElement).body;
3529}
3530function getPrivateStore(store) {
3531 return store == null ? void 0 : store.__unstablePrivateStore;
3532}
3533function createCollectionStore(props = {}) {
3534 var _a;
3535 throwOnConflictingProps(props, props.store);
3536 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
3537 const items = defaultValue(
3538 props.items,
3539 syncState == null ? void 0 : syncState.items,
3540 props.defaultItems,
3541 []
3542 );
3543 const itemsMap = new Map(items.map((item) => [item.id, item]));
3544 const initialState = {
3545 items,
3546 renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])
3547 };
3548 const syncPrivateStore = getPrivateStore(props.store);
3549 const privateStore = createStore(
3550 { items, renderedItems: initialState.renderedItems },
3551 syncPrivateStore
3552 );
3553 const collection = createStore(initialState, props.store);
3554 const sortItems = (renderedItems) => {
3555 const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);
3556 privateStore.setState("renderedItems", sortedItems);
3557 collection.setState("renderedItems", sortedItems);
3558 };
3559 setup(collection, () => init(privateStore));
3560 setup(privateStore, () => {
3561 return batch(privateStore, ["items"], (state) => {
3562 collection.setState("items", state.items);
3563 });
3564 });
3565 setup(privateStore, () => {
3566 return batch(privateStore, ["renderedItems"], (state) => {
3567 let firstRun = true;
3568 let raf = requestAnimationFrame(() => {
3569 const { renderedItems } = collection.getState();
3570 if (state.renderedItems === renderedItems) return;
3571 sortItems(state.renderedItems);
3572 });
3573 if (typeof IntersectionObserver !== "function") {
3574 return () => cancelAnimationFrame(raf);
3575 }
3576 const ioCallback = () => {
3577 if (firstRun) {
3578 firstRun = false;
3579 return;
3580 }
3581 cancelAnimationFrame(raf);
3582 raf = requestAnimationFrame(() => sortItems(state.renderedItems));
3583 };
3584 const root = getCommonParent(state.renderedItems);
3585 const observer = new IntersectionObserver(ioCallback, { root });
3586 for (const item of state.renderedItems) {
3587 if (!item.element) continue;
3588 observer.observe(item.element);
3589 }
3590 return () => {
3591 cancelAnimationFrame(raf);
3592 observer.disconnect();
3593 };
3594 });
3595 });
3596 const mergeItem = (item, setItems, canDeleteFromMap = false) => {
3597 let prevItem;
3598 setItems((items2) => {
3599 const index = items2.findIndex(({ id }) => id === item.id);
3600 const nextItems = items2.slice();
3601 if (index !== -1) {
3602 prevItem = items2[index];
3603 const nextItem = _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, prevItem), item);
3604 nextItems[index] = nextItem;
3605 itemsMap.set(item.id, nextItem);
3606 } else {
3607 nextItems.push(item);
3608 itemsMap.set(item.id, item);
3609 }
3610 return nextItems;
3611 });
3612 const unmergeItem = () => {
3613 setItems((items2) => {
3614 if (!prevItem) {
3615 if (canDeleteFromMap) {
3616 itemsMap.delete(item.id);
3617 }
3618 return items2.filter(({ id }) => id !== item.id);
3619 }
3620 const index = items2.findIndex(({ id }) => id === item.id);
3621 if (index === -1) return items2;
3622 const nextItems = items2.slice();
3623 nextItems[index] = prevItem;
3624 itemsMap.set(item.id, prevItem);
3625 return nextItems;
3626 });
3627 };
3628 return unmergeItem;
3629 };
3630 const registerItem = (item) => mergeItem(
3631 item,
3632 (getItems) => privateStore.setState("items", getItems),
3633 true
3634 );
3635 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection), {
3636 registerItem,
3637 renderItem: (item) => chain(
3638 registerItem(item),
3639 mergeItem(
3640 item,
3641 (getItems) => privateStore.setState("renderedItems", getItems)
3642 )
3643 ),
3644 item: (id) => {
3645 if (!id) return null;
3646 let item = itemsMap.get(id);
3647 if (!item) {
3648 const { items: items2 } = privateStore.getState();
3649 item = items2.find((item2) => item2.id === id);
3650 if (item) {
3651 itemsMap.set(id, item);
3652 }
3653 }
3654 return item || null;
3655 },
3656 // @ts-expect-error Internal
3657 __unstablePrivateStore: privateStore
3658 });
3659}
3660
3661
3662
3663;// ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js
3664"use client";
3665
3666// src/utils/array.ts
3667function toArray(arg) {
3668 if (Array.isArray(arg)) {
3669 return arg;
3670 }
3671 return typeof arg !== "undefined" ? [arg] : [];
3672}
3673function addItemToArray(array, item, index = -1) {
3674 if (!(index in array)) {
3675 return [...array, item];
3676 }
3677 return [...array.slice(0, index), item, ...array.slice(index)];
3678}
3679function flatten2DArray(array) {
3680 const flattened = [];
3681 for (const row of array) {
3682 flattened.push(...row);
3683 }
3684 return flattened;
3685}
3686function reverseArray(array) {
3687 return array.slice().reverse();
3688}
3689
3690
3691
3692;// ./node_modules/@ariakit/core/esm/__chunks/AJZ4BYF3.js
3693"use client";
3694
3695
3696
3697
3698
3699
3700// src/composite/composite-store.ts
3701var NULL_ITEM = { id: null };
3702function findFirstEnabledItem(items, excludeId) {
3703 return items.find((item) => {
3704 if (excludeId) {
3705 return !item.disabled && item.id !== excludeId;
3706 }
3707 return !item.disabled;
3708 });
3709}
3710function getEnabledItems(items, excludeId) {
3711 return items.filter((item) => {
3712 if (excludeId) {
3713 return !item.disabled && item.id !== excludeId;
3714 }
3715 return !item.disabled;
3716 });
3717}
3718function getItemsInRow(items, rowId) {
3719 return items.filter((item) => item.rowId === rowId);
3720}
3721function flipItems(items, activeId, shouldInsertNullItem = false) {
3722 const index = items.findIndex((item) => item.id === activeId);
3723 return [
3724 ...items.slice(index + 1),
3725 ...shouldInsertNullItem ? [NULL_ITEM] : [],
3726 ...items.slice(0, index)
3727 ];
3728}
3729function groupItemsByRows(items) {
3730 const rows = [];
3731 for (const item of items) {
3732 const row = rows.find((currentRow) => {
3733 var _a;
3734 return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
3735 });
3736 if (row) {
3737 row.push(item);
3738 } else {
3739 rows.push([item]);
3740 }
3741 }
3742 return rows;
3743}
3744function getMaxRowLength(array) {
3745 let maxLength = 0;
3746 for (const { length } of array) {
3747 if (length > maxLength) {
3748 maxLength = length;
3749 }
3750 }
3751 return maxLength;
3752}
3753function createEmptyItem(rowId) {
3754 return {
3755 id: "__EMPTY_ITEM__",
3756 disabled: true,
3757 rowId
3758 };
3759}
3760function normalizeRows(rows, activeId, focusShift) {
3761 const maxLength = getMaxRowLength(rows);
3762 for (const row of rows) {
3763 for (let i = 0; i < maxLength; i += 1) {
3764 const item = row[i];
3765 if (!item || focusShift && item.disabled) {
3766 const isFirst = i === 0;
3767 const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1];
3768 row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
3769 }
3770 }
3771 }
3772 return rows;
3773}
3774function verticalizeItems(items) {
3775 const rows = groupItemsByRows(items);
3776 const maxLength = getMaxRowLength(rows);
3777 const verticalized = [];
3778 for (let i = 0; i < maxLength; i += 1) {
3779 for (const row of rows) {
3780 const item = row[i];
3781 if (item) {
3782 verticalized.push(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, item), {
3783 // If there's no rowId, it means that it's not a grid composite, but
3784 // a single row instead. So, instead of verticalizing it, that is,
3785 // assigning a different rowId based on the column index, we keep it
3786 // undefined so they will be part of the same row. This is useful
3787 // when using up/down on one-dimensional composites.
3788 rowId: item.rowId ? `${i}` : void 0
3789 }));
3790 }
3791 }
3792 }
3793 return verticalized;
3794}
3795function createCompositeStore(props = {}) {
3796 var _a;
3797 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
3798 const collection = createCollectionStore(props);
3799 const activeId = defaultValue(
3800 props.activeId,
3801 syncState == null ? void 0 : syncState.activeId,
3802 props.defaultActiveId
3803 );
3804 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), {
3805 id: defaultValue(
3806 props.id,
3807 syncState == null ? void 0 : syncState.id,
3808 `id-${Math.random().toString(36).slice(2, 8)}`
3809 ),
3810 activeId,
3811 baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
3812 includesBaseElement: defaultValue(
3813 props.includesBaseElement,
3814 syncState == null ? void 0 : syncState.includesBaseElement,
3815 activeId === null
3816 ),
3817 moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),
3818 orientation: defaultValue(
3819 props.orientation,
3820 syncState == null ? void 0 : syncState.orientation,
3821 "both"
3822 ),
3823 rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
3824 virtualFocus: defaultValue(
3825 props.virtualFocus,
3826 syncState == null ? void 0 : syncState.virtualFocus,
3827 false
3828 ),
3829 focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
3830 focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
3831 focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
3832 });
3833 const composite = createStore(initialState, collection, props.store);
3834 setup(
3835 composite,
3836 () => sync(composite, ["renderedItems", "activeId"], (state) => {
3837 composite.setState("activeId", (activeId2) => {
3838 var _a2;
3839 if (activeId2 !== void 0) return activeId2;
3840 return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
3841 });
3842 })
3843 );
3844 const getNextId = (direction = "next", options = {}) => {
3845 var _a2, _b;
3846 const defaultState = composite.getState();
3847 const {
3848 skip = 0,
3849 activeId: activeId2 = defaultState.activeId,
3850 focusShift = defaultState.focusShift,
3851 focusLoop = defaultState.focusLoop,
3852 focusWrap = defaultState.focusWrap,
3853 includesBaseElement = defaultState.includesBaseElement,
3854 renderedItems = defaultState.renderedItems,
3855 rtl = defaultState.rtl
3856 } = options;
3857 const isVerticalDirection = direction === "up" || direction === "down";
3858 const isNextDirection = direction === "next" || direction === "down";
3859 const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
3860 const canShift = focusShift && !skip;
3861 let items = !isVerticalDirection ? renderedItems : flatten2DArray(
3862 normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
3863 );
3864 items = canReverse ? reverseArray(items) : items;
3865 items = isVerticalDirection ? verticalizeItems(items) : items;
3866 if (activeId2 == null) {
3867 return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
3868 }
3869 const activeItem = items.find((item) => item.id === activeId2);
3870 if (!activeItem) {
3871 return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
3872 }
3873 const isGrid = items.some((item) => item.rowId);
3874 const activeIndex = items.indexOf(activeItem);
3875 const nextItems = items.slice(activeIndex + 1);
3876 const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
3877 if (skip) {
3878 const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
3879 const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
3880 nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
3881 return nextItem2 == null ? void 0 : nextItem2.id;
3882 }
3883 const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
3884 const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
3885 const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
3886 if (canLoop) {
3887 const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
3888 const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
3889 const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
3890 return nextItem2 == null ? void 0 : nextItem2.id;
3891 }
3892 if (canWrap) {
3893 const nextItem2 = findFirstEnabledItem(
3894 // We can use nextItems, which contains all the next items, including
3895 // items from other rows, to wrap between rows. However, if there is a
3896 // null item (the composite container), we'll only use the next items in
3897 // the row. So moving next from the last item will focus on the
3898 // composite container. On grid composites, horizontal navigation never
3899 // focuses on the composite container, only vertical.
3900 hasNullItem ? nextItemsInRow : nextItems,
3901 activeId2
3902 );
3903 const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
3904 return nextId;
3905 }
3906 const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2);
3907 if (!nextItem && hasNullItem) {
3908 return null;
3909 }
3910 return nextItem == null ? void 0 : nextItem.id;
3911 };
3912 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, collection), composite), {
3913 setBaseElement: (element) => composite.setState("baseElement", element),
3914 setActiveId: (id) => composite.setState("activeId", id),
3915 move: (id) => {
3916 if (id === void 0) return;
3917 composite.setState("activeId", id);
3918 composite.setState("moves", (moves) => moves + 1);
3919 },
3920 first: () => {
3921 var _a2;
3922 return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
3923 },
3924 last: () => {
3925 var _a2;
3926 return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
3927 },
3928 next: (options) => {
3929 if (options !== void 0 && typeof options === "number") {
3930 options = { skip: options };
3931 }
3932 return getNextId("next", options);
3933 },
3934 previous: (options) => {
3935 if (options !== void 0 && typeof options === "number") {
3936 options = { skip: options };
3937 }
3938 return getNextId("previous", options);
3939 },
3940 down: (options) => {
3941 if (options !== void 0 && typeof options === "number") {
3942 options = { skip: options };
3943 }
3944 return getNextId("down", options);
3945 },
3946 up: (options) => {
3947 if (options !== void 0 && typeof options === "number") {
3948 options = { skip: options };
3949 }
3950 return getNextId("up", options);
3951 }
3952 });
3953}
3954
3955
3956
3957;// ./node_modules/@ariakit/react-core/esm/__chunks/4CMBR7SL.js
3958"use client";
3959
3960
3961
3962
3963
3964// src/composite/composite-store.ts
3965
3966function useCompositeStoreOptions(props) {
3967 const id = useId(props.id);
3968 return _3YLGPPWQ_spreadValues({ id }, props);
3969}
3970function useCompositeStoreProps(store, update, props) {
3971 store = useCollectionStoreProps(store, update, props);
3972 useStoreProps(store, props, "activeId", "setActiveId");
3973 useStoreProps(store, props, "includesBaseElement");
3974 useStoreProps(store, props, "virtualFocus");
3975 useStoreProps(store, props, "orientation");
3976 useStoreProps(store, props, "rtl");
3977 useStoreProps(store, props, "focusLoop");
3978 useStoreProps(store, props, "focusWrap");
3979 useStoreProps(store, props, "focusShift");
3980 return store;
3981}
3982function useCompositeStore(props = {}) {
3983 props = useCompositeStoreOptions(props);
3984 const [store, update] = YV4JVR4I_useStore(createCompositeStore, props);
3985 return useCompositeStoreProps(store, update, props);
3986}
3987
3988
3989
3990;// ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js
3991"use client";
3992
3993// src/composite/utils.ts
3994
3995var _5VQZOHHZ_NULL_ITEM = { id: null };
3996function _5VQZOHHZ_flipItems(items, activeId, shouldInsertNullItem = false) {
3997 const index = items.findIndex((item) => item.id === activeId);
3998 return [
3999 ...items.slice(index + 1),
4000 ...shouldInsertNullItem ? [_5VQZOHHZ_NULL_ITEM] : [],
4001 ...items.slice(0, index)
4002 ];
4003}
4004function _5VQZOHHZ_findFirstEnabledItem(items, excludeId) {
4005 return items.find((item) => {
4006 if (excludeId) {
4007 return !item.disabled && item.id !== excludeId;
4008 }
4009 return !item.disabled;
4010 });
4011}
4012function getEnabledItem(store, id) {
4013 if (!id) return null;
4014 return store.item(id) || null;
4015}
4016function _5VQZOHHZ_groupItemsByRows(items) {
4017 const rows = [];
4018 for (const item of items) {
4019 const row = rows.find((currentRow) => {
4020 var _a;
4021 return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
4022 });
4023 if (row) {
4024 row.push(item);
4025 } else {
4026 rows.push([item]);
4027 }
4028 }
4029 return rows;
4030}
4031function selectTextField(element, collapseToEnd = false) {
4032 if (isTextField(element)) {
4033 element.setSelectionRange(
4034 collapseToEnd ? element.value.length : 0,
4035 element.value.length
4036 );
4037 } else if (element.isContentEditable) {
4038 const selection = getDocument(element).getSelection();
4039 selection == null ? void 0 : selection.selectAllChildren(element);
4040 if (collapseToEnd) {
4041 selection == null ? void 0 : selection.collapseToEnd();
4042 }
4043 }
4044}
4045var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY");
4046function focusSilently(element) {
4047 element[FOCUS_SILENTLY] = true;
4048 element.focus({ preventScroll: true });
4049}
4050function silentlyFocused(element) {
4051 const isSilentlyFocused = element[FOCUS_SILENTLY];
4052 delete element[FOCUS_SILENTLY];
4053 return isSilentlyFocused;
4054}
4055function isItem(store, element, exclude) {
4056 if (!element) return false;
4057 if (element === exclude) return false;
4058 const item = store.item(element.id);
4059 if (!item) return false;
4060 if (exclude && item.element === exclude) return false;
4061 return true;
4062}
4063
4064
4065
4066;// external "ReactJSXRuntime"
4067const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
4068;// ./node_modules/@ariakit/react-core/esm/__chunks/LMDWO4NN.js
4069"use client";
4070
4071
4072
4073
4074// src/utils/system.tsx
4075
4076
4077function forwardRef2(render) {
4078 const Role = external_React_.forwardRef((props, ref) => render(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref })));
4079 Role.displayName = render.displayName || render.name;
4080 return Role;
4081}
4082function memo2(Component, propsAreEqual) {
4083 return external_React_.memo(Component, propsAreEqual);
4084}
4085function LMDWO4NN_createElement(Type, props) {
4086 const _a = props, { wrapElement, render } = _a, rest = __objRest(_a, ["wrapElement", "render"]);
4087 const mergedRef = useMergeRefs(props.ref, getRefProperty(render));
4088 let element;
4089 if (external_React_.isValidElement(render)) {
4090 const renderProps = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, render.props), { ref: mergedRef });
4091 element = external_React_.cloneElement(render, mergeProps(rest, renderProps));
4092 } else if (render) {
4093 element = render(rest);
4094 } else {
4095 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _3YLGPPWQ_spreadValues({}, rest));
4096 }
4097 if (wrapElement) {
4098 return wrapElement(element);
4099 }
4100 return element;
4101}
4102function createHook(useProps) {
4103 const useRole = (props = {}) => {
4104 return useProps(props);
4105 };
4106 useRole.displayName = useProps.name;
4107 return useRole;
4108}
4109function createStoreContext(providers = [], scopedProviders = []) {
4110 const context = external_React_.createContext(void 0);
4111 const scopedContext = external_React_.createContext(void 0);
4112 const useContext2 = () => external_React_.useContext(context);
4113 const useScopedContext = (onlyScoped = false) => {
4114 const scoped = external_React_.useContext(scopedContext);
4115 const store = useContext2();
4116 if (onlyScoped) return scoped;
4117 return scoped || store;
4118 };
4119 const useProviderContext = () => {
4120 const scoped = external_React_.useContext(scopedContext);
4121 const store = useContext2();
4122 if (scoped && scoped === store) return;
4123 return store;
4124 };
4125 const ContextProvider = (props) => {
4126 return providers.reduceRight(
4127 (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
4128 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _3YLGPPWQ_spreadValues({}, props))
4129 );
4130 };
4131 const ScopedContextProvider = (props) => {
4132 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children: scopedProviders.reduceRight(
4133 (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })),
4134 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _3YLGPPWQ_spreadValues({}, props))
4135 ) }));
4136 };
4137 return {
4138 context,
4139 scopedContext,
4140 useContext: useContext2,
4141 useScopedContext,
4142 useProviderContext,
4143 ContextProvider,
4144 ScopedContextProvider
4145 };
4146}
4147
4148
4149
4150;// ./node_modules/@ariakit/react-core/esm/__chunks/VDHZ5F7K.js
4151"use client";
4152
4153
4154// src/collection/collection-context.tsx
4155var ctx = createStoreContext();
4156var useCollectionContext = ctx.useContext;
4157var useCollectionScopedContext = ctx.useScopedContext;
4158var useCollectionProviderContext = ctx.useProviderContext;
4159var CollectionContextProvider = ctx.ContextProvider;
4160var CollectionScopedContextProvider = ctx.ScopedContextProvider;
4161
4162
4163
4164;// ./node_modules/@ariakit/react-core/esm/__chunks/P7GR5CS5.js
4165"use client";
4166
4167
4168
4169// src/composite/composite-context.tsx
4170
4171var P7GR5CS5_ctx = createStoreContext(
4172 [CollectionContextProvider],
4173 [CollectionScopedContextProvider]
4174);
4175var useCompositeContext = P7GR5CS5_ctx.useContext;
4176var useCompositeScopedContext = P7GR5CS5_ctx.useScopedContext;
4177var useCompositeProviderContext = P7GR5CS5_ctx.useProviderContext;
4178var CompositeContextProvider = P7GR5CS5_ctx.ContextProvider;
4179var CompositeScopedContextProvider = P7GR5CS5_ctx.ScopedContextProvider;
4180var CompositeItemContext = (0,external_React_.createContext)(
4181 void 0
4182);
4183var CompositeRowContext = (0,external_React_.createContext)(
4184 void 0
4185);
4186
4187
4188
4189;// ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js
4190"use client";
4191
4192// src/focusable/focusable-context.tsx
4193
4194var FocusableContext = (0,external_React_.createContext)(true);
4195
4196
4197
4198;// ./node_modules/@ariakit/core/esm/utils/focus.js
4199"use client";
4200
4201
4202
4203// src/utils/focus.ts
4204var 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'])";
4205function hasNegativeTabIndex(element) {
4206 const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
4207 return tabIndex < 0;
4208}
4209function isFocusable(element) {
4210 if (!element.matches(selector)) return false;
4211 if (!isVisible(element)) return false;
4212 if (element.closest("[inert]")) return false;
4213 return true;
4214}
4215function isTabbable(element) {
4216 if (!isFocusable(element)) return false;
4217 if (hasNegativeTabIndex(element)) return false;
4218 if (!("form" in element)) return true;
4219 if (!element.form) return true;
4220 if (element.checked) return true;
4221 if (element.type !== "radio") return true;
4222 const radioGroup = element.form.elements.namedItem(element.name);
4223 if (!radioGroup) return true;
4224 if (!("length" in radioGroup)) return true;
4225 const activeElement = getActiveElement(element);
4226 if (!activeElement) return true;
4227 if (activeElement === element) return true;
4228 if (!("form" in activeElement)) return true;
4229 if (activeElement.form !== element.form) return true;
4230 if (activeElement.name !== element.name) return true;
4231 return false;
4232}
4233function getAllFocusableIn(container, includeContainer) {
4234 const elements = Array.from(
4235 container.querySelectorAll(selector)
4236 );
4237 if (includeContainer) {
4238 elements.unshift(container);
4239 }
4240 const focusableElements = elements.filter(isFocusable);
4241 focusableElements.forEach((element, i) => {
4242 if (isFrame(element) && element.contentDocument) {
4243 const frameBody = element.contentDocument.body;
4244 focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
4245 }
4246 });
4247 return focusableElements;
4248}
4249function getAllFocusable(includeBody) {
4250 return getAllFocusableIn(document.body, includeBody);
4251}
4252function getFirstFocusableIn(container, includeContainer) {
4253 const [first] = getAllFocusableIn(container, includeContainer);
4254 return first || null;
4255}
4256function getFirstFocusable(includeBody) {
4257 return getFirstFocusableIn(document.body, includeBody);
4258}
4259function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
4260 const elements = Array.from(
4261 container.querySelectorAll(selector)
4262 );
4263 const tabbableElements = elements.filter(isTabbable);
4264 if (includeContainer && isTabbable(container)) {
4265 tabbableElements.unshift(container);
4266 }
4267 tabbableElements.forEach((element, i) => {
4268 if (isFrame(element) && element.contentDocument) {
4269 const frameBody = element.contentDocument.body;
4270 const allFrameTabbable = getAllTabbableIn(
4271 frameBody,
4272 false,
4273 fallbackToFocusable
4274 );
4275 tabbableElements.splice(i, 1, ...allFrameTabbable);
4276 }
4277 });
4278 if (!tabbableElements.length && fallbackToFocusable) {
4279 return elements;
4280 }
4281 return tabbableElements;
4282}
4283function getAllTabbable(fallbackToFocusable) {
4284 return getAllTabbableIn(document.body, false, fallbackToFocusable);
4285}
4286function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
4287 const [first] = getAllTabbableIn(
4288 container,
4289 includeContainer,
4290 fallbackToFocusable
4291 );
4292 return first || null;
4293}
4294function getFirstTabbable(fallbackToFocusable) {
4295 return getFirstTabbableIn(document.body, false, fallbackToFocusable);
4296}
4297function getLastTabbableIn(container, includeContainer, fallbackToFocusable) {
4298 const allTabbable = getAllTabbableIn(
4299 container,
4300 includeContainer,
4301 fallbackToFocusable
4302 );
4303 return allTabbable[allTabbable.length - 1] || null;
4304}
4305function getLastTabbable(fallbackToFocusable) {
4306 return getLastTabbableIn(document.body, false, fallbackToFocusable);
4307}
4308function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
4309 const activeElement = getActiveElement(container);
4310 const allFocusable = getAllFocusableIn(container, includeContainer);
4311 const activeIndex = allFocusable.indexOf(activeElement);
4312 const nextFocusableElements = allFocusable.slice(activeIndex + 1);
4313 return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null;
4314}
4315function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
4316 return getNextTabbableIn(
4317 document.body,
4318 false,
4319 fallbackToFirst,
4320 fallbackToFocusable
4321 );
4322}
4323function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
4324 const activeElement = getActiveElement(container);
4325 const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
4326 const activeIndex = allFocusable.indexOf(activeElement);
4327 const previousFocusableElements = allFocusable.slice(activeIndex + 1);
4328 return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null;
4329}
4330function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
4331 return getPreviousTabbableIn(
4332 document.body,
4333 false,
4334 fallbackToFirst,
4335 fallbackToFocusable
4336 );
4337}
4338function getClosestFocusable(element) {
4339 while (element && !isFocusable(element)) {
4340 element = element.closest(selector);
4341 }
4342 return element || null;
4343}
4344function hasFocus(element) {
4345 const activeElement = getActiveElement(element);
4346 if (!activeElement) return false;
4347 if (activeElement === element) return true;
4348 const activeDescendant = activeElement.getAttribute("aria-activedescendant");
4349 if (!activeDescendant) return false;
4350 return activeDescendant === element.id;
4351}
4352function hasFocusWithin(element) {
4353 const activeElement = getActiveElement(element);
4354 if (!activeElement) return false;
4355 if (contains(element, activeElement)) return true;
4356 const activeDescendant = activeElement.getAttribute("aria-activedescendant");
4357 if (!activeDescendant) return false;
4358 if (!("id" in element)) return false;
4359 if (activeDescendant === element.id) return true;
4360 return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
4361}
4362function focusIfNeeded(element) {
4363 if (!hasFocusWithin(element) && isFocusable(element)) {
4364 element.focus();
4365 }
4366}
4367function disableFocus(element) {
4368 var _a;
4369 const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
4370 element.setAttribute("data-tabindex", currentTabindex);
4371 element.setAttribute("tabindex", "-1");
4372}
4373function disableFocusIn(container, includeContainer) {
4374 const tabbableElements = getAllTabbableIn(container, includeContainer);
4375 for (const element of tabbableElements) {
4376 disableFocus(element);
4377 }
4378}
4379function restoreFocusIn(container) {
4380 const elements = container.querySelectorAll("[data-tabindex]");
4381 const restoreTabIndex = (element) => {
4382 const tabindex = element.getAttribute("data-tabindex");
4383 element.removeAttribute("data-tabindex");
4384 if (tabindex) {
4385 element.setAttribute("tabindex", tabindex);
4386 } else {
4387 element.removeAttribute("tabindex");
4388 }
4389 };
4390 if (container.hasAttribute("data-tabindex")) {
4391 restoreTabIndex(container);
4392 }
4393 for (const element of elements) {
4394 restoreTabIndex(element);
4395 }
4396}
4397function focusIntoView(element, options) {
4398 if (!("scrollIntoView" in element)) {
4399 element.focus();
4400 } else {
4401 element.focus({ preventScroll: true });
4402 element.scrollIntoView(_chunks_3YLGPPWQ_spreadValues({ block: "nearest", inline: "nearest" }, options));
4403 }
4404}
4405
4406
4407;// ./node_modules/@ariakit/react-core/esm/__chunks/LVA2YJMS.js
4408"use client";
4409
4410
4411
4412
4413
4414// src/focusable/focusable.tsx
4415
4416
4417
4418
4419
4420
4421var TagName = "div";
4422var isSafariBrowser = isSafari();
4423var alwaysFocusVisibleInputTypes = [
4424 "text",
4425 "search",
4426 "url",
4427 "tel",
4428 "email",
4429 "password",
4430 "number",
4431 "date",
4432 "month",
4433 "week",
4434 "time",
4435 "datetime",
4436 "datetime-local"
4437];
4438var safariFocusAncestorSymbol = Symbol("safariFocusAncestor");
4439function isSafariFocusAncestor(element) {
4440 if (!element) return false;
4441 return !!element[safariFocusAncestorSymbol];
4442}
4443function markSafariFocusAncestor(element, value) {
4444 if (!element) return;
4445 element[safariFocusAncestorSymbol] = value;
4446}
4447function isAlwaysFocusVisible(element) {
4448 const { tagName, readOnly, type } = element;
4449 if (tagName === "TEXTAREA" && !readOnly) return true;
4450 if (tagName === "SELECT" && !readOnly) return true;
4451 if (tagName === "INPUT" && !readOnly) {
4452 return alwaysFocusVisibleInputTypes.includes(type);
4453 }
4454 if (element.isContentEditable) return true;
4455 const role = element.getAttribute("role");
4456 if (role === "combobox" && element.dataset.name) {
4457 return true;
4458 }
4459 return false;
4460}
4461function getLabels(element) {
4462 if ("labels" in element) {
4463 return element.labels;
4464 }
4465 return null;
4466}
4467function isNativeCheckboxOrRadio(element) {
4468 const tagName = element.tagName.toLowerCase();
4469 if (tagName === "input" && element.type) {
4470 return element.type === "radio" || element.type === "checkbox";
4471 }
4472 return false;
4473}
4474function isNativeTabbable(tagName) {
4475 if (!tagName) return true;
4476 return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
4477}
4478function supportsDisabledAttribute(tagName) {
4479 if (!tagName) return true;
4480 return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
4481}
4482function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
4483 if (!focusable) {
4484 return tabIndexProp;
4485 }
4486 if (trulyDisabled) {
4487 if (nativeTabbable && !supportsDisabled) {
4488 return -1;
4489 }
4490 return;
4491 }
4492 if (nativeTabbable) {
4493 return tabIndexProp;
4494 }
4495 return tabIndexProp || 0;
4496}
4497function useDisableEvent(onEvent, disabled) {
4498 return useEvent((event) => {
4499 onEvent == null ? void 0 : onEvent(event);
4500 if (event.defaultPrevented) return;
4501 if (disabled) {
4502 event.stopPropagation();
4503 event.preventDefault();
4504 }
4505 });
4506}
4507var isKeyboardModality = true;
4508function onGlobalMouseDown(event) {
4509 const target = event.target;
4510 if (target && "hasAttribute" in target) {
4511 if (!target.hasAttribute("data-focus-visible")) {
4512 isKeyboardModality = false;
4513 }
4514 }
4515}
4516function onGlobalKeyDown(event) {
4517 if (event.metaKey) return;
4518 if (event.ctrlKey) return;
4519 if (event.altKey) return;
4520 isKeyboardModality = true;
4521}
4522var useFocusable = createHook(
4523 function useFocusable2(_a) {
4524 var _b = _a, {
4525 focusable = true,
4526 accessibleWhenDisabled,
4527 autoFocus,
4528 onFocusVisible
4529 } = _b, props = __objRest(_b, [
4530 "focusable",
4531 "accessibleWhenDisabled",
4532 "autoFocus",
4533 "onFocusVisible"
4534 ]);
4535 const ref = (0,external_React_.useRef)(null);
4536 (0,external_React_.useEffect)(() => {
4537 if (!focusable) return;
4538 addGlobalEventListener("mousedown", onGlobalMouseDown, true);
4539 addGlobalEventListener("keydown", onGlobalKeyDown, true);
4540 }, [focusable]);
4541 if (isSafariBrowser) {
4542 (0,external_React_.useEffect)(() => {
4543 if (!focusable) return;
4544 const element = ref.current;
4545 if (!element) return;
4546 if (!isNativeCheckboxOrRadio(element)) return;
4547 const labels = getLabels(element);
4548 if (!labels) return;
4549 const onMouseUp = () => queueMicrotask(() => element.focus());
4550 for (const label of labels) {
4551 label.addEventListener("mouseup", onMouseUp);
4552 }
4553 return () => {
4554 for (const label of labels) {
4555 label.removeEventListener("mouseup", onMouseUp);
4556 }
4557 };
4558 }, [focusable]);
4559 }
4560 const disabled = focusable && disabledFromProps(props);
4561 const trulyDisabled = !!disabled && !accessibleWhenDisabled;
4562 const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false);
4563 (0,external_React_.useEffect)(() => {
4564 if (!focusable) return;
4565 if (trulyDisabled && focusVisible) {
4566 setFocusVisible(false);
4567 }
4568 }, [focusable, trulyDisabled, focusVisible]);
4569 (0,external_React_.useEffect)(() => {
4570 if (!focusable) return;
4571 if (!focusVisible) return;
4572 const element = ref.current;
4573 if (!element) return;
4574 if (typeof IntersectionObserver === "undefined") return;
4575 const observer = new IntersectionObserver(() => {
4576 if (!isFocusable(element)) {
4577 setFocusVisible(false);
4578 }
4579 });
4580 observer.observe(element);
4581 return () => observer.disconnect();
4582 }, [focusable, focusVisible]);
4583 const onKeyPressCapture = useDisableEvent(
4584 props.onKeyPressCapture,
4585 disabled
4586 );
4587 const onMouseDownCapture = useDisableEvent(
4588 props.onMouseDownCapture,
4589 disabled
4590 );
4591 const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
4592 const onMouseDownProp = props.onMouseDown;
4593 const onMouseDown = useEvent((event) => {
4594 onMouseDownProp == null ? void 0 : onMouseDownProp(event);
4595 if (event.defaultPrevented) return;
4596 if (!focusable) return;
4597 const element = event.currentTarget;
4598 if (!isSafariBrowser) return;
4599 if (isPortalEvent(event)) return;
4600 if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return;
4601 let receivedFocus = false;
4602 const onFocus = () => {
4603 receivedFocus = true;
4604 };
4605 const options = { capture: true, once: true };
4606 element.addEventListener("focusin", onFocus, options);
4607 const focusableContainer = getClosestFocusable(element.parentElement);
4608 markSafariFocusAncestor(focusableContainer, true);
4609 queueBeforeEvent(element, "mouseup", () => {
4610 element.removeEventListener("focusin", onFocus, true);
4611 markSafariFocusAncestor(focusableContainer, false);
4612 if (receivedFocus) return;
4613 focusIfNeeded(element);
4614 });
4615 });
4616 const handleFocusVisible = (event, currentTarget) => {
4617 if (currentTarget) {
4618 event.currentTarget = currentTarget;
4619 }
4620 if (!focusable) return;
4621 const element = event.currentTarget;
4622 if (!element) return;
4623 if (!hasFocus(element)) return;
4624 onFocusVisible == null ? void 0 : onFocusVisible(event);
4625 if (event.defaultPrevented) return;
4626 element.dataset.focusVisible = "true";
4627 setFocusVisible(true);
4628 };
4629 const onKeyDownCaptureProp = props.onKeyDownCapture;
4630 const onKeyDownCapture = useEvent((event) => {
4631 onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
4632 if (event.defaultPrevented) return;
4633 if (!focusable) return;
4634 if (focusVisible) return;
4635 if (event.metaKey) return;
4636 if (event.altKey) return;
4637 if (event.ctrlKey) return;
4638 if (!isSelfTarget(event)) return;
4639 const element = event.currentTarget;
4640 const applyFocusVisible = () => handleFocusVisible(event, element);
4641 queueBeforeEvent(element, "focusout", applyFocusVisible);
4642 });
4643 const onFocusCaptureProp = props.onFocusCapture;
4644 const onFocusCapture = useEvent((event) => {
4645 onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
4646 if (event.defaultPrevented) return;
4647 if (!focusable) return;
4648 if (!isSelfTarget(event)) {
4649 setFocusVisible(false);
4650 return;
4651 }
4652 const element = event.currentTarget;
4653 const applyFocusVisible = () => handleFocusVisible(event, element);
4654 if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
4655 queueBeforeEvent(event.target, "focusout", applyFocusVisible);
4656 } else {
4657 setFocusVisible(false);
4658 }
4659 });
4660 const onBlurProp = props.onBlur;
4661 const onBlur = useEvent((event) => {
4662 onBlurProp == null ? void 0 : onBlurProp(event);
4663 if (!focusable) return;
4664 if (!isFocusEventOutside(event)) return;
4665 setFocusVisible(false);
4666 });
4667 const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext);
4668 const autoFocusRef = useEvent((element) => {
4669 if (!focusable) return;
4670 if (!autoFocus) return;
4671 if (!element) return;
4672 if (!autoFocusOnShow) return;
4673 queueMicrotask(() => {
4674 if (hasFocus(element)) return;
4675 if (!isFocusable(element)) return;
4676 element.focus();
4677 });
4678 });
4679 const tagName = useTagName(ref);
4680 const nativeTabbable = focusable && isNativeTabbable(tagName);
4681 const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
4682 const styleProp = props.style;
4683 const style = (0,external_React_.useMemo)(() => {
4684 if (trulyDisabled) {
4685 return _3YLGPPWQ_spreadValues({ pointerEvents: "none" }, styleProp);
4686 }
4687 return styleProp;
4688 }, [trulyDisabled, styleProp]);
4689 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
4690 "data-focus-visible": focusable && focusVisible || void 0,
4691 "data-autofocus": autoFocus || void 0,
4692 "aria-disabled": disabled || void 0
4693 }, props), {
4694 ref: useMergeRefs(ref, autoFocusRef, props.ref),
4695 style,
4696 tabIndex: getTabIndex(
4697 focusable,
4698 trulyDisabled,
4699 nativeTabbable,
4700 supportsDisabled,
4701 props.tabIndex
4702 ),
4703 disabled: supportsDisabled && trulyDisabled ? true : void 0,
4704 // TODO: Test Focusable contentEditable.
4705 contentEditable: disabled ? void 0 : props.contentEditable,
4706 onKeyPressCapture,
4707 onClickCapture,
4708 onMouseDownCapture,
4709 onMouseDown,
4710 onKeyDownCapture,
4711 onFocusCapture,
4712 onBlur
4713 });
4714 return removeUndefinedValues(props);
4715 }
4716);
4717var Focusable = forwardRef2(function Focusable2(props) {
4718 const htmlProps = useFocusable(props);
4719 return LMDWO4NN_createElement(TagName, htmlProps);
4720});
4721
4722
4723
4724;// ./node_modules/@ariakit/react-core/esm/__chunks/ITI7HKP4.js
4725"use client";
4726
4727
4728
4729
4730
4731
4732
4733// src/composite/composite.tsx
4734
4735
4736
4737
4738
4739
4740
4741var ITI7HKP4_TagName = "div";
4742function isGrid(items) {
4743 return items.some((item) => !!item.rowId);
4744}
4745function isPrintableKey(event) {
4746 const target = event.target;
4747 if (target && !isTextField(target)) return false;
4748 return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
4749}
4750function isModifierKey(event) {
4751 return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
4752}
4753function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
4754 return useEvent((event) => {
4755 var _a;
4756 onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
4757 if (event.defaultPrevented) return;
4758 if (event.isPropagationStopped()) return;
4759 if (!isSelfTarget(event)) return;
4760 if (isModifierKey(event)) return;
4761 if (isPrintableKey(event)) return;
4762 const state = store.getState();
4763 const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element;
4764 if (!activeElement) return;
4765 const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]);
4766 const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
4767 if (activeElement !== previousElement) {
4768 activeElement.focus();
4769 }
4770 if (!fireKeyboardEvent(activeElement, event.type, eventInit)) {
4771 event.preventDefault();
4772 }
4773 if (event.currentTarget.contains(activeElement)) {
4774 event.stopPropagation();
4775 }
4776 });
4777}
4778function findFirstEnabledItemInTheLastRow(items) {
4779 return _5VQZOHHZ_findFirstEnabledItem(
4780 flatten2DArray(reverseArray(_5VQZOHHZ_groupItemsByRows(items)))
4781 );
4782}
4783function useScheduleFocus(store) {
4784 const [scheduled, setScheduled] = (0,external_React_.useState)(false);
4785 const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []);
4786 const activeItem = store.useState(
4787 (state) => getEnabledItem(store, state.activeId)
4788 );
4789 (0,external_React_.useEffect)(() => {
4790 const activeElement = activeItem == null ? void 0 : activeItem.element;
4791 if (!scheduled) return;
4792 if (!activeElement) return;
4793 setScheduled(false);
4794 activeElement.focus({ preventScroll: true });
4795 }, [activeItem, scheduled]);
4796 return schedule;
4797}
4798var useComposite = createHook(
4799 function useComposite2(_a) {
4800 var _b = _a, {
4801 store,
4802 composite = true,
4803 focusOnMove = composite,
4804 moveOnKeyPress = true
4805 } = _b, props = __objRest(_b, [
4806 "store",
4807 "composite",
4808 "focusOnMove",
4809 "moveOnKeyPress"
4810 ]);
4811 const context = useCompositeProviderContext();
4812 store = store || context;
4813 invariant(
4814 store,
4815 false && 0
4816 );
4817 const ref = (0,external_React_.useRef)(null);
4818 const previousElementRef = (0,external_React_.useRef)(null);
4819 const scheduleFocus = useScheduleFocus(store);
4820 const moves = store.useState("moves");
4821 const [, setBaseElement] = useTransactionState(
4822 composite ? store.setBaseElement : null
4823 );
4824 (0,external_React_.useEffect)(() => {
4825 var _a2;
4826 if (!store) return;
4827 if (!moves) return;
4828 if (!composite) return;
4829 if (!focusOnMove) return;
4830 const { activeId: activeId2 } = store.getState();
4831 const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
4832 if (!itemElement) return;
4833 focusIntoView(itemElement);
4834 }, [store, moves, composite, focusOnMove]);
4835 useSafeLayoutEffect(() => {
4836 if (!store) return;
4837 if (!moves) return;
4838 if (!composite) return;
4839 const { baseElement, activeId: activeId2 } = store.getState();
4840 const isSelfAcive = activeId2 === null;
4841 if (!isSelfAcive) return;
4842 if (!baseElement) return;
4843 const previousElement = previousElementRef.current;
4844 previousElementRef.current = null;
4845 if (previousElement) {
4846 fireBlurEvent(previousElement, { relatedTarget: baseElement });
4847 }
4848 if (!hasFocus(baseElement)) {
4849 baseElement.focus();
4850 }
4851 }, [store, moves, composite]);
4852 const activeId = store.useState("activeId");
4853 const virtualFocus = store.useState("virtualFocus");
4854 useSafeLayoutEffect(() => {
4855 var _a2;
4856 if (!store) return;
4857 if (!composite) return;
4858 if (!virtualFocus) return;
4859 const previousElement = previousElementRef.current;
4860 previousElementRef.current = null;
4861 if (!previousElement) return;
4862 const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element;
4863 const relatedTarget = activeElement || getActiveElement(previousElement);
4864 if (relatedTarget === previousElement) return;
4865 fireBlurEvent(previousElement, { relatedTarget });
4866 }, [store, activeId, virtualFocus, composite]);
4867 const onKeyDownCapture = useKeyboardEventProxy(
4868 store,
4869 props.onKeyDownCapture,
4870 previousElementRef
4871 );
4872 const onKeyUpCapture = useKeyboardEventProxy(
4873 store,
4874 props.onKeyUpCapture,
4875 previousElementRef
4876 );
4877 const onFocusCaptureProp = props.onFocusCapture;
4878 const onFocusCapture = useEvent((event) => {
4879 onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
4880 if (event.defaultPrevented) return;
4881 if (!store) return;
4882 const { virtualFocus: virtualFocus2 } = store.getState();
4883 if (!virtualFocus2) return;
4884 const previousActiveElement = event.relatedTarget;
4885 const isSilentlyFocused = silentlyFocused(event.currentTarget);
4886 if (isSelfTarget(event) && isSilentlyFocused) {
4887 event.stopPropagation();
4888 previousElementRef.current = previousActiveElement;
4889 }
4890 });
4891 const onFocusProp = props.onFocus;
4892 const onFocus = useEvent((event) => {
4893 onFocusProp == null ? void 0 : onFocusProp(event);
4894 if (event.defaultPrevented) return;
4895 if (!composite) return;
4896 if (!store) return;
4897 const { relatedTarget } = event;
4898 const { virtualFocus: virtualFocus2 } = store.getState();
4899 if (virtualFocus2) {
4900 if (isSelfTarget(event) && !isItem(store, relatedTarget)) {
4901 queueMicrotask(scheduleFocus);
4902 }
4903 } else if (isSelfTarget(event)) {
4904 store.setActiveId(null);
4905 }
4906 });
4907 const onBlurCaptureProp = props.onBlurCapture;
4908 const onBlurCapture = useEvent((event) => {
4909 var _a2;
4910 onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
4911 if (event.defaultPrevented) return;
4912 if (!store) return;
4913 const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState();
4914 if (!virtualFocus2) return;
4915 const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
4916 const nextActiveElement = event.relatedTarget;
4917 const nextActiveElementIsItem = isItem(store, nextActiveElement);
4918 const previousElement = previousElementRef.current;
4919 previousElementRef.current = null;
4920 if (isSelfTarget(event) && nextActiveElementIsItem) {
4921 if (nextActiveElement === activeElement) {
4922 if (previousElement && previousElement !== nextActiveElement) {
4923 fireBlurEvent(previousElement, event);
4924 }
4925 } else if (activeElement) {
4926 fireBlurEvent(activeElement, event);
4927 } else if (previousElement) {
4928 fireBlurEvent(previousElement, event);
4929 }
4930 event.stopPropagation();
4931 } else {
4932 const targetIsItem = isItem(store, event.target);
4933 if (!targetIsItem && activeElement) {
4934 fireBlurEvent(activeElement, event);
4935 }
4936 }
4937 });
4938 const onKeyDownProp = props.onKeyDown;
4939 const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
4940 const onKeyDown = useEvent((event) => {
4941 var _a2;
4942 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
4943 if (event.defaultPrevented) return;
4944 if (!store) return;
4945 if (!isSelfTarget(event)) return;
4946 const { orientation, renderedItems, activeId: activeId2 } = store.getState();
4947 const activeItem = getEnabledItem(store, activeId2);
4948 if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return;
4949 const isVertical = orientation !== "horizontal";
4950 const isHorizontal = orientation !== "vertical";
4951 const grid = isGrid(renderedItems);
4952 const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
4953 if (isHorizontalKey && isTextField(event.currentTarget)) return;
4954 const up = () => {
4955 if (grid) {
4956 const item = findFirstEnabledItemInTheLastRow(renderedItems);
4957 return item == null ? void 0 : item.id;
4958 }
4959 return store == null ? void 0 : store.last();
4960 };
4961 const keyMap = {
4962 ArrowUp: (grid || isVertical) && up,
4963 ArrowRight: (grid || isHorizontal) && store.first,
4964 ArrowDown: (grid || isVertical) && store.first,
4965 ArrowLeft: (grid || isHorizontal) && store.last,
4966 Home: store.first,
4967 End: store.last,
4968 PageUp: store.first,
4969 PageDown: store.last
4970 };
4971 const action = keyMap[event.key];
4972 if (action) {
4973 const id = action();
4974 if (id !== void 0) {
4975 if (!moveOnKeyPressProp(event)) return;
4976 event.preventDefault();
4977 store.move(id);
4978 }
4979 }
4980 });
4981 props = useWrapElement(
4982 props,
4983 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContextProvider, { value: store, children: element }),
4984 [store]
4985 );
4986 const activeDescendant = store.useState((state) => {
4987 var _a2;
4988 if (!store) return;
4989 if (!composite) return;
4990 if (!state.virtualFocus) return;
4991 return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id;
4992 });
4993 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
4994 "aria-activedescendant": activeDescendant
4995 }, props), {
4996 ref: useMergeRefs(ref, setBaseElement, props.ref),
4997 onKeyDownCapture,
4998 onKeyUpCapture,
4999 onFocusCapture,
5000 onFocus,
5001 onBlurCapture,
5002 onKeyDown
5003 });
5004 const focusable = store.useState(
5005 (state) => composite && (state.virtualFocus || state.activeId === null)
5006 );
5007 props = useFocusable(_3YLGPPWQ_spreadValues({ focusable }, props));
5008 return props;
5009 }
5010);
5011var Composite = forwardRef2(function Composite2(props) {
5012 const htmlProps = useComposite(props);
5013 return LMDWO4NN_createElement(ITI7HKP4_TagName, htmlProps);
5014});
5015
5016
5017
5018;// ./node_modules/@wordpress/components/build-module/composite/context.js
5019
5020const CompositeContext = (0,external_wp_element_namespaceObject.createContext)({});
5021CompositeContext.displayName = "CompositeContext";
5022const context_useCompositeContext = () => (0,external_wp_element_namespaceObject.useContext)(CompositeContext);
5023
5024
5025;// ./node_modules/@ariakit/react-core/esm/__chunks/7HVFURXT.js
5026"use client";
5027
5028// src/group/group-label-context.tsx
5029
5030var GroupLabelContext = (0,external_React_.createContext)(void 0);
5031
5032
5033
5034;// ./node_modules/@ariakit/react-core/esm/__chunks/36LIF33V.js
5035"use client";
5036
5037
5038
5039
5040
5041// src/group/group.tsx
5042
5043
5044
5045var _36LIF33V_TagName = "div";
5046var useGroup = createHook(
5047 function useGroup2(props) {
5048 const [labelId, setLabelId] = (0,external_React_.useState)();
5049 props = useWrapElement(
5050 props,
5051 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupLabelContext.Provider, { value: setLabelId, children: element }),
5052 []
5053 );
5054 props = _3YLGPPWQ_spreadValues({
5055 role: "group",
5056 "aria-labelledby": labelId
5057 }, props);
5058 return removeUndefinedValues(props);
5059 }
5060);
5061var Group = forwardRef2(function Group2(props) {
5062 const htmlProps = useGroup(props);
5063 return LMDWO4NN_createElement(_36LIF33V_TagName, htmlProps);
5064});
5065
5066
5067
5068;// ./node_modules/@ariakit/react-core/esm/__chunks/YORGHBM4.js
5069"use client";
5070
5071
5072
5073
5074// src/composite/composite-group.tsx
5075var YORGHBM4_TagName = "div";
5076var useCompositeGroup = createHook(
5077 function useCompositeGroup2(_a) {
5078 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
5079 props = useGroup(props);
5080 return props;
5081 }
5082);
5083var CompositeGroup = forwardRef2(function CompositeGroup2(props) {
5084 const htmlProps = useCompositeGroup(props);
5085 return LMDWO4NN_createElement(YORGHBM4_TagName, htmlProps);
5086});
5087
5088
5089
5090;// ./node_modules/@wordpress/components/build-module/composite/group.js
5091
5092
5093
5094
5095const group_CompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroup2(props, ref) {
5096 var _props$store;
5097 const context = context_useCompositeContext();
5098 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5099 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeGroup, {
5100 store,
5101 ...props,
5102 ref
5103 });
5104});
5105
5106
5107;// ./node_modules/@ariakit/react-core/esm/__chunks/YUOJWFSO.js
5108"use client";
5109
5110
5111
5112
5113
5114// src/group/group-label.tsx
5115
5116
5117var YUOJWFSO_TagName = "div";
5118var useGroupLabel = createHook(
5119 function useGroupLabel2(props) {
5120 const setLabelId = (0,external_React_.useContext)(GroupLabelContext);
5121 const id = useId(props.id);
5122 useSafeLayoutEffect(() => {
5123 setLabelId == null ? void 0 : setLabelId(id);
5124 return () => setLabelId == null ? void 0 : setLabelId(void 0);
5125 }, [setLabelId, id]);
5126 props = _3YLGPPWQ_spreadValues({
5127 id,
5128 "aria-hidden": true
5129 }, props);
5130 return removeUndefinedValues(props);
5131 }
5132);
5133var GroupLabel = forwardRef2(function GroupLabel2(props) {
5134 const htmlProps = useGroupLabel(props);
5135 return LMDWO4NN_createElement(YUOJWFSO_TagName, htmlProps);
5136});
5137
5138
5139
5140;// ./node_modules/@ariakit/react-core/esm/__chunks/SWSPTQMT.js
5141"use client";
5142
5143
5144
5145
5146// src/composite/composite-group-label.tsx
5147var SWSPTQMT_TagName = "div";
5148var useCompositeGroupLabel = createHook(function useCompositeGroupLabel2(_a) {
5149 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
5150 props = useGroupLabel(props);
5151 return props;
5152});
5153var CompositeGroupLabel = forwardRef2(function CompositeGroupLabel2(props) {
5154 const htmlProps = useCompositeGroupLabel(props);
5155 return LMDWO4NN_createElement(SWSPTQMT_TagName, htmlProps);
5156});
5157
5158
5159
5160;// ./node_modules/@wordpress/components/build-module/composite/group-label.js
5161
5162
5163
5164
5165const group_label_CompositeGroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroupLabel2(props, ref) {
5166 var _props$store;
5167 const context = context_useCompositeContext();
5168 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5169 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeGroupLabel, {
5170 store,
5171 ...props,
5172 ref
5173 });
5174});
5175
5176
5177;// ./node_modules/@ariakit/react-core/esm/__chunks/UQQRIHDV.js
5178"use client";
5179
5180
5181
5182
5183
5184// src/composite/composite-hover.tsx
5185
5186
5187
5188
5189var UQQRIHDV_TagName = "div";
5190function getMouseDestination(event) {
5191 const relatedTarget = event.relatedTarget;
5192 if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) {
5193 return relatedTarget;
5194 }
5195 return null;
5196}
5197function hoveringInside(event) {
5198 const nextElement = getMouseDestination(event);
5199 if (!nextElement) return false;
5200 return contains(event.currentTarget, nextElement);
5201}
5202var symbol = Symbol("composite-hover");
5203function movingToAnotherItem(event) {
5204 let dest = getMouseDestination(event);
5205 if (!dest) return false;
5206 do {
5207 if (PBFD2E7P_hasOwnProperty(dest, symbol) && dest[symbol]) return true;
5208 dest = dest.parentElement;
5209 } while (dest);
5210 return false;
5211}
5212var useCompositeHover = createHook(
5213 function useCompositeHover2(_a) {
5214 var _b = _a, {
5215 store,
5216 focusOnHover = true,
5217 blurOnHoverEnd = !!focusOnHover
5218 } = _b, props = __objRest(_b, [
5219 "store",
5220 "focusOnHover",
5221 "blurOnHoverEnd"
5222 ]);
5223 const context = useCompositeContext();
5224 store = store || context;
5225 invariant(
5226 store,
5227 false && 0
5228 );
5229 const isMouseMoving = useIsMouseMoving();
5230 const onMouseMoveProp = props.onMouseMove;
5231 const focusOnHoverProp = useBooleanEvent(focusOnHover);
5232 const onMouseMove = useEvent((event) => {
5233 onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
5234 if (event.defaultPrevented) return;
5235 if (!isMouseMoving()) return;
5236 if (!focusOnHoverProp(event)) return;
5237 if (!hasFocusWithin(event.currentTarget)) {
5238 const baseElement = store == null ? void 0 : store.getState().baseElement;
5239 if (baseElement && !hasFocus(baseElement)) {
5240 baseElement.focus();
5241 }
5242 }
5243 store == null ? void 0 : store.setActiveId(event.currentTarget.id);
5244 });
5245 const onMouseLeaveProp = props.onMouseLeave;
5246 const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
5247 const onMouseLeave = useEvent((event) => {
5248 var _a2;
5249 onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
5250 if (event.defaultPrevented) return;
5251 if (!isMouseMoving()) return;
5252 if (hoveringInside(event)) return;
5253 if (movingToAnotherItem(event)) return;
5254 if (!focusOnHoverProp(event)) return;
5255 if (!blurOnHoverEndProp(event)) return;
5256 store == null ? void 0 : store.setActiveId(null);
5257 (_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus();
5258 });
5259 const ref = (0,external_React_.useCallback)((element) => {
5260 if (!element) return;
5261 element[symbol] = true;
5262 }, []);
5263 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
5264 ref: useMergeRefs(ref, props.ref),
5265 onMouseMove,
5266 onMouseLeave
5267 });
5268 return removeUndefinedValues(props);
5269 }
5270);
5271var CompositeHover = memo2(
5272 forwardRef2(function CompositeHover2(props) {
5273 const htmlProps = useCompositeHover(props);
5274 return LMDWO4NN_createElement(UQQRIHDV_TagName, htmlProps);
5275 })
5276);
5277
5278
5279
5280;// ./node_modules/@wordpress/components/build-module/composite/hover.js
5281
5282
5283
5284
5285const hover_CompositeHover = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeHover2(props, ref) {
5286 var _props$store;
5287 const context = context_useCompositeContext();
5288 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5289 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeHover, {
5290 store,
5291 ...props,
5292 ref
5293 });
5294});
5295
5296
5297;// ./node_modules/@ariakit/react-core/esm/__chunks/RZ4GPYOB.js
5298"use client";
5299
5300
5301
5302
5303
5304// src/collection/collection-item.tsx
5305
5306
5307var RZ4GPYOB_TagName = "div";
5308var useCollectionItem = createHook(
5309 function useCollectionItem2(_a) {
5310 var _b = _a, {
5311 store,
5312 shouldRegisterItem = true,
5313 getItem = identity,
5314 element: element
5315 } = _b, props = __objRest(_b, [
5316 "store",
5317 "shouldRegisterItem",
5318 "getItem",
5319 // @ts-expect-error This prop may come from a collection renderer.
5320 "element"
5321 ]);
5322 const context = useCollectionContext();
5323 store = store || context;
5324 const id = useId(props.id);
5325 const ref = (0,external_React_.useRef)(element);
5326 (0,external_React_.useEffect)(() => {
5327 const element2 = ref.current;
5328 if (!id) return;
5329 if (!element2) return;
5330 if (!shouldRegisterItem) return;
5331 const item = getItem({ id, element: element2 });
5332 return store == null ? void 0 : store.renderItem(item);
5333 }, [id, shouldRegisterItem, getItem, store]);
5334 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
5335 ref: useMergeRefs(ref, props.ref)
5336 });
5337 return removeUndefinedValues(props);
5338 }
5339);
5340var CollectionItem = forwardRef2(function CollectionItem2(props) {
5341 const htmlProps = useCollectionItem(props);
5342 return LMDWO4NN_createElement(RZ4GPYOB_TagName, htmlProps);
5343});
5344
5345
5346
5347;// ./node_modules/@ariakit/react-core/esm/__chunks/KUU7WJ55.js
5348"use client";
5349
5350
5351
5352
5353
5354// src/command/command.tsx
5355
5356
5357
5358
5359
5360var KUU7WJ55_TagName = "button";
5361function isNativeClick(event) {
5362 if (!event.isTrusted) return false;
5363 const element = event.currentTarget;
5364 if (event.key === "Enter") {
5365 return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
5366 }
5367 if (event.key === " ") {
5368 return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
5369 }
5370 return false;
5371}
5372var KUU7WJ55_symbol = Symbol("command");
5373var useCommand = createHook(
5374 function useCommand2(_a) {
5375 var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]);
5376 const ref = (0,external_React_.useRef)(null);
5377 const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(false);
5378 (0,external_React_.useEffect)(() => {
5379 if (!ref.current) return;
5380 setIsNativeButton(isButton(ref.current));
5381 }, []);
5382 const [active, setActive] = (0,external_React_.useState)(false);
5383 const activeRef = (0,external_React_.useRef)(false);
5384 const disabled = disabledFromProps(props);
5385 const [isDuplicate, metadataProps] = useMetadataProps(props, KUU7WJ55_symbol, true);
5386 const onKeyDownProp = props.onKeyDown;
5387 const onKeyDown = useEvent((event) => {
5388 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
5389 const element = event.currentTarget;
5390 if (event.defaultPrevented) return;
5391 if (isDuplicate) return;
5392 if (disabled) return;
5393 if (!isSelfTarget(event)) return;
5394 if (isTextField(element)) return;
5395 if (element.isContentEditable) return;
5396 const isEnter = clickOnEnter && event.key === "Enter";
5397 const isSpace = clickOnSpace && event.key === " ";
5398 const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
5399 const shouldPreventSpace = event.key === " " && !clickOnSpace;
5400 if (shouldPreventEnter || shouldPreventSpace) {
5401 event.preventDefault();
5402 return;
5403 }
5404 if (isEnter || isSpace) {
5405 const nativeClick = isNativeClick(event);
5406 if (isEnter) {
5407 if (!nativeClick) {
5408 event.preventDefault();
5409 const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
5410 const click = () => fireClickEvent(element, eventInit);
5411 if (isFirefox()) {
5412 queueBeforeEvent(element, "keyup", click);
5413 } else {
5414 queueMicrotask(click);
5415 }
5416 }
5417 } else if (isSpace) {
5418 activeRef.current = true;
5419 if (!nativeClick) {
5420 event.preventDefault();
5421 setActive(true);
5422 }
5423 }
5424 }
5425 });
5426 const onKeyUpProp = props.onKeyUp;
5427 const onKeyUp = useEvent((event) => {
5428 onKeyUpProp == null ? void 0 : onKeyUpProp(event);
5429 if (event.defaultPrevented) return;
5430 if (isDuplicate) return;
5431 if (disabled) return;
5432 if (event.metaKey) return;
5433 const isSpace = clickOnSpace && event.key === " ";
5434 if (activeRef.current && isSpace) {
5435 activeRef.current = false;
5436 if (!isNativeClick(event)) {
5437 event.preventDefault();
5438 setActive(false);
5439 const element = event.currentTarget;
5440 const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]);
5441 queueMicrotask(() => fireClickEvent(element, eventInit));
5442 }
5443 }
5444 });
5445 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({
5446 "data-active": active || void 0,
5447 type: isNativeButton ? "button" : void 0
5448 }, metadataProps), props), {
5449 ref: useMergeRefs(ref, props.ref),
5450 onKeyDown,
5451 onKeyUp
5452 });
5453 props = useFocusable(props);
5454 return props;
5455 }
5456);
5457var Command = forwardRef2(function Command2(props) {
5458 const htmlProps = useCommand(props);
5459 return LMDWO4NN_createElement(KUU7WJ55_TagName, htmlProps);
5460});
5461
5462
5463
5464;// ./node_modules/@ariakit/react-core/esm/__chunks/P2CTZE2T.js
5465"use client";
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475// src/composite/composite-item.tsx
5476
5477
5478
5479
5480
5481
5482var P2CTZE2T_TagName = "button";
5483function isEditableElement(element) {
5484 if (isTextbox(element)) return true;
5485 return element.tagName === "INPUT" && !isButton(element);
5486}
5487function getNextPageOffset(scrollingElement, pageUp = false) {
5488 const height = scrollingElement.clientHeight;
5489 const { top } = scrollingElement.getBoundingClientRect();
5490 const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
5491 const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
5492 if (scrollingElement.tagName === "HTML") {
5493 return pageOffset + scrollingElement.scrollTop;
5494 }
5495 return pageOffset;
5496}
5497function getItemOffset(itemElement, pageUp = false) {
5498 const { top } = itemElement.getBoundingClientRect();
5499 if (pageUp) {
5500 return top + itemElement.clientHeight;
5501 }
5502 return top;
5503}
5504function findNextPageItemId(element, store, next, pageUp = false) {
5505 var _a;
5506 if (!store) return;
5507 if (!next) return;
5508 const { renderedItems } = store.getState();
5509 const scrollingElement = getScrollingElement(element);
5510 if (!scrollingElement) return;
5511 const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
5512 let id;
5513 let prevDifference;
5514 for (let i = 0; i < renderedItems.length; i += 1) {
5515 const previousId = id;
5516 id = next(i);
5517 if (!id) break;
5518 if (id === previousId) continue;
5519 const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element;
5520 if (!itemElement) continue;
5521 const itemOffset = getItemOffset(itemElement, pageUp);
5522 const difference = itemOffset - nextPageOffset;
5523 const absDifference = Math.abs(difference);
5524 if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
5525 if (prevDifference !== void 0 && prevDifference < absDifference) {
5526 id = previousId;
5527 }
5528 break;
5529 }
5530 prevDifference = absDifference;
5531 }
5532 return id;
5533}
5534function targetIsAnotherItem(event, store) {
5535 if (isSelfTarget(event)) return false;
5536 return isItem(store, event.target);
5537}
5538var useCompositeItem = createHook(
5539 function useCompositeItem2(_a) {
5540 var _b = _a, {
5541 store,
5542 rowId: rowIdProp,
5543 preventScrollOnKeyDown = false,
5544 moveOnKeyPress = true,
5545 tabbable = false,
5546 getItem: getItemProp,
5547 "aria-setsize": ariaSetSizeProp,
5548 "aria-posinset": ariaPosInSetProp
5549 } = _b, props = __objRest(_b, [
5550 "store",
5551 "rowId",
5552 "preventScrollOnKeyDown",
5553 "moveOnKeyPress",
5554 "tabbable",
5555 "getItem",
5556 "aria-setsize",
5557 "aria-posinset"
5558 ]);
5559 const context = useCompositeContext();
5560 store = store || context;
5561 const id = useId(props.id);
5562 const ref = (0,external_React_.useRef)(null);
5563 const row = (0,external_React_.useContext)(CompositeRowContext);
5564 const disabled = disabledFromProps(props);
5565 const trulyDisabled = disabled && !props.accessibleWhenDisabled;
5566 const {
5567 rowId,
5568 baseElement,
5569 isActiveItem,
5570 ariaSetSize,
5571 ariaPosInSet,
5572 isTabbable
5573 } = useStoreStateObject(store, {
5574 rowId(state) {
5575 if (rowIdProp) return rowIdProp;
5576 if (!state) return;
5577 if (!(row == null ? void 0 : row.baseElement)) return;
5578 if (row.baseElement !== state.baseElement) return;
5579 return row.id;
5580 },
5581 baseElement(state) {
5582 return (state == null ? void 0 : state.baseElement) || void 0;
5583 },
5584 isActiveItem(state) {
5585 return !!state && state.activeId === id;
5586 },
5587 ariaSetSize(state) {
5588 if (ariaSetSizeProp != null) return ariaSetSizeProp;
5589 if (!state) return;
5590 if (!(row == null ? void 0 : row.ariaSetSize)) return;
5591 if (row.baseElement !== state.baseElement) return;
5592 return row.ariaSetSize;
5593 },
5594 ariaPosInSet(state) {
5595 if (ariaPosInSetProp != null) return ariaPosInSetProp;
5596 if (!state) return;
5597 if (!(row == null ? void 0 : row.ariaPosInSet)) return;
5598 if (row.baseElement !== state.baseElement) return;
5599 const itemsInRow = state.renderedItems.filter(
5600 (item) => item.rowId === rowId
5601 );
5602 return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
5603 },
5604 isTabbable(state) {
5605 if (!(state == null ? void 0 : state.renderedItems.length)) return true;
5606 if (state.virtualFocus) return false;
5607 if (tabbable) return true;
5608 if (state.activeId === null) return false;
5609 const item = store == null ? void 0 : store.item(state.activeId);
5610 if (item == null ? void 0 : item.disabled) return true;
5611 if (!(item == null ? void 0 : item.element)) return true;
5612 return state.activeId === id;
5613 }
5614 });
5615 const getItem = (0,external_React_.useCallback)(
5616 (item) => {
5617 var _a2;
5618 const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), {
5619 id: id || item.id,
5620 rowId,
5621 disabled: !!trulyDisabled,
5622 children: (_a2 = item.element) == null ? void 0 : _a2.textContent
5623 });
5624 if (getItemProp) {
5625 return getItemProp(nextItem);
5626 }
5627 return nextItem;
5628 },
5629 [id, rowId, trulyDisabled, getItemProp]
5630 );
5631 const onFocusProp = props.onFocus;
5632 const hasFocusedComposite = (0,external_React_.useRef)(false);
5633 const onFocus = useEvent((event) => {
5634 onFocusProp == null ? void 0 : onFocusProp(event);
5635 if (event.defaultPrevented) return;
5636 if (isPortalEvent(event)) return;
5637 if (!id) return;
5638 if (!store) return;
5639 if (targetIsAnotherItem(event, store)) return;
5640 const { virtualFocus, baseElement: baseElement2 } = store.getState();
5641 store.setActiveId(id);
5642 if (isTextbox(event.currentTarget)) {
5643 selectTextField(event.currentTarget);
5644 }
5645 if (!virtualFocus) return;
5646 if (!isSelfTarget(event)) return;
5647 if (isEditableElement(event.currentTarget)) return;
5648 if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
5649 if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) {
5650 event.currentTarget.scrollIntoView({
5651 block: "nearest",
5652 inline: "nearest"
5653 });
5654 }
5655 hasFocusedComposite.current = true;
5656 const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget);
5657 if (fromComposite) {
5658 focusSilently(baseElement2);
5659 } else {
5660 baseElement2.focus();
5661 }
5662 });
5663 const onBlurCaptureProp = props.onBlurCapture;
5664 const onBlurCapture = useEvent((event) => {
5665 onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
5666 if (event.defaultPrevented) return;
5667 const state = store == null ? void 0 : store.getState();
5668 if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) {
5669 hasFocusedComposite.current = false;
5670 event.preventDefault();
5671 event.stopPropagation();
5672 }
5673 });
5674 const onKeyDownProp = props.onKeyDown;
5675 const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
5676 const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
5677 const onKeyDown = useEvent((event) => {
5678 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
5679 if (event.defaultPrevented) return;
5680 if (!isSelfTarget(event)) return;
5681 if (!store) return;
5682 const { currentTarget } = event;
5683 const state = store.getState();
5684 const item = store.item(id);
5685 const isGrid = !!(item == null ? void 0 : item.rowId);
5686 const isVertical = state.orientation !== "horizontal";
5687 const isHorizontal = state.orientation !== "vertical";
5688 const canHomeEnd = () => {
5689 if (isGrid) return true;
5690 if (isHorizontal) return true;
5691 if (!state.baseElement) return true;
5692 if (!isTextField(state.baseElement)) return true;
5693 return false;
5694 };
5695 const keyMap = {
5696 ArrowUp: (isGrid || isVertical) && store.up,
5697 ArrowRight: (isGrid || isHorizontal) && store.next,
5698 ArrowDown: (isGrid || isVertical) && store.down,
5699 ArrowLeft: (isGrid || isHorizontal) && store.previous,
5700 Home: () => {
5701 if (!canHomeEnd()) return;
5702 if (!isGrid || event.ctrlKey) {
5703 return store == null ? void 0 : store.first();
5704 }
5705 return store == null ? void 0 : store.previous(-1);
5706 },
5707 End: () => {
5708 if (!canHomeEnd()) return;
5709 if (!isGrid || event.ctrlKey) {
5710 return store == null ? void 0 : store.last();
5711 }
5712 return store == null ? void 0 : store.next(-1);
5713 },
5714 PageUp: () => {
5715 return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true);
5716 },
5717 PageDown: () => {
5718 return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down);
5719 }
5720 };
5721 const action = keyMap[event.key];
5722 if (action) {
5723 if (isTextbox(currentTarget)) {
5724 const selection = getTextboxSelection(currentTarget);
5725 const isLeft = isHorizontal && event.key === "ArrowLeft";
5726 const isRight = isHorizontal && event.key === "ArrowRight";
5727 const isUp = isVertical && event.key === "ArrowUp";
5728 const isDown = isVertical && event.key === "ArrowDown";
5729 if (isRight || isDown) {
5730 const { length: valueLength } = getTextboxValue(currentTarget);
5731 if (selection.end !== valueLength) return;
5732 } else if ((isLeft || isUp) && selection.start !== 0) return;
5733 }
5734 const nextId = action();
5735 if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
5736 if (!moveOnKeyPressProp(event)) return;
5737 event.preventDefault();
5738 store.move(nextId);
5739 }
5740 }
5741 });
5742 const providerValue = (0,external_React_.useMemo)(
5743 () => ({ id, baseElement }),
5744 [id, baseElement]
5745 );
5746 props = useWrapElement(
5747 props,
5748 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }),
5749 [providerValue]
5750 );
5751 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
5752 id,
5753 "data-active-item": isActiveItem || void 0
5754 }, props), {
5755 ref: useMergeRefs(ref, props.ref),
5756 tabIndex: isTabbable ? props.tabIndex : -1,
5757 onFocus,
5758 onBlurCapture,
5759 onKeyDown
5760 });
5761 props = useCommand(props);
5762 props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
5763 store
5764 }, props), {
5765 getItem,
5766 shouldRegisterItem: id ? props.shouldRegisterItem : false
5767 }));
5768 return removeUndefinedValues(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
5769 "aria-setsize": ariaSetSize,
5770 "aria-posinset": ariaPosInSet
5771 }));
5772 }
5773);
5774var CompositeItem = memo2(
5775 forwardRef2(function CompositeItem2(props) {
5776 const htmlProps = useCompositeItem(props);
5777 return LMDWO4NN_createElement(P2CTZE2T_TagName, htmlProps);
5778 })
5779);
5780
5781
5782
5783;// ./node_modules/@wordpress/components/build-module/composite/item.js
5784
5785
5786
5787
5788const item_CompositeItem = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeItem2(props, ref) {
5789 var _props$store;
5790 const context = context_useCompositeContext();
5791 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5792 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItem, {
5793 store,
5794 ...props,
5795 ref
5796 });
5797});
5798
5799
5800;// ./node_modules/@ariakit/react-core/esm/__chunks/J2LQO3EC.js
5801"use client";
5802
5803
5804
5805
5806
5807// src/composite/composite-row.tsx
5808
5809
5810
5811var J2LQO3EC_TagName = "div";
5812var useCompositeRow = createHook(
5813 function useCompositeRow2(_a) {
5814 var _b = _a, {
5815 store,
5816 "aria-setsize": ariaSetSize,
5817 "aria-posinset": ariaPosInSet
5818 } = _b, props = __objRest(_b, [
5819 "store",
5820 "aria-setsize",
5821 "aria-posinset"
5822 ]);
5823 const context = useCompositeContext();
5824 store = store || context;
5825 invariant(
5826 store,
5827 false && 0
5828 );
5829 const id = useId(props.id);
5830 const baseElement = store.useState(
5831 (state) => state.baseElement || void 0
5832 );
5833 const providerValue = (0,external_React_.useMemo)(
5834 () => ({ id, baseElement, ariaSetSize, ariaPosInSet }),
5835 [id, baseElement, ariaSetSize, ariaPosInSet]
5836 );
5837 props = useWrapElement(
5838 props,
5839 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRowContext.Provider, { value: providerValue, children: element }),
5840 [providerValue]
5841 );
5842 props = _3YLGPPWQ_spreadValues({ id }, props);
5843 return removeUndefinedValues(props);
5844 }
5845);
5846var CompositeRow = forwardRef2(function CompositeRow2(props) {
5847 const htmlProps = useCompositeRow(props);
5848 return LMDWO4NN_createElement(J2LQO3EC_TagName, htmlProps);
5849});
5850
5851
5852
5853;// ./node_modules/@wordpress/components/build-module/composite/row.js
5854
5855
5856
5857
5858const row_CompositeRow = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeRow2(props, ref) {
5859 var _props$store;
5860 const context = context_useCompositeContext();
5861 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5862 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRow, {
5863 store,
5864 ...props,
5865 ref
5866 });
5867});
5868
5869
5870;// ./node_modules/@ariakit/react-core/esm/__chunks/T7VMP3TM.js
5871"use client";
5872
5873
5874
5875
5876
5877
5878// src/composite/composite-typeahead.tsx
5879
5880
5881
5882
5883var T7VMP3TM_TagName = "div";
5884var chars = "";
5885function clearChars() {
5886 chars = "";
5887}
5888function isValidTypeaheadEvent(event) {
5889 const target = event.target;
5890 if (target && isTextField(target)) return false;
5891 if (event.key === " " && chars.length) return true;
5892 return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && /^[\p{Letter}\p{Number}]$/u.test(event.key);
5893}
5894function isSelfTargetOrItem(event, items) {
5895 if (isSelfTarget(event)) return true;
5896 const target = event.target;
5897 if (!target) return false;
5898 const isItem = items.some((item) => item.element === target);
5899 return isItem;
5900}
5901function T7VMP3TM_getEnabledItems(items) {
5902 return items.filter((item) => !item.disabled);
5903}
5904function itemTextStartsWith(item, text) {
5905 var _a;
5906 const itemText = ((_a = item.element) == null ? void 0 : _a.textContent) || item.children || // The composite item object itself doesn't include a value property, but
5907 // other components like Select do. Since CompositeTypeahead is a generic
5908 // component that can be used with those as well, we also consider the value
5909 // property as a fallback for the typeahead text content.
5910 "value" in item && item.value;
5911 if (!itemText) return false;
5912 return normalizeString(itemText).trim().toLowerCase().startsWith(text.toLowerCase());
5913}
5914function getSameInitialItems(items, char, activeId) {
5915 if (!activeId) return items;
5916 const activeItem = items.find((item) => item.id === activeId);
5917 if (!activeItem) return items;
5918 if (!itemTextStartsWith(activeItem, char)) return items;
5919 if (chars !== char && itemTextStartsWith(activeItem, chars)) return items;
5920 chars = char;
5921 return _5VQZOHHZ_flipItems(
5922 items.filter((item) => itemTextStartsWith(item, chars)),
5923 activeId
5924 ).filter((item) => item.id !== activeId);
5925}
5926var useCompositeTypeahead = createHook(function useCompositeTypeahead2(_a) {
5927 var _b = _a, { store, typeahead = true } = _b, props = __objRest(_b, ["store", "typeahead"]);
5928 const context = useCompositeContext();
5929 store = store || context;
5930 invariant(
5931 store,
5932 false && 0
5933 );
5934 const onKeyDownCaptureProp = props.onKeyDownCapture;
5935 const cleanupTimeoutRef = (0,external_React_.useRef)(0);
5936 const onKeyDownCapture = useEvent((event) => {
5937 onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
5938 if (event.defaultPrevented) return;
5939 if (!typeahead) return;
5940 if (!store) return;
5941 if (!isValidTypeaheadEvent(event)) {
5942 return clearChars();
5943 }
5944 const { renderedItems, items, activeId, id } = store.getState();
5945 let enabledItems = T7VMP3TM_getEnabledItems(
5946 items.length > renderedItems.length ? items : renderedItems
5947 );
5948 const document = getDocument(event.currentTarget);
5949 const selector = `[data-offscreen-id="${id}"]`;
5950 const offscreenItems = document.querySelectorAll(selector);
5951 for (const element of offscreenItems) {
5952 const disabled = element.ariaDisabled === "true" || "disabled" in element && !!element.disabled;
5953 enabledItems.push({ id: element.id, element, disabled });
5954 }
5955 if (offscreenItems.length) {
5956 enabledItems = sortBasedOnDOMPosition(enabledItems, (i) => i.element);
5957 }
5958 if (!isSelfTargetOrItem(event, enabledItems)) return clearChars();
5959 event.preventDefault();
5960 window.clearTimeout(cleanupTimeoutRef.current);
5961 cleanupTimeoutRef.current = window.setTimeout(() => {
5962 chars = "";
5963 }, 500);
5964 const char = event.key.toLowerCase();
5965 chars += char;
5966 enabledItems = getSameInitialItems(enabledItems, char, activeId);
5967 const item = enabledItems.find((item2) => itemTextStartsWith(item2, chars));
5968 if (item) {
5969 store.move(item.id);
5970 } else {
5971 clearChars();
5972 }
5973 });
5974 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
5975 onKeyDownCapture
5976 });
5977 return removeUndefinedValues(props);
5978});
5979var CompositeTypeahead = forwardRef2(function CompositeTypeahead2(props) {
5980 const htmlProps = useCompositeTypeahead(props);
5981 return LMDWO4NN_createElement(T7VMP3TM_TagName, htmlProps);
5982});
5983
5984
5985
5986;// ./node_modules/@wordpress/components/build-module/composite/typeahead.js
5987
5988
5989
5990
5991const typeahead_CompositeTypeahead = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeTypeahead2(props, ref) {
5992 var _props$store;
5993 const context = context_useCompositeContext();
5994 const store = (_props$store = props.store) !== null && _props$store !== void 0 ? _props$store : context.store;
5995 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeTypeahead, {
5996 store,
5997 ...props,
5998 ref
5999 });
6000});
6001
6002
6003;// ./node_modules/@wordpress/components/build-module/composite/index.js
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015const composite_Composite = Object.assign((0,external_wp_element_namespaceObject.forwardRef)(function Composite2({
6016 // Composite store props
6017 activeId,
6018 defaultActiveId,
6019 setActiveId,
6020 focusLoop = false,
6021 focusWrap = false,
6022 focusShift = false,
6023 virtualFocus = false,
6024 orientation = "both",
6025 rtl = (0,external_wp_i18n_namespaceObject.isRTL)(),
6026 // Composite component props
6027 children,
6028 disabled = false,
6029 // Rest props
6030 ...props
6031}, ref) {
6032 const storeProp = props.store;
6033 const internalStore = useCompositeStore({
6034 activeId,
6035 defaultActiveId,
6036 setActiveId,
6037 focusLoop,
6038 focusWrap,
6039 focusShift,
6040 virtualFocus,
6041 orientation,
6042 rtl
6043 });
6044 const store = storeProp !== null && storeProp !== void 0 ? storeProp : internalStore;
6045 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
6046 store
6047 }), [store]);
6048 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Composite, {
6049 disabled,
6050 store,
6051 ...props,
6052 ref,
6053 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContext.Provider, {
6054 value: contextValue,
6055 children
6056 })
6057 });
6058}), {
6059 /**
6060 * Renders a group element for composite items.
6061 *
6062 * @example
6063 * ```jsx
6064 * import { Composite } from '@wordpress/components';
6065 *
6066 * <Composite>
6067 * <Composite.Group>
6068 * <Composite.GroupLabel>Label</Composite.GroupLabel>
6069 * <Composite.Item>Item 1</Composite.Item>
6070 * <Composite.Item>Item 2</Composite.Item>
6071 * </CompositeGroup>
6072 * </Composite>
6073 * ```
6074 */
6075 Group: Object.assign(group_CompositeGroup, {
6076 displayName: "Composite.Group"
6077 }),
6078 /**
6079 * Renders a label in a composite group. This component must be wrapped with
6080 * `Composite.Group` so the `aria-labelledby` prop is properly set on the
6081 * composite group element.
6082 *
6083 * @example
6084 * ```jsx
6085 * import { Composite } from '@wordpress/components';
6086 *
6087 * <Composite>
6088 * <Composite.Group>
6089 * <Composite.GroupLabel>Label</Composite.GroupLabel>
6090 * <Composite.Item>Item 1</Composite.Item>
6091 * <Composite.Item>Item 2</Composite.Item>
6092 * </CompositeGroup>
6093 * </Composite>
6094 * ```
6095 */
6096 GroupLabel: Object.assign(group_label_CompositeGroupLabel, {
6097 displayName: "Composite.GroupLabel"
6098 }),
6099 /**
6100 * Renders a composite item.
6101 *
6102 * @example
6103 * ```jsx
6104 * import { Composite } from '@wordpress/components';
6105 *
6106 * <Composite>
6107 * <Composite.Item>Item 1</Composite.Item>
6108 * <Composite.Item>Item 2</Composite.Item>
6109 * <Composite.Item>Item 3</Composite.Item>
6110 * </Composite>
6111 * ```
6112 */
6113 Item: Object.assign(item_CompositeItem, {
6114 displayName: "Composite.Item"
6115 }),
6116 /**
6117 * Renders a composite row. Wrapping `Composite.Item` elements within
6118 * `Composite.Row` will create a two-dimensional composite widget, such as a
6119 * grid.
6120 *
6121 * @example
6122 * ```jsx
6123 * import { Composite } from '@wordpress/components';
6124 *
6125 * <Composite>
6126 * <Composite.Row>
6127 * <Composite.Item>Item 1.1</Composite.Item>
6128 * <Composite.Item>Item 1.2</Composite.Item>
6129 * <Composite.Item>Item 1.3</Composite.Item>
6130 * </Composite.Row>
6131 * <Composite.Row>
6132 * <Composite.Item>Item 2.1</Composite.Item>
6133 * <Composite.Item>Item 2.2</Composite.Item>
6134 * <Composite.Item>Item 2.3</Composite.Item>
6135 * </Composite.Row>
6136 * </Composite>
6137 * ```
6138 */
6139 Row: Object.assign(row_CompositeRow, {
6140 displayName: "Composite.Row"
6141 }),
6142 /**
6143 * Renders an element in a composite widget that receives focus on mouse move
6144 * and loses focus to the composite base element on mouse leave. This should
6145 * be combined with the `Composite.Item` component.
6146 *
6147 * @example
6148 * ```jsx
6149 * import { Composite } from '@wordpress/components';
6150 *
6151 * <Composite>
6152 * <Composite.Hover render={ <Composite.Item /> }>
6153 * Item 1
6154 * </Composite.Hover>
6155 * <Composite.Hover render={ <Composite.Item /> }>
6156 * Item 2
6157 * </Composite.Hover>
6158 * </Composite>
6159 * ```
6160 */
6161 Hover: Object.assign(hover_CompositeHover, {
6162 displayName: "Composite.Hover"
6163 }),
6164 /**
6165 * Renders a component that adds typeahead functionality to composite
6166 * components. Hitting printable character keys will move focus to the next
6167 * composite item that begins with the input characters.
6168 *
6169 * @example
6170 * ```jsx
6171 * import { Composite } from '@wordpress/components';
6172 *
6173 * <Composite render={ <CompositeTypeahead /> }>
6174 * <Composite.Item>Item 1</Composite.Item>
6175 * <Composite.Item>Item 2</Composite.Item>
6176 * </Composite>
6177 * ```
6178 */
6179 Typeahead: Object.assign(typeahead_CompositeTypeahead, {
6180 displayName: "Composite.Typeahead"
6181 }),
6182 /**
6183 * The React context used by the composite components. It can be used by
6184 * to access the composite store, and to forward the context when composite
6185 * sub-components are rendered across portals (ie. `SlotFill` components)
6186 * that would not otherwise forward the context to the `Fill` children.
6187 *
6188 * @example
6189 * ```jsx
6190 * import { Composite } from '@wordpress/components';
6191 * import { useContext } from '@wordpress/element';
6192 *
6193 * const compositeContext = useContext( Composite.Context );
6194 * ```
6195 */
6196 Context: Object.assign(CompositeContext, {
6197 displayName: "Composite.Context"
6198 })
6199});
6200
6201
6202;// ./node_modules/@ariakit/core/esm/__chunks/RCQ5P4YE.js
6203"use client";
6204
6205
6206
6207
6208// src/disclosure/disclosure-store.ts
6209function createDisclosureStore(props = {}) {
6210 const store = mergeStore(
6211 props.store,
6212 omit2(props.disclosure, ["contentElement", "disclosureElement"])
6213 );
6214 throwOnConflictingProps(props, store);
6215 const syncState = store == null ? void 0 : store.getState();
6216 const open = defaultValue(
6217 props.open,
6218 syncState == null ? void 0 : syncState.open,
6219 props.defaultOpen,
6220 false
6221 );
6222 const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false);
6223 const initialState = {
6224 open,
6225 animated,
6226 animating: !!animated && open,
6227 mounted: open,
6228 contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null),
6229 disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null)
6230 };
6231 const disclosure = createStore(initialState, store);
6232 setup(
6233 disclosure,
6234 () => sync(disclosure, ["animated", "animating"], (state) => {
6235 if (state.animated) return;
6236 disclosure.setState("animating", false);
6237 })
6238 );
6239 setup(
6240 disclosure,
6241 () => subscribe(disclosure, ["open"], () => {
6242 if (!disclosure.getState().animated) return;
6243 disclosure.setState("animating", true);
6244 })
6245 );
6246 setup(
6247 disclosure,
6248 () => sync(disclosure, ["open", "animating"], (state) => {
6249 disclosure.setState("mounted", state.open || state.animating);
6250 })
6251 );
6252 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, disclosure), {
6253 disclosure: props.disclosure,
6254 setOpen: (value) => disclosure.setState("open", value),
6255 show: () => disclosure.setState("open", true),
6256 hide: () => disclosure.setState("open", false),
6257 toggle: () => disclosure.setState("open", (open2) => !open2),
6258 stopAnimation: () => disclosure.setState("animating", false),
6259 setContentElement: (value) => disclosure.setState("contentElement", value),
6260 setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
6261 });
6262}
6263
6264
6265
6266;// ./node_modules/@ariakit/react-core/esm/__chunks/WYCIER3C.js
6267"use client";
6268
6269
6270
6271// src/disclosure/disclosure-store.ts
6272
6273function useDisclosureStoreProps(store, update, props) {
6274 useUpdateEffect(update, [props.store, props.disclosure]);
6275 useStoreProps(store, props, "open", "setOpen");
6276 useStoreProps(store, props, "mounted", "setMounted");
6277 useStoreProps(store, props, "animated");
6278 return Object.assign(store, { disclosure: props.disclosure });
6279}
6280function useDisclosureStore(props = {}) {
6281 const [store, update] = YV4JVR4I_useStore(createDisclosureStore, props);
6282 return useDisclosureStoreProps(store, update, props);
6283}
6284
6285
6286
6287;// ./node_modules/@ariakit/core/esm/__chunks/FZZ2AVHF.js
6288"use client";
6289
6290
6291// src/dialog/dialog-store.ts
6292function createDialogStore(props = {}) {
6293 return createDisclosureStore(props);
6294}
6295
6296
6297
6298;// ./node_modules/@ariakit/react-core/esm/__chunks/BM6PGYQY.js
6299"use client";
6300
6301
6302
6303// src/dialog/dialog-store.ts
6304
6305function useDialogStoreProps(store, update, props) {
6306 return useDisclosureStoreProps(store, update, props);
6307}
6308function useDialogStore(props = {}) {
6309 const [store, update] = YV4JVR4I_useStore(createDialogStore, props);
6310 return useDialogStoreProps(store, update, props);
6311}
6312
6313
6314
6315;// ./node_modules/@ariakit/react-core/esm/__chunks/O2PQ2652.js
6316"use client";
6317
6318
6319
6320
6321// src/popover/popover-store.ts
6322
6323function usePopoverStoreProps(store, update, props) {
6324 useUpdateEffect(update, [props.popover]);
6325 useStoreProps(store, props, "placement");
6326 return useDialogStoreProps(store, update, props);
6327}
6328function usePopoverStore(props = {}) {
6329 const [store, update] = useStore(Core.createPopoverStore, props);
6330 return usePopoverStoreProps(store, update, props);
6331}
6332
6333
6334
6335;// ./node_modules/@ariakit/react-core/esm/__chunks/FTXTWCCT.js
6336"use client";
6337
6338
6339
6340// src/hovercard/hovercard-store.ts
6341
6342function useHovercardStoreProps(store, update, props) {
6343 useStoreProps(store, props, "timeout");
6344 useStoreProps(store, props, "showTimeout");
6345 useStoreProps(store, props, "hideTimeout");
6346 return usePopoverStoreProps(store, update, props);
6347}
6348function useHovercardStore(props = {}) {
6349 const [store, update] = useStore(Core.createHovercardStore, props);
6350 return useHovercardStoreProps(store, update, props);
6351}
6352
6353
6354
6355;// ./node_modules/@ariakit/core/esm/__chunks/ME2CUF3F.js
6356"use client";
6357
6358
6359
6360
6361
6362// src/popover/popover-store.ts
6363function createPopoverStore(_a = {}) {
6364 var _b = _a, {
6365 popover: otherPopover
6366 } = _b, props = _3YLGPPWQ_objRest(_b, [
6367 "popover"
6368 ]);
6369 const store = mergeStore(
6370 props.store,
6371 omit2(otherPopover, [
6372 "arrowElement",
6373 "anchorElement",
6374 "contentElement",
6375 "popoverElement",
6376 "disclosureElement"
6377 ])
6378 );
6379 throwOnConflictingProps(props, store);
6380 const syncState = store == null ? void 0 : store.getState();
6381 const dialog = createDialogStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { store }));
6382 const placement = defaultValue(
6383 props.placement,
6384 syncState == null ? void 0 : syncState.placement,
6385 "bottom"
6386 );
6387 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, dialog.getState()), {
6388 placement,
6389 currentPlacement: placement,
6390 anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null),
6391 popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null),
6392 arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null),
6393 rendered: Symbol("rendered")
6394 });
6395 const popover = createStore(initialState, dialog, store);
6396 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, dialog), popover), {
6397 setAnchorElement: (element) => popover.setState("anchorElement", element),
6398 setPopoverElement: (element) => popover.setState("popoverElement", element),
6399 setArrowElement: (element) => popover.setState("arrowElement", element),
6400 render: () => popover.setState("rendered", Symbol("rendered"))
6401 });
6402}
6403
6404
6405
6406;// ./node_modules/@ariakit/core/esm/__chunks/JTLIIJ4U.js
6407"use client";
6408
6409
6410
6411
6412
6413// src/hovercard/hovercard-store.ts
6414function createHovercardStore(props = {}) {
6415 var _a;
6416 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
6417 const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
6418 placement: defaultValue(
6419 props.placement,
6420 syncState == null ? void 0 : syncState.placement,
6421 "bottom"
6422 )
6423 }));
6424 const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
6425 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, popover.getState()), {
6426 timeout,
6427 showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
6428 hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
6429 autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false)
6430 });
6431 const hovercard = createStore(initialState, popover, props.store);
6432 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, popover), hovercard), {
6433 setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
6434 });
6435}
6436
6437
6438
6439;// ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js
6440"use client";
6441
6442
6443
6444
6445
6446
6447
6448
6449// src/tooltip/tooltip-store.ts
6450function createTooltipStore(props = {}) {
6451 var _a;
6452 if (false) {}
6453 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
6454 const hovercard = createHovercardStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
6455 placement: defaultValue(
6456 props.placement,
6457 syncState == null ? void 0 : syncState.placement,
6458 "top"
6459 ),
6460 hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
6461 }));
6462 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, hovercard.getState()), {
6463 type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"),
6464 skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
6465 });
6466 const tooltip = createStore(initialState, hovercard, props.store);
6467 return _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, hovercard), tooltip);
6468}
6469
6470
6471;// ./node_modules/@ariakit/react-core/esm/__chunks/YTDK2NGG.js
6472"use client";
6473
6474
6475
6476// src/tooltip/tooltip-store.ts
6477
6478function useTooltipStoreProps(store, update, props) {
6479 useStoreProps(store, props, "type");
6480 useStoreProps(store, props, "skipTimeout");
6481 return useHovercardStoreProps(store, update, props);
6482}
6483function useTooltipStore(props = {}) {
6484 const [store, update] = YV4JVR4I_useStore(createTooltipStore, props);
6485 return useTooltipStoreProps(store, update, props);
6486}
6487
6488
6489
6490;// ./node_modules/@ariakit/react-core/esm/__chunks/XL7CSKGW.js
6491"use client";
6492
6493
6494// src/role/role.tsx
6495var XL7CSKGW_TagName = "div";
6496var XL7CSKGW_elements = [
6497 "a",
6498 "button",
6499 "details",
6500 "dialog",
6501 "div",
6502 "form",
6503 "h1",
6504 "h2",
6505 "h3",
6506 "h4",
6507 "h5",
6508 "h6",
6509 "header",
6510 "img",
6511 "input",
6512 "label",
6513 "li",
6514 "nav",
6515 "ol",
6516 "p",
6517 "section",
6518 "select",
6519 "span",
6520 "summary",
6521 "textarea",
6522 "ul",
6523 "svg"
6524];
6525var useRole = createHook(
6526 function useRole2(props) {
6527 return props;
6528 }
6529);
6530var Role = forwardRef2(
6531 // @ts-expect-error
6532 function Role2(props) {
6533 return LMDWO4NN_createElement(XL7CSKGW_TagName, props);
6534 }
6535);
6536Object.assign(
6537 Role,
6538 XL7CSKGW_elements.reduce((acc, element) => {
6539 acc[element] = forwardRef2(function Role3(props) {
6540 return LMDWO4NN_createElement(element, props);
6541 });
6542 return acc;
6543 }, {})
6544);
6545
6546
6547
6548;// ./node_modules/@ariakit/react-core/esm/__chunks/S6EF7IVO.js
6549"use client";
6550
6551
6552// src/disclosure/disclosure-context.tsx
6553var S6EF7IVO_ctx = createStoreContext();
6554var useDisclosureContext = S6EF7IVO_ctx.useContext;
6555var useDisclosureScopedContext = S6EF7IVO_ctx.useScopedContext;
6556var useDisclosureProviderContext = S6EF7IVO_ctx.useProviderContext;
6557var DisclosureContextProvider = S6EF7IVO_ctx.ContextProvider;
6558var DisclosureScopedContextProvider = S6EF7IVO_ctx.ScopedContextProvider;
6559
6560
6561
6562;// ./node_modules/@ariakit/react-core/esm/__chunks/RS7LB2H4.js
6563"use client";
6564
6565
6566
6567// src/dialog/dialog-context.tsx
6568
6569var RS7LB2H4_ctx = createStoreContext(
6570 [DisclosureContextProvider],
6571 [DisclosureScopedContextProvider]
6572);
6573var useDialogContext = RS7LB2H4_ctx.useContext;
6574var useDialogScopedContext = RS7LB2H4_ctx.useScopedContext;
6575var useDialogProviderContext = RS7LB2H4_ctx.useProviderContext;
6576var DialogContextProvider = RS7LB2H4_ctx.ContextProvider;
6577var DialogScopedContextProvider = RS7LB2H4_ctx.ScopedContextProvider;
6578var DialogHeadingContext = (0,external_React_.createContext)(void 0);
6579var DialogDescriptionContext = (0,external_React_.createContext)(void 0);
6580
6581
6582
6583;// ./node_modules/@ariakit/react-core/esm/__chunks/MTZPJQMC.js
6584"use client";
6585
6586
6587
6588// src/popover/popover-context.tsx
6589var MTZPJQMC_ctx = createStoreContext(
6590 [DialogContextProvider],
6591 [DialogScopedContextProvider]
6592);
6593var usePopoverContext = MTZPJQMC_ctx.useContext;
6594var usePopoverScopedContext = MTZPJQMC_ctx.useScopedContext;
6595var usePopoverProviderContext = MTZPJQMC_ctx.useProviderContext;
6596var PopoverContextProvider = MTZPJQMC_ctx.ContextProvider;
6597var PopoverScopedContextProvider = MTZPJQMC_ctx.ScopedContextProvider;
6598
6599
6600
6601;// ./node_modules/@ariakit/react-core/esm/__chunks/EM5CXX6A.js
6602"use client";
6603
6604
6605
6606// src/hovercard/hovercard-context.tsx
6607var EM5CXX6A_ctx = createStoreContext(
6608 [PopoverContextProvider],
6609 [PopoverScopedContextProvider]
6610);
6611var useHovercardContext = EM5CXX6A_ctx.useContext;
6612var useHovercardScopedContext = EM5CXX6A_ctx.useScopedContext;
6613var useHovercardProviderContext = EM5CXX6A_ctx.useProviderContext;
6614var HovercardContextProvider = EM5CXX6A_ctx.ContextProvider;
6615var HovercardScopedContextProvider = EM5CXX6A_ctx.ScopedContextProvider;
6616
6617
6618
6619;// ./node_modules/@ariakit/react-core/esm/__chunks/BYC7LY2E.js
6620"use client";
6621
6622
6623
6624
6625
6626
6627// src/hovercard/hovercard-anchor.tsx
6628
6629
6630
6631var BYC7LY2E_TagName = "a";
6632var useHovercardAnchor = createHook(
6633 function useHovercardAnchor2(_a) {
6634 var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]);
6635 const context = useHovercardProviderContext();
6636 store = store || context;
6637 invariant(
6638 store,
6639 false && 0
6640 );
6641 const disabled = disabledFromProps(props);
6642 const showTimeoutRef = (0,external_React_.useRef)(0);
6643 (0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []);
6644 (0,external_React_.useEffect)(() => {
6645 const onMouseLeave = (event) => {
6646 if (!store) return;
6647 const { anchorElement } = store.getState();
6648 if (!anchorElement) return;
6649 if (event.target !== anchorElement) return;
6650 window.clearTimeout(showTimeoutRef.current);
6651 showTimeoutRef.current = 0;
6652 };
6653 return addGlobalEventListener("mouseleave", onMouseLeave, true);
6654 }, [store]);
6655 const onMouseMoveProp = props.onMouseMove;
6656 const showOnHoverProp = useBooleanEvent(showOnHover);
6657 const isMouseMoving = useIsMouseMoving();
6658 const onMouseMove = useEvent((event) => {
6659 onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
6660 if (disabled) return;
6661 if (!store) return;
6662 if (event.defaultPrevented) return;
6663 if (showTimeoutRef.current) return;
6664 if (!isMouseMoving()) return;
6665 if (!showOnHoverProp(event)) return;
6666 const element = event.currentTarget;
6667 store.setAnchorElement(element);
6668 store.setDisclosureElement(element);
6669 const { showTimeout, timeout } = store.getState();
6670 const showHovercard = () => {
6671 showTimeoutRef.current = 0;
6672 if (!isMouseMoving()) return;
6673 store == null ? void 0 : store.setAnchorElement(element);
6674 store == null ? void 0 : store.show();
6675 queueMicrotask(() => {
6676 store == null ? void 0 : store.setDisclosureElement(element);
6677 });
6678 };
6679 const timeoutMs = showTimeout != null ? showTimeout : timeout;
6680 if (timeoutMs === 0) {
6681 showHovercard();
6682 } else {
6683 showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs);
6684 }
6685 });
6686 const onClickProp = props.onClick;
6687 const onClick = useEvent((event) => {
6688 onClickProp == null ? void 0 : onClickProp(event);
6689 if (!store) return;
6690 window.clearTimeout(showTimeoutRef.current);
6691 showTimeoutRef.current = 0;
6692 });
6693 const ref = (0,external_React_.useCallback)(
6694 (element) => {
6695 if (!store) return;
6696 const { anchorElement } = store.getState();
6697 if (anchorElement == null ? void 0 : anchorElement.isConnected) return;
6698 store.setAnchorElement(element);
6699 },
6700 [store]
6701 );
6702 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
6703 ref: useMergeRefs(ref, props.ref),
6704 onMouseMove,
6705 onClick
6706 });
6707 props = useFocusable(props);
6708 return props;
6709 }
6710);
6711var HovercardAnchor = forwardRef2(function HovercardAnchor2(props) {
6712 const htmlProps = useHovercardAnchor(props);
6713 return LMDWO4NN_createElement(BYC7LY2E_TagName, htmlProps);
6714});
6715
6716
6717
6718;// ./node_modules/@ariakit/react-core/esm/__chunks/F4IYJ42G.js
6719"use client";
6720
6721
6722
6723// src/tooltip/tooltip-context.tsx
6724var F4IYJ42G_ctx = createStoreContext(
6725 [HovercardContextProvider],
6726 [HovercardScopedContextProvider]
6727);
6728var useTooltipContext = F4IYJ42G_ctx.useContext;
6729var useTooltipScopedContext = F4IYJ42G_ctx.useScopedContext;
6730var useTooltipProviderContext = F4IYJ42G_ctx.useProviderContext;
6731var TooltipContextProvider = F4IYJ42G_ctx.ContextProvider;
6732var TooltipScopedContextProvider = F4IYJ42G_ctx.ScopedContextProvider;
6733
6734
6735
6736;// ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js
6737"use client";
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751// src/tooltip/tooltip-anchor.tsx
6752
6753
6754
6755var tooltip_anchor_TagName = "div";
6756var globalStore = createStore({
6757 activeStore: null
6758});
6759function createRemoveStoreCallback(store) {
6760 return () => {
6761 const { activeStore } = globalStore.getState();
6762 if (activeStore !== store) return;
6763 globalStore.setState("activeStore", null);
6764 };
6765}
6766var useTooltipAnchor = createHook(
6767 function useTooltipAnchor2(_a) {
6768 var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]);
6769 const context = useTooltipProviderContext();
6770 store = store || context;
6771 invariant(
6772 store,
6773 false && 0
6774 );
6775 const canShowOnHoverRef = (0,external_React_.useRef)(false);
6776 (0,external_React_.useEffect)(() => {
6777 return sync(store, ["mounted"], (state) => {
6778 if (state.mounted) return;
6779 canShowOnHoverRef.current = false;
6780 });
6781 }, [store]);
6782 (0,external_React_.useEffect)(() => {
6783 if (!store) return;
6784 return chain(
6785 // Immediately remove the current store from the global store when
6786 // the component unmounts. This is useful, for example, to avoid
6787 // showing tooltips immediately on serial tests.
6788 createRemoveStoreCallback(store),
6789 sync(store, ["mounted", "skipTimeout"], (state) => {
6790 if (!store) return;
6791 if (state.mounted) {
6792 const { activeStore } = globalStore.getState();
6793 if (activeStore !== store) {
6794 activeStore == null ? void 0 : activeStore.hide();
6795 }
6796 return globalStore.setState("activeStore", store);
6797 }
6798 const id = setTimeout(
6799 createRemoveStoreCallback(store),
6800 state.skipTimeout
6801 );
6802 return () => clearTimeout(id);
6803 })
6804 );
6805 }, [store]);
6806 const onMouseEnterProp = props.onMouseEnter;
6807 const onMouseEnter = useEvent((event) => {
6808 onMouseEnterProp == null ? void 0 : onMouseEnterProp(event);
6809 canShowOnHoverRef.current = true;
6810 });
6811 const onFocusVisibleProp = props.onFocusVisible;
6812 const onFocusVisible = useEvent((event) => {
6813 onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event);
6814 if (event.defaultPrevented) return;
6815 store == null ? void 0 : store.setAnchorElement(event.currentTarget);
6816 store == null ? void 0 : store.show();
6817 });
6818 const onBlurProp = props.onBlur;
6819 const onBlur = useEvent((event) => {
6820 onBlurProp == null ? void 0 : onBlurProp(event);
6821 if (event.defaultPrevented) return;
6822 const { activeStore } = globalStore.getState();
6823 canShowOnHoverRef.current = false;
6824 if (activeStore === store) {
6825 globalStore.setState("activeStore", null);
6826 }
6827 });
6828 const type = store.useState("type");
6829 const contentId = store.useState((state) => {
6830 var _a2;
6831 return (_a2 = state.contentElement) == null ? void 0 : _a2.id;
6832 });
6833 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
6834 "aria-labelledby": type === "label" ? contentId : void 0
6835 }, props), {
6836 onMouseEnter,
6837 onFocusVisible,
6838 onBlur
6839 });
6840 props = useHovercardAnchor(_3YLGPPWQ_spreadValues({
6841 store,
6842 showOnHover(event) {
6843 if (!canShowOnHoverRef.current) return false;
6844 if (isFalsyBooleanCallback(showOnHover, event)) return false;
6845 const { activeStore } = globalStore.getState();
6846 if (!activeStore) return true;
6847 store == null ? void 0 : store.show();
6848 return false;
6849 }
6850 }, props));
6851 return props;
6852 }
6853);
6854var TooltipAnchor = forwardRef2(function TooltipAnchor2(props) {
6855 const htmlProps = useTooltipAnchor(props);
6856 return LMDWO4NN_createElement(tooltip_anchor_TagName, htmlProps);
6857});
6858
6859
6860;// ./node_modules/@ariakit/react-core/esm/__chunks/X7QOZUD3.js
6861"use client";
6862
6863// src/hovercard/utils/polygon.ts
6864function getEventPoint(event) {
6865 return [event.clientX, event.clientY];
6866}
6867function isPointInPolygon(point, polygon) {
6868 const [x, y] = point;
6869 let inside = false;
6870 const length = polygon.length;
6871 for (let l = length, i = 0, j = l - 1; i < l; j = i++) {
6872 const [xi, yi] = polygon[i];
6873 const [xj, yj] = polygon[j];
6874 const [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0];
6875 const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi);
6876 if (yj < yi) {
6877 if (y >= yj && y < yi) {
6878 if (where === 0) return true;
6879 if (where > 0) {
6880 if (y === yj) {
6881 if (y > vy) {
6882 inside = !inside;
6883 }
6884 } else {
6885 inside = !inside;
6886 }
6887 }
6888 }
6889 } else if (yi < yj) {
6890 if (y > yi && y <= yj) {
6891 if (where === 0) return true;
6892 if (where < 0) {
6893 if (y === yj) {
6894 if (y < vy) {
6895 inside = !inside;
6896 }
6897 } else {
6898 inside = !inside;
6899 }
6900 }
6901 }
6902 } else if (y === yi && (x >= xj && x <= xi || x >= xi && x <= xj)) {
6903 return true;
6904 }
6905 }
6906 return inside;
6907}
6908function getEnterPointPlacement(enterPoint, rect) {
6909 const { top, right, bottom, left } = rect;
6910 const [x, y] = enterPoint;
6911 const placementX = x < left ? "left" : x > right ? "right" : null;
6912 const placementY = y < top ? "top" : y > bottom ? "bottom" : null;
6913 return [placementX, placementY];
6914}
6915function getElementPolygon(element, enterPoint) {
6916 const rect = element.getBoundingClientRect();
6917 const { top, right, bottom, left } = rect;
6918 const [x, y] = getEnterPointPlacement(enterPoint, rect);
6919 const polygon = [enterPoint];
6920 if (x) {
6921 if (y !== "top") {
6922 polygon.push([x === "left" ? left : right, top]);
6923 }
6924 polygon.push([x === "left" ? right : left, top]);
6925 polygon.push([x === "left" ? right : left, bottom]);
6926 if (y !== "bottom") {
6927 polygon.push([x === "left" ? left : right, bottom]);
6928 }
6929 } else if (y === "top") {
6930 polygon.push([left, top]);
6931 polygon.push([left, bottom]);
6932 polygon.push([right, bottom]);
6933 polygon.push([right, top]);
6934 } else {
6935 polygon.push([left, bottom]);
6936 polygon.push([left, top]);
6937 polygon.push([right, top]);
6938 polygon.push([right, bottom]);
6939 }
6940 return polygon;
6941}
6942
6943
6944
6945;// ./node_modules/@ariakit/react-core/esm/__chunks/63XF7ACK.js
6946"use client";
6947
6948// src/dialog/utils/is-backdrop.ts
6949function _63XF7ACK_isBackdrop(element, ...ids) {
6950 if (!element) return false;
6951 const backdrop = element.getAttribute("data-backdrop");
6952 if (backdrop == null) return false;
6953 if (backdrop === "") return true;
6954 if (backdrop === "true") return true;
6955 if (!ids.length) return true;
6956 return ids.some((id) => backdrop === id);
6957}
6958
6959
6960
6961;// ./node_modules/@ariakit/react-core/esm/__chunks/K2ZF5NU7.js
6962"use client";
6963
6964// src/dialog/utils/orchestrate.ts
6965var cleanups = /* @__PURE__ */ new WeakMap();
6966function orchestrate(element, key, setup) {
6967 if (!cleanups.has(element)) {
6968 cleanups.set(element, /* @__PURE__ */ new Map());
6969 }
6970 const elementCleanups = cleanups.get(element);
6971 const prevCleanup = elementCleanups.get(key);
6972 if (!prevCleanup) {
6973 elementCleanups.set(key, setup());
6974 return () => {
6975 var _a;
6976 (_a = elementCleanups.get(key)) == null ? void 0 : _a();
6977 elementCleanups.delete(key);
6978 };
6979 }
6980 const cleanup = setup();
6981 const nextCleanup = () => {
6982 cleanup();
6983 prevCleanup();
6984 elementCleanups.delete(key);
6985 };
6986 elementCleanups.set(key, nextCleanup);
6987 return () => {
6988 const isCurrent = elementCleanups.get(key) === nextCleanup;
6989 if (!isCurrent) return;
6990 cleanup();
6991 elementCleanups.set(key, prevCleanup);
6992 };
6993}
6994function setAttribute(element, attr, value) {
6995 const setup = () => {
6996 const previousValue = element.getAttribute(attr);
6997 element.setAttribute(attr, value);
6998 return () => {
6999 if (previousValue == null) {
7000 element.removeAttribute(attr);
7001 } else {
7002 element.setAttribute(attr, previousValue);
7003 }
7004 };
7005 };
7006 return orchestrate(element, attr, setup);
7007}
7008function setProperty(element, property, value) {
7009 const setup = () => {
7010 const exists = property in element;
7011 const previousValue = element[property];
7012 element[property] = value;
7013 return () => {
7014 if (!exists) {
7015 delete element[property];
7016 } else {
7017 element[property] = previousValue;
7018 }
7019 };
7020 };
7021 return orchestrate(element, property, setup);
7022}
7023function assignStyle(element, style) {
7024 if (!element) return () => {
7025 };
7026 const setup = () => {
7027 const prevStyle = element.style.cssText;
7028 Object.assign(element.style, style);
7029 return () => {
7030 element.style.cssText = prevStyle;
7031 };
7032 };
7033 return orchestrate(element, "style", setup);
7034}
7035function setCSSProperty(element, property, value) {
7036 if (!element) return () => {
7037 };
7038 const setup = () => {
7039 const previousValue = element.style.getPropertyValue(property);
7040 element.style.setProperty(property, value);
7041 return () => {
7042 if (previousValue) {
7043 element.style.setProperty(property, previousValue);
7044 } else {
7045 element.style.removeProperty(property);
7046 }
7047 };
7048 };
7049 return orchestrate(element, property, setup);
7050}
7051
7052
7053
7054;// ./node_modules/@ariakit/react-core/esm/__chunks/AOUGVQZ3.js
7055"use client";
7056
7057
7058// src/dialog/utils/walk-tree-outside.ts
7059
7060
7061var ignoreTags = ["SCRIPT", "STYLE"];
7062function getSnapshotPropertyName(id) {
7063 return `__ariakit-dialog-snapshot-${id}`;
7064}
7065function inSnapshot(id, element) {
7066 const doc = getDocument(element);
7067 const propertyName = getSnapshotPropertyName(id);
7068 if (!doc.body[propertyName]) return true;
7069 do {
7070 if (element === doc.body) return false;
7071 if (element[propertyName]) return true;
7072 if (!element.parentElement) return false;
7073 element = element.parentElement;
7074 } while (true);
7075}
7076function isValidElement(id, element, ignoredElements) {
7077 if (ignoreTags.includes(element.tagName)) return false;
7078 if (!inSnapshot(id, element)) return false;
7079 return !ignoredElements.some(
7080 (enabledElement) => enabledElement && contains(element, enabledElement)
7081 );
7082}
7083function AOUGVQZ3_walkTreeOutside(id, elements, callback, ancestorCallback) {
7084 for (let element of elements) {
7085 if (!(element == null ? void 0 : element.isConnected)) continue;
7086 const hasAncestorAlready = elements.some((maybeAncestor) => {
7087 if (!maybeAncestor) return false;
7088 if (maybeAncestor === element) return false;
7089 return maybeAncestor.contains(element);
7090 });
7091 const doc = getDocument(element);
7092 const originalElement = element;
7093 while (element.parentElement && element !== doc.body) {
7094 ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement);
7095 if (!hasAncestorAlready) {
7096 for (const child of element.parentElement.children) {
7097 if (isValidElement(id, child, elements)) {
7098 callback(child, originalElement);
7099 }
7100 }
7101 }
7102 element = element.parentElement;
7103 }
7104 }
7105}
7106function createWalkTreeSnapshot(id, elements) {
7107 const { body } = getDocument(elements[0]);
7108 const cleanups = [];
7109 const markElement = (element) => {
7110 cleanups.push(setProperty(element, getSnapshotPropertyName(id), true));
7111 };
7112 AOUGVQZ3_walkTreeOutside(id, elements, markElement);
7113 return chain(setProperty(body, getSnapshotPropertyName(id), true), () => {
7114 for (const cleanup of cleanups) {
7115 cleanup();
7116 }
7117 });
7118}
7119
7120
7121
7122;// ./node_modules/@ariakit/react-core/esm/__chunks/2PGBN2Y4.js
7123"use client";
7124
7125
7126
7127
7128// src/dialog/utils/mark-tree-outside.ts
7129
7130function getPropertyName(id = "", ancestor = false) {
7131 return `__ariakit-dialog-${ancestor ? "ancestor" : "outside"}${id ? `-${id}` : ""}`;
7132}
7133function markElement(element, id = "") {
7134 return chain(
7135 setProperty(element, getPropertyName(), true),
7136 setProperty(element, getPropertyName(id), true)
7137 );
7138}
7139function markAncestor(element, id = "") {
7140 return chain(
7141 setProperty(element, getPropertyName("", true), true),
7142 setProperty(element, getPropertyName(id, true), true)
7143 );
7144}
7145function isElementMarked(element, id) {
7146 const ancestorProperty = getPropertyName(id, true);
7147 if (element[ancestorProperty]) return true;
7148 const elementProperty = getPropertyName(id);
7149 do {
7150 if (element[elementProperty]) return true;
7151 if (!element.parentElement) return false;
7152 element = element.parentElement;
7153 } while (true);
7154}
7155function markTreeOutside(id, elements) {
7156 const cleanups = [];
7157 const ids = elements.map((el) => el == null ? void 0 : el.id);
7158 AOUGVQZ3_walkTreeOutside(
7159 id,
7160 elements,
7161 (element) => {
7162 if (_63XF7ACK_isBackdrop(element, ...ids)) return;
7163 cleanups.unshift(markElement(element, id));
7164 },
7165 (ancestor, element) => {
7166 const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id;
7167 if (isAnotherDialogAncestor) return;
7168 cleanups.unshift(markAncestor(ancestor, id));
7169 }
7170 );
7171 const restoreAccessibilityTree = () => {
7172 for (const cleanup of cleanups) {
7173 cleanup();
7174 }
7175 };
7176 return restoreAccessibilityTree;
7177}
7178
7179
7180
7181;// external "ReactDOM"
7182const external_ReactDOM_namespaceObject = window["ReactDOM"];
7183;// ./node_modules/@ariakit/react-core/esm/__chunks/VGCJ63VH.js
7184"use client";
7185
7186
7187
7188
7189
7190
7191
7192// src/disclosure/disclosure-content.tsx
7193
7194
7195
7196
7197var VGCJ63VH_TagName = "div";
7198function afterTimeout(timeoutMs, cb) {
7199 const timeoutId = setTimeout(cb, timeoutMs);
7200 return () => clearTimeout(timeoutId);
7201}
7202function VGCJ63VH_afterPaint(cb) {
7203 let raf = requestAnimationFrame(() => {
7204 raf = requestAnimationFrame(cb);
7205 });
7206 return () => cancelAnimationFrame(raf);
7207}
7208function parseCSSTime(...times) {
7209 return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
7210 const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
7211 const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
7212 if (currentTime > longestTime) return currentTime;
7213 return longestTime;
7214 }, 0);
7215}
7216function isHidden(mounted, hidden, alwaysVisible) {
7217 return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
7218}
7219var useDisclosureContent = createHook(function useDisclosureContent2(_a) {
7220 var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
7221 const context = useDisclosureProviderContext();
7222 store = store || context;
7223 invariant(
7224 store,
7225 false && 0
7226 );
7227 const ref = (0,external_React_.useRef)(null);
7228 const id = useId(props.id);
7229 const [transition, setTransition] = (0,external_React_.useState)(null);
7230 const open = store.useState("open");
7231 const mounted = store.useState("mounted");
7232 const animated = store.useState("animated");
7233 const contentElement = store.useState("contentElement");
7234 const otherElement = useStoreState(store.disclosure, "contentElement");
7235 useSafeLayoutEffect(() => {
7236 if (!ref.current) return;
7237 store == null ? void 0 : store.setContentElement(ref.current);
7238 }, [store]);
7239 useSafeLayoutEffect(() => {
7240 let previousAnimated;
7241 store == null ? void 0 : store.setState("animated", (animated2) => {
7242 previousAnimated = animated2;
7243 return true;
7244 });
7245 return () => {
7246 if (previousAnimated === void 0) return;
7247 store == null ? void 0 : store.setState("animated", previousAnimated);
7248 };
7249 }, [store]);
7250 useSafeLayoutEffect(() => {
7251 if (!animated) return;
7252 if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
7253 setTransition(null);
7254 return;
7255 }
7256 return VGCJ63VH_afterPaint(() => {
7257 setTransition(open ? "enter" : mounted ? "leave" : null);
7258 });
7259 }, [animated, contentElement, open, mounted]);
7260 useSafeLayoutEffect(() => {
7261 if (!store) return;
7262 if (!animated) return;
7263 if (!transition) return;
7264 if (!contentElement) return;
7265 const stopAnimation = () => store == null ? void 0 : store.setState("animating", false);
7266 const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation);
7267 if (transition === "leave" && open) return;
7268 if (transition === "enter" && !open) return;
7269 if (typeof animated === "number") {
7270 const timeout2 = animated;
7271 return afterTimeout(timeout2, stopAnimationSync);
7272 }
7273 const {
7274 transitionDuration,
7275 animationDuration,
7276 transitionDelay,
7277 animationDelay
7278 } = getComputedStyle(contentElement);
7279 const {
7280 transitionDuration: transitionDuration2 = "0",
7281 animationDuration: animationDuration2 = "0",
7282 transitionDelay: transitionDelay2 = "0",
7283 animationDelay: animationDelay2 = "0"
7284 } = otherElement ? getComputedStyle(otherElement) : {};
7285 const delay = parseCSSTime(
7286 transitionDelay,
7287 animationDelay,
7288 transitionDelay2,
7289 animationDelay2
7290 );
7291 const duration = parseCSSTime(
7292 transitionDuration,
7293 animationDuration,
7294 transitionDuration2,
7295 animationDuration2
7296 );
7297 const timeout = delay + duration;
7298 if (!timeout) {
7299 if (transition === "enter") {
7300 store.setState("animated", false);
7301 }
7302 stopAnimation();
7303 return;
7304 }
7305 const frameRate = 1e3 / 60;
7306 const maxTimeout = Math.max(timeout - frameRate, 0);
7307 return afterTimeout(maxTimeout, stopAnimationSync);
7308 }, [store, animated, contentElement, otherElement, open, transition]);
7309 props = useWrapElement(
7310 props,
7311 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }),
7312 [store]
7313 );
7314 const hidden = isHidden(mounted, props.hidden, alwaysVisible);
7315 const styleProp = props.style;
7316 const style = (0,external_React_.useMemo)(() => {
7317 if (hidden) {
7318 return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" });
7319 }
7320 return styleProp;
7321 }, [hidden, styleProp]);
7322 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
7323 id,
7324 "data-open": open || void 0,
7325 "data-enter": transition === "enter" || void 0,
7326 "data-leave": transition === "leave" || void 0,
7327 hidden
7328 }, props), {
7329 ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref),
7330 style
7331 });
7332 return removeUndefinedValues(props);
7333});
7334var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) {
7335 const htmlProps = useDisclosureContent(props);
7336 return LMDWO4NN_createElement(VGCJ63VH_TagName, htmlProps);
7337});
7338var DisclosureContent = forwardRef2(function DisclosureContent2(_a) {
7339 var _b = _a, {
7340 unmountOnHide
7341 } = _b, props = __objRest(_b, [
7342 "unmountOnHide"
7343 ]);
7344 const context = useDisclosureProviderContext();
7345 const store = props.store || context;
7346 const mounted = useStoreState(
7347 store,
7348 (state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
7349 );
7350 if (mounted === false) return null;
7351 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _3YLGPPWQ_spreadValues({}, props));
7352});
7353
7354
7355
7356;// ./node_modules/@ariakit/react-core/esm/__chunks/63FEHJZV.js
7357"use client";
7358
7359
7360
7361
7362
7363
7364
7365
7366// src/dialog/dialog-backdrop.tsx
7367
7368
7369function DialogBackdrop({
7370 store,
7371 backdrop,
7372 alwaysVisible,
7373 hidden
7374}) {
7375 const ref = (0,external_React_.useRef)(null);
7376 const disclosure = useDisclosureStore({ disclosure: store });
7377 const contentElement = useStoreState(store, "contentElement");
7378 (0,external_React_.useEffect)(() => {
7379 const backdrop2 = ref.current;
7380 const dialog = contentElement;
7381 if (!backdrop2) return;
7382 if (!dialog) return;
7383 backdrop2.style.zIndex = getComputedStyle(dialog).zIndex;
7384 }, [contentElement]);
7385 useSafeLayoutEffect(() => {
7386 const id = contentElement == null ? void 0 : contentElement.id;
7387 if (!id) return;
7388 const backdrop2 = ref.current;
7389 if (!backdrop2) return;
7390 return markAncestor(backdrop2, id);
7391 }, [contentElement]);
7392 const props = useDisclosureContent({
7393 ref,
7394 store: disclosure,
7395 role: "presentation",
7396 "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "",
7397 alwaysVisible,
7398 hidden: hidden != null ? hidden : void 0,
7399 style: {
7400 position: "fixed",
7401 top: 0,
7402 right: 0,
7403 bottom: 0,
7404 left: 0
7405 }
7406 });
7407 if (!backdrop) return null;
7408 if ((0,external_React_.isValidElement)(backdrop)) {
7409 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: backdrop }));
7410 }
7411 const Component = typeof backdrop !== "boolean" ? backdrop : "div";
7412 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {}) }));
7413}
7414
7415
7416
7417;// ./node_modules/@ariakit/react-core/esm/__chunks/IGR4SXG2.js
7418"use client";
7419
7420// src/dialog/utils/is-focus-trap.ts
7421function isFocusTrap(element, ...ids) {
7422 if (!element) return false;
7423 const attr = element.getAttribute("data-focus-trap");
7424 if (attr == null) return false;
7425 if (!ids.length) return true;
7426 if (attr === "") return false;
7427 return ids.some((id) => attr === id);
7428}
7429
7430
7431
7432;// ./node_modules/@ariakit/react-core/esm/__chunks/ESSM74HH.js
7433"use client";
7434
7435
7436
7437
7438// src/dialog/utils/disable-accessibility-tree-outside.ts
7439function hideElementFromAccessibilityTree(element) {
7440 return setAttribute(element, "aria-hidden", "true");
7441}
7442function disableAccessibilityTreeOutside(id, elements) {
7443 const cleanups = [];
7444 const ids = elements.map((el) => el == null ? void 0 : el.id);
7445 walkTreeOutside(id, elements, (element) => {
7446 if (isBackdrop(element, ...ids)) return;
7447 cleanups.unshift(hideElementFromAccessibilityTree(element));
7448 });
7449 const restoreAccessibilityTree = () => {
7450 for (const cleanup of cleanups) {
7451 cleanup();
7452 }
7453 };
7454 return restoreAccessibilityTree;
7455}
7456
7457
7458
7459;// ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js
7460"use client";
7461
7462// src/dialog/utils/supports-inert.ts
7463function supportsInert() {
7464 return "inert" in HTMLElement.prototype;
7465}
7466
7467
7468
7469;// ./node_modules/@ariakit/react-core/esm/__chunks/KZAQFFOU.js
7470"use client";
7471
7472
7473
7474
7475
7476
7477
7478// src/dialog/utils/disable-tree.ts
7479
7480
7481
7482function disableTree(element, ignoredElements) {
7483 if (!("style" in element)) return PBFD2E7P_noop;
7484 if (supportsInert()) {
7485 return setProperty(element, "inert", true);
7486 }
7487 const tabbableElements = getAllTabbableIn(element, true);
7488 const enableElements = tabbableElements.map((element2) => {
7489 if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) return PBFD2E7P_noop;
7490 const restoreFocusMethod = orchestrate(element2, "focus", () => {
7491 element2.focus = PBFD2E7P_noop;
7492 return () => {
7493 delete element2.focus;
7494 };
7495 });
7496 return chain(setAttribute(element2, "tabindex", "-1"), restoreFocusMethod);
7497 });
7498 return chain(
7499 ...enableElements,
7500 hideElementFromAccessibilityTree(element),
7501 assignStyle(element, {
7502 pointerEvents: "none",
7503 userSelect: "none",
7504 cursor: "default"
7505 })
7506 );
7507}
7508function disableTreeOutside(id, elements) {
7509 const cleanups = [];
7510 const ids = elements.map((el) => el == null ? void 0 : el.id);
7511 AOUGVQZ3_walkTreeOutside(
7512 id,
7513 elements,
7514 (element) => {
7515 if (_63XF7ACK_isBackdrop(element, ...ids)) return;
7516 if (isFocusTrap(element, ...ids)) return;
7517 cleanups.unshift(disableTree(element, elements));
7518 },
7519 (element) => {
7520 if (!element.hasAttribute("role")) return;
7521 if (elements.some((el) => el && contains(el, element))) return;
7522 cleanups.unshift(setAttribute(element, "role", "none"));
7523 }
7524 );
7525 const restoreTreeOutside = () => {
7526 for (const cleanup of cleanups) {
7527 cleanup();
7528 }
7529 };
7530 return restoreTreeOutside;
7531}
7532
7533
7534
7535;// ./node_modules/@ariakit/react-core/esm/__chunks/YKJECYU7.js
7536"use client";
7537
7538
7539// src/dialog/utils/use-root-dialog.ts
7540
7541
7542
7543function useRootDialog({
7544 attribute,
7545 contentId,
7546 contentElement,
7547 enabled
7548}) {
7549 const [updated, retry] = useForceUpdate();
7550 const isRootDialog = (0,external_React_.useCallback)(() => {
7551 if (!enabled) return false;
7552 if (!contentElement) return false;
7553 const { body } = getDocument(contentElement);
7554 const id = body.getAttribute(attribute);
7555 return !id || id === contentId;
7556 }, [updated, enabled, contentElement, attribute, contentId]);
7557 (0,external_React_.useEffect)(() => {
7558 if (!enabled) return;
7559 if (!contentId) return;
7560 if (!contentElement) return;
7561 const { body } = getDocument(contentElement);
7562 if (isRootDialog()) {
7563 body.setAttribute(attribute, contentId);
7564 return () => body.removeAttribute(attribute);
7565 }
7566 const observer = new MutationObserver(() => (0,external_ReactDOM_namespaceObject.flushSync)(retry));
7567 observer.observe(body, { attributeFilter: [attribute] });
7568 return () => observer.disconnect();
7569 }, [updated, enabled, contentId, contentElement, isRootDialog, attribute]);
7570 return isRootDialog;
7571}
7572
7573
7574
7575;// ./node_modules/@ariakit/react-core/esm/__chunks/BGQ3KQ5M.js
7576"use client";
7577
7578
7579
7580// src/dialog/utils/use-prevent-body-scroll.ts
7581
7582
7583
7584
7585function getPaddingProperty(documentElement) {
7586 const documentLeft = documentElement.getBoundingClientRect().left;
7587 const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft;
7588 return scrollbarX ? "paddingLeft" : "paddingRight";
7589}
7590function usePreventBodyScroll(contentElement, contentId, enabled) {
7591 const isRootDialog = useRootDialog({
7592 attribute: "data-dialog-prevent-body-scroll",
7593 contentElement,
7594 contentId,
7595 enabled
7596 });
7597 (0,external_React_.useEffect)(() => {
7598 if (!isRootDialog()) return;
7599 if (!contentElement) return;
7600 const doc = getDocument(contentElement);
7601 const win = getWindow(contentElement);
7602 const { documentElement, body } = doc;
7603 const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width");
7604 const scrollbarWidth = cssScrollbarWidth ? Number.parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth;
7605 const setScrollbarWidthProperty = () => setCSSProperty(
7606 documentElement,
7607 "--scrollbar-width",
7608 `${scrollbarWidth}px`
7609 );
7610 const paddingProperty = getPaddingProperty(documentElement);
7611 const setStyle = () => assignStyle(body, {
7612 overflow: "hidden",
7613 [paddingProperty]: `${scrollbarWidth}px`
7614 });
7615 const setIOSStyle = () => {
7616 var _a, _b;
7617 const { scrollX, scrollY, visualViewport } = win;
7618 const offsetLeft = (_a = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a : 0;
7619 const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0;
7620 const restoreStyle = assignStyle(body, {
7621 position: "fixed",
7622 overflow: "hidden",
7623 top: `${-(scrollY - Math.floor(offsetTop))}px`,
7624 left: `${-(scrollX - Math.floor(offsetLeft))}px`,
7625 right: "0",
7626 [paddingProperty]: `${scrollbarWidth}px`
7627 });
7628 return () => {
7629 restoreStyle();
7630 if (true) {
7631 win.scrollTo({ left: scrollX, top: scrollY, behavior: "instant" });
7632 }
7633 };
7634 };
7635 const isIOS = isApple() && !isMac();
7636 return chain(
7637 setScrollbarWidthProperty(),
7638 isIOS ? setIOSStyle() : setStyle()
7639 );
7640 }, [isRootDialog, contentElement]);
7641}
7642
7643
7644
7645;// ./node_modules/@ariakit/react-core/esm/__chunks/TOU75OXH.js
7646"use client";
7647
7648
7649// src/dialog/utils/use-nested-dialogs.tsx
7650
7651
7652
7653
7654var NestedDialogsContext = (0,external_React_.createContext)({});
7655function useNestedDialogs(store) {
7656 const context = (0,external_React_.useContext)(NestedDialogsContext);
7657 const [dialogs, setDialogs] = (0,external_React_.useState)([]);
7658 const add = (0,external_React_.useCallback)(
7659 (dialog) => {
7660 var _a;
7661 setDialogs((dialogs2) => [...dialogs2, dialog]);
7662 return chain((_a = context.add) == null ? void 0 : _a.call(context, dialog), () => {
7663 setDialogs((dialogs2) => dialogs2.filter((d) => d !== dialog));
7664 });
7665 },
7666 [context]
7667 );
7668 useSafeLayoutEffect(() => {
7669 return sync(store, ["open", "contentElement"], (state) => {
7670 var _a;
7671 if (!state.open) return;
7672 if (!state.contentElement) return;
7673 return (_a = context.add) == null ? void 0 : _a.call(context, store);
7674 });
7675 }, [store, context]);
7676 const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]);
7677 const wrapElement = (0,external_React_.useCallback)(
7678 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }),
7679 [providerValue]
7680 );
7681 return { wrapElement, nestedDialogs: dialogs };
7682}
7683
7684
7685
7686;// ./node_modules/@ariakit/react-core/esm/__chunks/HLTQOHKZ.js
7687"use client";
7688
7689// src/dialog/utils/use-previous-mouse-down-ref.ts
7690
7691
7692function usePreviousMouseDownRef(enabled) {
7693 const previousMouseDownRef = (0,external_React_.useRef)();
7694 (0,external_React_.useEffect)(() => {
7695 if (!enabled) {
7696 previousMouseDownRef.current = null;
7697 return;
7698 }
7699 const onMouseDown = (event) => {
7700 previousMouseDownRef.current = event.target;
7701 };
7702 return addGlobalEventListener("mousedown", onMouseDown, true);
7703 }, [enabled]);
7704 return previousMouseDownRef;
7705}
7706
7707
7708
7709;// ./node_modules/@ariakit/react-core/esm/__chunks/WBDYNH73.js
7710"use client";
7711
7712
7713
7714
7715
7716
7717
7718// src/dialog/utils/use-hide-on-interact-outside.ts
7719
7720
7721
7722function isInDocument(target) {
7723 if (target.tagName === "HTML") return true;
7724 return contains(getDocument(target).body, target);
7725}
7726function isDisclosure(disclosure, target) {
7727 if (!disclosure) return false;
7728 if (contains(disclosure, target)) return true;
7729 const activeId = target.getAttribute("aria-activedescendant");
7730 if (activeId) {
7731 const activeElement = getDocument(disclosure).getElementById(activeId);
7732 if (activeElement) {
7733 return contains(disclosure, activeElement);
7734 }
7735 }
7736 return false;
7737}
7738function isMouseEventOnDialog(event, dialog) {
7739 if (!("clientY" in event)) return false;
7740 const rect = dialog.getBoundingClientRect();
7741 if (rect.width === 0 || rect.height === 0) return false;
7742 return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
7743}
7744function useEventOutside({
7745 store,
7746 type,
7747 listener,
7748 capture,
7749 domReady
7750}) {
7751 const callListener = useEvent(listener);
7752 const open = useStoreState(store, "open");
7753 const focusedRef = (0,external_React_.useRef)(false);
7754 useSafeLayoutEffect(() => {
7755 if (!open) return;
7756 if (!domReady) return;
7757 const { contentElement } = store.getState();
7758 if (!contentElement) return;
7759 const onFocus = () => {
7760 focusedRef.current = true;
7761 };
7762 contentElement.addEventListener("focusin", onFocus, true);
7763 return () => contentElement.removeEventListener("focusin", onFocus, true);
7764 }, [store, open, domReady]);
7765 (0,external_React_.useEffect)(() => {
7766 if (!open) return;
7767 const onEvent = (event) => {
7768 const { contentElement, disclosureElement } = store.getState();
7769 const target = event.target;
7770 if (!contentElement) return;
7771 if (!target) return;
7772 if (!isInDocument(target)) return;
7773 if (contains(contentElement, target)) return;
7774 if (isDisclosure(disclosureElement, target)) return;
7775 if (target.hasAttribute("data-focus-trap")) return;
7776 if (isMouseEventOnDialog(event, contentElement)) return;
7777 const focused = focusedRef.current;
7778 if (focused && !isElementMarked(target, contentElement.id)) return;
7779 if (isSafariFocusAncestor(target)) return;
7780 callListener(event);
7781 };
7782 return addGlobalEventListener(type, onEvent, capture);
7783 }, [open, capture]);
7784}
7785function shouldHideOnInteractOutside(hideOnInteractOutside, event) {
7786 if (typeof hideOnInteractOutside === "function") {
7787 return hideOnInteractOutside(event);
7788 }
7789 return !!hideOnInteractOutside;
7790}
7791function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) {
7792 const open = useStoreState(store, "open");
7793 const previousMouseDownRef = usePreviousMouseDownRef(open);
7794 const props = { store, domReady, capture: true };
7795 useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
7796 type: "click",
7797 listener: (event) => {
7798 const { contentElement } = store.getState();
7799 const previousMouseDown = previousMouseDownRef.current;
7800 if (!previousMouseDown) return;
7801 if (!isVisible(previousMouseDown)) return;
7802 if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) return;
7803 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
7804 store.hide();
7805 }
7806 }));
7807 useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
7808 type: "focusin",
7809 listener: (event) => {
7810 const { contentElement } = store.getState();
7811 if (!contentElement) return;
7812 if (event.target === getDocument(contentElement)) return;
7813 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
7814 store.hide();
7815 }
7816 }));
7817 useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
7818 type: "contextmenu",
7819 listener: (event) => {
7820 if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return;
7821 store.hide();
7822 }
7823 }));
7824}
7825
7826
7827
7828;// ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js
7829"use client";
7830
7831// src/dialog/utils/prepend-hidden-dismiss.ts
7832
7833function prependHiddenDismiss(container, onClick) {
7834 const document = getDocument(container);
7835 const button = document.createElement("button");
7836 button.type = "button";
7837 button.tabIndex = -1;
7838 button.textContent = "Dismiss popup";
7839 Object.assign(button.style, {
7840 border: "0px",
7841 clip: "rect(0 0 0 0)",
7842 height: "1px",
7843 margin: "-1px",
7844 overflow: "hidden",
7845 padding: "0px",
7846 position: "absolute",
7847 whiteSpace: "nowrap",
7848 width: "1px"
7849 });
7850 button.addEventListener("click", onClick);
7851 container.prepend(button);
7852 const removeHiddenDismiss = () => {
7853 button.removeEventListener("click", onClick);
7854 button.remove();
7855 };
7856 return removeHiddenDismiss;
7857}
7858
7859
7860
7861;// ./node_modules/@ariakit/react-core/esm/__chunks/ZWYATQFU.js
7862"use client";
7863
7864
7865
7866
7867
7868// src/focusable/focusable-container.tsx
7869
7870var ZWYATQFU_TagName = "div";
7871var useFocusableContainer = createHook(function useFocusableContainer2(_a) {
7872 var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]);
7873 props = useWrapElement(
7874 props,
7875 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }),
7876 [autoFocusOnShow]
7877 );
7878 return props;
7879});
7880var FocusableContainer = forwardRef2(function FocusableContainer2(props) {
7881 const htmlProps = useFocusableContainer(props);
7882 return LMDWO4NN_createElement(ZWYATQFU_TagName, htmlProps);
7883});
7884
7885
7886
7887;// ./node_modules/@ariakit/react-core/esm/__chunks/CZ4GFWYL.js
7888"use client";
7889
7890// src/heading/heading-context.tsx
7891
7892var HeadingContext = (0,external_React_.createContext)(0);
7893
7894
7895
7896;// ./node_modules/@ariakit/react-core/esm/__chunks/5M6RIVE2.js
7897"use client";
7898
7899
7900// src/heading/heading-level.tsx
7901
7902
7903function HeadingLevel({ level, children }) {
7904 const contextLevel = (0,external_React_.useContext)(HeadingContext);
7905 const nextLevel = Math.max(
7906 Math.min(level || contextLevel + 1, 6),
7907 1
7908 );
7909 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingContext.Provider, { value: nextLevel, children });
7910}
7911
7912
7913
7914;// ./node_modules/@ariakit/react-core/esm/__chunks/XX67R432.js
7915"use client";
7916
7917
7918
7919// src/visually-hidden/visually-hidden.tsx
7920var XX67R432_TagName = "span";
7921var useVisuallyHidden = createHook(
7922 function useVisuallyHidden2(props) {
7923 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
7924 style: _3YLGPPWQ_spreadValues({
7925 border: 0,
7926 clip: "rect(0 0 0 0)",
7927 height: "1px",
7928 margin: "-1px",
7929 overflow: "hidden",
7930 padding: 0,
7931 position: "absolute",
7932 whiteSpace: "nowrap",
7933 width: "1px"
7934 }, props.style)
7935 });
7936 return props;
7937 }
7938);
7939var VisuallyHidden = forwardRef2(function VisuallyHidden2(props) {
7940 const htmlProps = useVisuallyHidden(props);
7941 return LMDWO4NN_createElement(XX67R432_TagName, htmlProps);
7942});
7943
7944
7945
7946;// ./node_modules/@ariakit/react-core/esm/__chunks/W3VI7GFU.js
7947"use client";
7948
7949
7950
7951
7952// src/focus-trap/focus-trap.tsx
7953var W3VI7GFU_TagName = "span";
7954var useFocusTrap = createHook(
7955 function useFocusTrap2(props) {
7956 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
7957 "data-focus-trap": "",
7958 tabIndex: 0,
7959 "aria-hidden": true
7960 }, props), {
7961 style: _3YLGPPWQ_spreadValues({
7962 // Prevents unintended scroll jumps.
7963 position: "fixed",
7964 top: 0,
7965 left: 0
7966 }, props.style)
7967 });
7968 props = useVisuallyHidden(props);
7969 return props;
7970 }
7971);
7972var FocusTrap = forwardRef2(function FocusTrap2(props) {
7973 const htmlProps = useFocusTrap(props);
7974 return LMDWO4NN_createElement(W3VI7GFU_TagName, htmlProps);
7975});
7976
7977
7978
7979;// ./node_modules/@ariakit/react-core/esm/__chunks/AOQQTIBO.js
7980"use client";
7981
7982// src/portal/portal-context.tsx
7983
7984var PortalContext = (0,external_React_.createContext)(null);
7985
7986
7987
7988;// ./node_modules/@ariakit/react-core/esm/__chunks/O37CNYMR.js
7989"use client";
7990
7991
7992
7993
7994
7995
7996
7997// src/portal/portal.tsx
7998
7999
8000
8001
8002
8003
8004var O37CNYMR_TagName = "div";
8005function getRootElement(element) {
8006 return getDocument(element).body;
8007}
8008function getPortalElement(element, portalElement) {
8009 if (!portalElement) {
8010 return getDocument(element).createElement("div");
8011 }
8012 if (typeof portalElement === "function") {
8013 return portalElement(element);
8014 }
8015 return portalElement;
8016}
8017function getRandomId(prefix = "id") {
8018 return `${prefix ? `${prefix}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
8019}
8020function queueFocus(element) {
8021 queueMicrotask(() => {
8022 element == null ? void 0 : element.focus();
8023 });
8024}
8025var usePortal = createHook(function usePortal2(_a) {
8026 var _b = _a, {
8027 preserveTabOrder,
8028 preserveTabOrderAnchor,
8029 portalElement,
8030 portalRef,
8031 portal = true
8032 } = _b, props = __objRest(_b, [
8033 "preserveTabOrder",
8034 "preserveTabOrderAnchor",
8035 "portalElement",
8036 "portalRef",
8037 "portal"
8038 ]);
8039 const ref = (0,external_React_.useRef)(null);
8040 const refProp = useMergeRefs(ref, props.ref);
8041 const context = (0,external_React_.useContext)(PortalContext);
8042 const [portalNode, setPortalNode] = (0,external_React_.useState)(null);
8043 const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(
8044 null
8045 );
8046 const outerBeforeRef = (0,external_React_.useRef)(null);
8047 const innerBeforeRef = (0,external_React_.useRef)(null);
8048 const innerAfterRef = (0,external_React_.useRef)(null);
8049 const outerAfterRef = (0,external_React_.useRef)(null);
8050 useSafeLayoutEffect(() => {
8051 const element = ref.current;
8052 if (!element || !portal) {
8053 setPortalNode(null);
8054 return;
8055 }
8056 const portalEl = getPortalElement(element, portalElement);
8057 if (!portalEl) {
8058 setPortalNode(null);
8059 return;
8060 }
8061 const isPortalInDocument = portalEl.isConnected;
8062 if (!isPortalInDocument) {
8063 const rootElement = context || getRootElement(element);
8064 rootElement.appendChild(portalEl);
8065 }
8066 if (!portalEl.id) {
8067 portalEl.id = element.id ? `portal/${element.id}` : getRandomId();
8068 }
8069 setPortalNode(portalEl);
8070 setRef(portalRef, portalEl);
8071 if (isPortalInDocument) return;
8072 return () => {
8073 portalEl.remove();
8074 setRef(portalRef, null);
8075 };
8076 }, [portal, portalElement, context, portalRef]);
8077 useSafeLayoutEffect(() => {
8078 if (!portal) return;
8079 if (!preserveTabOrder) return;
8080 if (!preserveTabOrderAnchor) return;
8081 const doc = getDocument(preserveTabOrderAnchor);
8082 const element = doc.createElement("span");
8083 element.style.position = "fixed";
8084 preserveTabOrderAnchor.insertAdjacentElement("afterend", element);
8085 setAnchorPortalNode(element);
8086 return () => {
8087 element.remove();
8088 setAnchorPortalNode(null);
8089 };
8090 }, [portal, preserveTabOrder, preserveTabOrderAnchor]);
8091 (0,external_React_.useEffect)(() => {
8092 if (!portalNode) return;
8093 if (!preserveTabOrder) return;
8094 let raf = 0;
8095 const onFocus = (event) => {
8096 if (!isFocusEventOutside(event)) return;
8097 const focusing = event.type === "focusin";
8098 cancelAnimationFrame(raf);
8099 if (focusing) {
8100 return restoreFocusIn(portalNode);
8101 }
8102 raf = requestAnimationFrame(() => {
8103 disableFocusIn(portalNode, true);
8104 });
8105 };
8106 portalNode.addEventListener("focusin", onFocus, true);
8107 portalNode.addEventListener("focusout", onFocus, true);
8108 return () => {
8109 cancelAnimationFrame(raf);
8110 portalNode.removeEventListener("focusin", onFocus, true);
8111 portalNode.removeEventListener("focusout", onFocus, true);
8112 };
8113 }, [portalNode, preserveTabOrder]);
8114 props = useWrapElement(
8115 props,
8116 (element) => {
8117 element = // While the portal node is not in the DOM, we need to pass the
8118 // current context to the portal context, otherwise it's going to
8119 // reset to the body element on nested portals.
8120 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PortalContext.Provider, { value: portalNode || context, children: element });
8121 if (!portal) return element;
8122 if (!portalNode) {
8123 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8124 "span",
8125 {
8126 ref: refProp,
8127 id: props.id,
8128 style: { position: "fixed" },
8129 hidden: true
8130 }
8131 );
8132 }
8133 element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
8134 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8135 FocusTrap,
8136 {
8137 ref: innerBeforeRef,
8138 "data-focus-trap": props.id,
8139 className: "__focus-trap-inner-before",
8140 onFocus: (event) => {
8141 if (isFocusEventOutside(event, portalNode)) {
8142 queueFocus(getNextTabbable());
8143 } else {
8144 queueFocus(outerBeforeRef.current);
8145 }
8146 }
8147 }
8148 ),
8149 element,
8150 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8151 FocusTrap,
8152 {
8153 ref: innerAfterRef,
8154 "data-focus-trap": props.id,
8155 className: "__focus-trap-inner-after",
8156 onFocus: (event) => {
8157 if (isFocusEventOutside(event, portalNode)) {
8158 queueFocus(getPreviousTabbable());
8159 } else {
8160 queueFocus(outerAfterRef.current);
8161 }
8162 }
8163 }
8164 )
8165 ] });
8166 if (portalNode) {
8167 element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode);
8168 }
8169 let preserveTabOrderElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
8170 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8171 FocusTrap,
8172 {
8173 ref: outerBeforeRef,
8174 "data-focus-trap": props.id,
8175 className: "__focus-trap-outer-before",
8176 onFocus: (event) => {
8177 const fromOuter = event.relatedTarget === outerAfterRef.current;
8178 if (!fromOuter && isFocusEventOutside(event, portalNode)) {
8179 queueFocus(innerBeforeRef.current);
8180 } else {
8181 queueFocus(getPreviousTabbable());
8182 }
8183 }
8184 }
8185 ),
8186 preserveTabOrder && // We're using position: fixed here so that the browser doesn't
8187 // add margin to the element when setting gap on a parent element.
8188 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }),
8189 preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8190 FocusTrap,
8191 {
8192 ref: outerAfterRef,
8193 "data-focus-trap": props.id,
8194 className: "__focus-trap-outer-after",
8195 onFocus: (event) => {
8196 if (isFocusEventOutside(event, portalNode)) {
8197 queueFocus(innerAfterRef.current);
8198 } else {
8199 const nextTabbable = getNextTabbable();
8200 if (nextTabbable === innerBeforeRef.current) {
8201 requestAnimationFrame(() => {
8202 var _a2;
8203 return (_a2 = getNextTabbable()) == null ? void 0 : _a2.focus();
8204 });
8205 return;
8206 }
8207 queueFocus(nextTabbable);
8208 }
8209 }
8210 }
8211 )
8212 ] });
8213 if (anchorPortalNode && preserveTabOrder) {
8214 preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)(
8215 preserveTabOrderElement,
8216 anchorPortalNode
8217 );
8218 }
8219 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
8220 preserveTabOrderElement,
8221 element
8222 ] });
8223 },
8224 [portalNode, context, portal, props.id, preserveTabOrder, anchorPortalNode]
8225 );
8226 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
8227 ref: refProp
8228 });
8229 return props;
8230});
8231var Portal = forwardRef2(function Portal2(props) {
8232 const htmlProps = usePortal(props);
8233 return LMDWO4NN_createElement(O37CNYMR_TagName, htmlProps);
8234});
8235
8236
8237
8238;// ./node_modules/@ariakit/react-core/esm/__chunks/JC64G2H7.js
8239"use client";
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261// src/dialog/dialog.tsx
8262
8263
8264
8265
8266
8267
8268
8269var JC64G2H7_TagName = "div";
8270var JC64G2H7_isSafariBrowser = isSafari();
8271function isAlreadyFocusingAnotherElement(dialog) {
8272 const activeElement = getActiveElement();
8273 if (!activeElement) return false;
8274 if (dialog && contains(dialog, activeElement)) return false;
8275 if (isFocusable(activeElement)) return true;
8276 return false;
8277}
8278function getElementFromProp(prop, focusable = false) {
8279 if (!prop) return null;
8280 const element = "current" in prop ? prop.current : prop;
8281 if (!element) return null;
8282 if (focusable) return isFocusable(element) ? element : null;
8283 return element;
8284}
8285var useDialog = createHook(function useDialog2(_a) {
8286 var _b = _a, {
8287 store: storeProp,
8288 open: openProp,
8289 onClose,
8290 focusable = true,
8291 modal = true,
8292 portal = !!modal,
8293 backdrop = !!modal,
8294 hideOnEscape = true,
8295 hideOnInteractOutside = true,
8296 getPersistentElements,
8297 preventBodyScroll = !!modal,
8298 autoFocusOnShow = true,
8299 autoFocusOnHide = true,
8300 initialFocus,
8301 finalFocus,
8302 unmountOnHide,
8303 unstable_treeSnapshotKey
8304 } = _b, props = __objRest(_b, [
8305 "store",
8306 "open",
8307 "onClose",
8308 "focusable",
8309 "modal",
8310 "portal",
8311 "backdrop",
8312 "hideOnEscape",
8313 "hideOnInteractOutside",
8314 "getPersistentElements",
8315 "preventBodyScroll",
8316 "autoFocusOnShow",
8317 "autoFocusOnHide",
8318 "initialFocus",
8319 "finalFocus",
8320 "unmountOnHide",
8321 "unstable_treeSnapshotKey"
8322 ]);
8323 const context = useDialogProviderContext();
8324 const ref = (0,external_React_.useRef)(null);
8325 const store = useDialogStore({
8326 store: storeProp || context,
8327 open: openProp,
8328 setOpen(open2) {
8329 if (open2) return;
8330 const dialog = ref.current;
8331 if (!dialog) return;
8332 const event = new Event("close", { bubbles: false, cancelable: true });
8333 if (onClose) {
8334 dialog.addEventListener("close", onClose, { once: true });
8335 }
8336 dialog.dispatchEvent(event);
8337 if (!event.defaultPrevented) return;
8338 store.setOpen(true);
8339 }
8340 });
8341 const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
8342 const preserveTabOrderProp = props.preserveTabOrder;
8343 const preserveTabOrder = useStoreState(
8344 store,
8345 (state) => preserveTabOrderProp && !modal && state.mounted
8346 );
8347 const id = useId(props.id);
8348 const open = useStoreState(store, "open");
8349 const mounted = useStoreState(store, "mounted");
8350 const contentElement = useStoreState(store, "contentElement");
8351 const hidden = isHidden(mounted, props.hidden, props.alwaysVisible);
8352 usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden);
8353 useHideOnInteractOutside(store, hideOnInteractOutside, domReady);
8354 const { wrapElement, nestedDialogs } = useNestedDialogs(store);
8355 props = useWrapElement(props, wrapElement, [wrapElement]);
8356 useSafeLayoutEffect(() => {
8357 if (!open) return;
8358 const dialog = ref.current;
8359 const activeElement = getActiveElement(dialog, true);
8360 if (!activeElement) return;
8361 if (activeElement.tagName === "BODY") return;
8362 if (dialog && contains(dialog, activeElement)) return;
8363 store.setDisclosureElement(activeElement);
8364 }, [store, open]);
8365 if (JC64G2H7_isSafariBrowser) {
8366 (0,external_React_.useEffect)(() => {
8367 if (!mounted) return;
8368 const { disclosureElement } = store.getState();
8369 if (!disclosureElement) return;
8370 if (!isButton(disclosureElement)) return;
8371 const onMouseDown = () => {
8372 let receivedFocus = false;
8373 const onFocus = () => {
8374 receivedFocus = true;
8375 };
8376 const options = { capture: true, once: true };
8377 disclosureElement.addEventListener("focusin", onFocus, options);
8378 queueBeforeEvent(disclosureElement, "mouseup", () => {
8379 disclosureElement.removeEventListener("focusin", onFocus, true);
8380 if (receivedFocus) return;
8381 focusIfNeeded(disclosureElement);
8382 });
8383 };
8384 disclosureElement.addEventListener("mousedown", onMouseDown);
8385 return () => {
8386 disclosureElement.removeEventListener("mousedown", onMouseDown);
8387 };
8388 }, [store, mounted]);
8389 }
8390 (0,external_React_.useEffect)(() => {
8391 if (!mounted) return;
8392 if (!domReady) return;
8393 const dialog = ref.current;
8394 if (!dialog) return;
8395 const win = getWindow(dialog);
8396 const viewport = win.visualViewport || win;
8397 const setViewportHeight = () => {
8398 var _a2, _b2;
8399 const height = (_b2 = (_a2 = win.visualViewport) == null ? void 0 : _a2.height) != null ? _b2 : win.innerHeight;
8400 dialog.style.setProperty("--dialog-viewport-height", `${height}px`);
8401 };
8402 setViewportHeight();
8403 viewport.addEventListener("resize", setViewportHeight);
8404 return () => {
8405 viewport.removeEventListener("resize", setViewportHeight);
8406 };
8407 }, [mounted, domReady]);
8408 (0,external_React_.useEffect)(() => {
8409 if (!modal) return;
8410 if (!mounted) return;
8411 if (!domReady) return;
8412 const dialog = ref.current;
8413 if (!dialog) return;
8414 const existingDismiss = dialog.querySelector("[data-dialog-dismiss]");
8415 if (existingDismiss) return;
8416 return prependHiddenDismiss(dialog, store.hide);
8417 }, [store, modal, mounted, domReady]);
8418 useSafeLayoutEffect(() => {
8419 if (!supportsInert()) return;
8420 if (open) return;
8421 if (!mounted) return;
8422 if (!domReady) return;
8423 const dialog = ref.current;
8424 if (!dialog) return;
8425 return disableTree(dialog);
8426 }, [open, mounted, domReady]);
8427 const canTakeTreeSnapshot = open && domReady;
8428 useSafeLayoutEffect(() => {
8429 if (!id) return;
8430 if (!canTakeTreeSnapshot) return;
8431 const dialog = ref.current;
8432 return createWalkTreeSnapshot(id, [dialog]);
8433 }, [id, canTakeTreeSnapshot, unstable_treeSnapshotKey]);
8434 const getPersistentElementsProp = useEvent(getPersistentElements);
8435 useSafeLayoutEffect(() => {
8436 if (!id) return;
8437 if (!canTakeTreeSnapshot) return;
8438 const { disclosureElement } = store.getState();
8439 const dialog = ref.current;
8440 const persistentElements = getPersistentElementsProp() || [];
8441 const allElements = [
8442 dialog,
8443 ...persistentElements,
8444 ...nestedDialogs.map((dialog2) => dialog2.getState().contentElement)
8445 ];
8446 if (modal) {
8447 return chain(
8448 markTreeOutside(id, allElements),
8449 disableTreeOutside(id, allElements)
8450 );
8451 }
8452 return markTreeOutside(id, [disclosureElement, ...allElements]);
8453 }, [
8454 id,
8455 store,
8456 canTakeTreeSnapshot,
8457 getPersistentElementsProp,
8458 nestedDialogs,
8459 modal,
8460 unstable_treeSnapshotKey
8461 ]);
8462 const mayAutoFocusOnShow = !!autoFocusOnShow;
8463 const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow);
8464 const [autoFocusEnabled, setAutoFocusEnabled] = (0,external_React_.useState)(false);
8465 (0,external_React_.useEffect)(() => {
8466 if (!open) return;
8467 if (!mayAutoFocusOnShow) return;
8468 if (!domReady) return;
8469 if (!(contentElement == null ? void 0 : contentElement.isConnected)) return;
8470 const element = getElementFromProp(initialFocus, true) || // If no initial focus is specified, we try to focus the first element
8471 // with the autofocus attribute. If it's an Ariakit component, the
8472 // Focusable component will consume the autoFocus prop and add the
8473 // data-autofocus attribute to the element instead.
8474 contentElement.querySelector(
8475 "[data-autofocus=true],[autofocus]"
8476 ) || // We have to fallback to the first focusable element otherwise portaled
8477 // dialogs with preserveTabOrder set to true will not receive focus
8478 // properly because the elements aren't tabbable until the dialog receives
8479 // focus.
8480 getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself.
8481 contentElement;
8482 const isElementFocusable = isFocusable(element);
8483 if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return;
8484 setAutoFocusEnabled(true);
8485 queueMicrotask(() => {
8486 element.focus();
8487 if (!JC64G2H7_isSafariBrowser) return;
8488 element.scrollIntoView({ block: "nearest", inline: "nearest" });
8489 });
8490 }, [
8491 open,
8492 mayAutoFocusOnShow,
8493 domReady,
8494 contentElement,
8495 initialFocus,
8496 portal,
8497 preserveTabOrder,
8498 autoFocusOnShowProp
8499 ]);
8500 const mayAutoFocusOnHide = !!autoFocusOnHide;
8501 const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide);
8502 const [hasOpened, setHasOpened] = (0,external_React_.useState)(false);
8503 (0,external_React_.useEffect)(() => {
8504 if (!open) return;
8505 setHasOpened(true);
8506 return () => setHasOpened(false);
8507 }, [open]);
8508 const focusOnHide = (0,external_React_.useCallback)(
8509 (dialog, retry = true) => {
8510 const { disclosureElement } = store.getState();
8511 if (isAlreadyFocusingAnotherElement(dialog)) return;
8512 let element = getElementFromProp(finalFocus) || disclosureElement;
8513 if (element == null ? void 0 : element.id) {
8514 const doc = getDocument(element);
8515 const selector = `[aria-activedescendant="${element.id}"]`;
8516 const composite = doc.querySelector(selector);
8517 if (composite) {
8518 element = composite;
8519 }
8520 }
8521 if (element && !isFocusable(element)) {
8522 const maybeParentDialog = element.closest("[data-dialog]");
8523 if (maybeParentDialog == null ? void 0 : maybeParentDialog.id) {
8524 const doc = getDocument(maybeParentDialog);
8525 const selector = `[aria-controls~="${maybeParentDialog.id}"]`;
8526 const control = doc.querySelector(selector);
8527 if (control) {
8528 element = control;
8529 }
8530 }
8531 }
8532 const isElementFocusable = element && isFocusable(element);
8533 if (!isElementFocusable && retry) {
8534 requestAnimationFrame(() => focusOnHide(dialog, false));
8535 return;
8536 }
8537 if (!autoFocusOnHideProp(isElementFocusable ? element : null)) return;
8538 if (!isElementFocusable) return;
8539 element == null ? void 0 : element.focus();
8540 },
8541 [store, finalFocus, autoFocusOnHideProp]
8542 );
8543 const focusedOnHideRef = (0,external_React_.useRef)(false);
8544 useSafeLayoutEffect(() => {
8545 if (open) return;
8546 if (!hasOpened) return;
8547 if (!mayAutoFocusOnHide) return;
8548 const dialog = ref.current;
8549 focusedOnHideRef.current = true;
8550 focusOnHide(dialog);
8551 }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
8552 (0,external_React_.useEffect)(() => {
8553 if (!hasOpened) return;
8554 if (!mayAutoFocusOnHide) return;
8555 const dialog = ref.current;
8556 return () => {
8557 if (focusedOnHideRef.current) {
8558 focusedOnHideRef.current = false;
8559 return;
8560 }
8561 focusOnHide(dialog);
8562 };
8563 }, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
8564 const hideOnEscapeProp = useBooleanEvent(hideOnEscape);
8565 (0,external_React_.useEffect)(() => {
8566 if (!domReady) return;
8567 if (!mounted) return;
8568 const onKeyDown = (event) => {
8569 if (event.key !== "Escape") return;
8570 if (event.defaultPrevented) return;
8571 const dialog = ref.current;
8572 if (!dialog) return;
8573 if (isElementMarked(dialog)) return;
8574 const target = event.target;
8575 if (!target) return;
8576 const { disclosureElement } = store.getState();
8577 const isValidTarget = () => {
8578 if (target.tagName === "BODY") return true;
8579 if (contains(dialog, target)) return true;
8580 if (!disclosureElement) return true;
8581 if (contains(disclosureElement, target)) return true;
8582 return false;
8583 };
8584 if (!isValidTarget()) return;
8585 if (!hideOnEscapeProp(event)) return;
8586 store.hide();
8587 };
8588 return addGlobalEventListener("keydown", onKeyDown, true);
8589 }, [store, domReady, mounted, hideOnEscapeProp]);
8590 props = useWrapElement(
8591 props,
8592 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }),
8593 [modal]
8594 );
8595 const hiddenProp = props.hidden;
8596 const alwaysVisible = props.alwaysVisible;
8597 props = useWrapElement(
8598 props,
8599 (element) => {
8600 if (!backdrop) return element;
8601 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
8602 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
8603 DialogBackdrop,
8604 {
8605 store,
8606 backdrop,
8607 hidden: hiddenProp,
8608 alwaysVisible
8609 }
8610 ),
8611 element
8612 ] });
8613 },
8614 [store, backdrop, hiddenProp, alwaysVisible]
8615 );
8616 const [headingId, setHeadingId] = (0,external_React_.useState)();
8617 const [descriptionId, setDescriptionId] = (0,external_React_.useState)();
8618 props = useWrapElement(
8619 props,
8620 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }),
8621 [store]
8622 );
8623 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
8624 id,
8625 "data-dialog": "",
8626 role: "dialog",
8627 tabIndex: focusable ? -1 : void 0,
8628 "aria-labelledby": headingId,
8629 "aria-describedby": descriptionId
8630 }, props), {
8631 ref: useMergeRefs(ref, props.ref)
8632 });
8633 props = useFocusableContainer(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
8634 autoFocusOnShow: autoFocusEnabled
8635 }));
8636 props = useDisclosureContent(_3YLGPPWQ_spreadValues({ store }, props));
8637 props = useFocusable(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { focusable }));
8638 props = usePortal(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ portal }, props), { portalRef, preserveTabOrder }));
8639 return props;
8640});
8641function createDialogComponent(Component, useProviderContext = useDialogProviderContext) {
8642 return forwardRef2(function DialogComponent(props) {
8643 const context = useProviderContext();
8644 const store = props.store || context;
8645 const mounted = useStoreState(
8646 store,
8647 (state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open
8648 );
8649 if (!mounted) return null;
8650 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, _3YLGPPWQ_spreadValues({}, props));
8651 });
8652}
8653var Dialog = createDialogComponent(
8654 forwardRef2(function Dialog2(props) {
8655 const htmlProps = useDialog(props);
8656 return LMDWO4NN_createElement(JC64G2H7_TagName, htmlProps);
8657 }),
8658 useDialogProviderContext
8659);
8660
8661
8662
8663;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
8664const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
8665const alignments = (/* unused pure expression or super */ null && (['start', 'end']));
8666const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), [])));
8667const floating_ui_utils_min = Math.min;
8668const floating_ui_utils_max = Math.max;
8669const round = Math.round;
8670const floor = Math.floor;
8671const createCoords = v => ({
8672 x: v,
8673 y: v
8674});
8675const oppositeSideMap = {
8676 left: 'right',
8677 right: 'left',
8678 bottom: 'top',
8679 top: 'bottom'
8680};
8681const oppositeAlignmentMap = {
8682 start: 'end',
8683 end: 'start'
8684};
8685function clamp(start, value, end) {
8686 return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
8687}
8688function floating_ui_utils_evaluate(value, param) {
8689 return typeof value === 'function' ? value(param) : value;
8690}
8691function floating_ui_utils_getSide(placement) {
8692 return placement.split('-')[0];
8693}
8694function floating_ui_utils_getAlignment(placement) {
8695 return placement.split('-')[1];
8696}
8697function getOppositeAxis(axis) {
8698 return axis === 'x' ? 'y' : 'x';
8699}
8700function getAxisLength(axis) {
8701 return axis === 'y' ? 'height' : 'width';
8702}
8703function floating_ui_utils_getSideAxis(placement) {
8704 return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x';
8705}
8706function getAlignmentAxis(placement) {
8707 return getOppositeAxis(floating_ui_utils_getSideAxis(placement));
8708}
8709function floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
8710 if (rtl === void 0) {
8711 rtl = false;
8712 }
8713 const alignment = floating_ui_utils_getAlignment(placement);
8714 const alignmentAxis = getAlignmentAxis(placement);
8715 const length = getAxisLength(alignmentAxis);
8716 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
8717 if (rects.reference[length] > rects.floating[length]) {
8718 mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
8719 }
8720 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
8721}
8722function getExpandedPlacements(placement) {
8723 const oppositePlacement = getOppositePlacement(placement);
8724 return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
8725}
8726function floating_ui_utils_getOppositeAlignmentPlacement(placement) {
8727 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
8728}
8729function getSideList(side, isStart, rtl) {
8730 const lr = ['left', 'right'];
8731 const rl = ['right', 'left'];
8732 const tb = ['top', 'bottom'];
8733 const bt = ['bottom', 'top'];
8734 switch (side) {
8735 case 'top':
8736 case 'bottom':
8737 if (rtl) return isStart ? rl : lr;
8738 return isStart ? lr : rl;
8739 case 'left':
8740 case 'right':
8741 return isStart ? tb : bt;
8742 default:
8743 return [];
8744 }
8745}
8746function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
8747 const alignment = floating_ui_utils_getAlignment(placement);
8748 let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl);
8749 if (alignment) {
8750 list = list.map(side => side + "-" + alignment);
8751 if (flipAlignment) {
8752 list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement));
8753 }
8754 }
8755 return list;
8756}
8757function getOppositePlacement(placement) {
8758 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
8759}
8760function expandPaddingObject(padding) {
8761 return {
8762 top: 0,
8763 right: 0,
8764 bottom: 0,
8765 left: 0,
8766 ...padding
8767 };
8768}
8769function floating_ui_utils_getPaddingObject(padding) {
8770 return typeof padding !== 'number' ? expandPaddingObject(padding) : {
8771 top: padding,
8772 right: padding,
8773 bottom: padding,
8774 left: padding
8775 };
8776}
8777function floating_ui_utils_rectToClientRect(rect) {
8778 return {
8779 ...rect,
8780 top: rect.y,
8781 left: rect.x,
8782 right: rect.x + rect.width,
8783 bottom: rect.y + rect.height
8784 };
8785}
8786
8787
8788
8789;// ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs
8790
8791
8792
8793function computeCoordsFromPlacement(_ref, placement, rtl) {
8794 let {
8795 reference,
8796 floating
8797 } = _ref;
8798 const sideAxis = floating_ui_utils_getSideAxis(placement);
8799 const alignmentAxis = getAlignmentAxis(placement);
8800 const alignLength = getAxisLength(alignmentAxis);
8801 const side = floating_ui_utils_getSide(placement);
8802 const isVertical = sideAxis === 'y';
8803 const commonX = reference.x + reference.width / 2 - floating.width / 2;
8804 const commonY = reference.y + reference.height / 2 - floating.height / 2;
8805 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
8806 let coords;
8807 switch (side) {
8808 case 'top':
8809 coords = {
8810 x: commonX,
8811 y: reference.y - floating.height
8812 };
8813 break;
8814 case 'bottom':
8815 coords = {
8816 x: commonX,
8817 y: reference.y + reference.height
8818 };
8819 break;
8820 case 'right':
8821 coords = {
8822 x: reference.x + reference.width,
8823 y: commonY
8824 };
8825 break;
8826 case 'left':
8827 coords = {
8828 x: reference.x - floating.width,
8829 y: commonY
8830 };
8831 break;
8832 default:
8833 coords = {
8834 x: reference.x,
8835 y: reference.y
8836 };
8837 }
8838 switch (floating_ui_utils_getAlignment(placement)) {
8839 case 'start':
8840 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
8841 break;
8842 case 'end':
8843 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
8844 break;
8845 }
8846 return coords;
8847}
8848
8849/**
8850 * Computes the `x` and `y` coordinates that will place the floating element
8851 * next to a reference element when it is given a certain positioning strategy.
8852 *
8853 * This export does not have any `platform` interface logic. You will need to
8854 * write one for the platform you are using Floating UI with.
8855 */
8856const computePosition = async (reference, floating, config) => {
8857 const {
8858 placement = 'bottom',
8859 strategy = 'absolute',
8860 middleware = [],
8861 platform
8862 } = config;
8863 const validMiddleware = middleware.filter(Boolean);
8864 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
8865 let rects = await platform.getElementRects({
8866 reference,
8867 floating,
8868 strategy
8869 });
8870 let {
8871 x,
8872 y
8873 } = computeCoordsFromPlacement(rects, placement, rtl);
8874 let statefulPlacement = placement;
8875 let middlewareData = {};
8876 let resetCount = 0;
8877 for (let i = 0; i < validMiddleware.length; i++) {
8878 const {
8879 name,
8880 fn
8881 } = validMiddleware[i];
8882 const {
8883 x: nextX,
8884 y: nextY,
8885 data,
8886 reset
8887 } = await fn({
8888 x,
8889 y,
8890 initialPlacement: placement,
8891 placement: statefulPlacement,
8892 strategy,
8893 middlewareData,
8894 rects,
8895 platform,
8896 elements: {
8897 reference,
8898 floating
8899 }
8900 });
8901 x = nextX != null ? nextX : x;
8902 y = nextY != null ? nextY : y;
8903 middlewareData = {
8904 ...middlewareData,
8905 [name]: {
8906 ...middlewareData[name],
8907 ...data
8908 }
8909 };
8910 if (reset && resetCount <= 50) {
8911 resetCount++;
8912 if (typeof reset === 'object') {
8913 if (reset.placement) {
8914 statefulPlacement = reset.placement;
8915 }
8916 if (reset.rects) {
8917 rects = reset.rects === true ? await platform.getElementRects({
8918 reference,
8919 floating,
8920 strategy
8921 }) : reset.rects;
8922 }
8923 ({
8924 x,
8925 y
8926 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
8927 }
8928 i = -1;
8929 continue;
8930 }
8931 }
8932 return {
8933 x,
8934 y,
8935 placement: statefulPlacement,
8936 strategy,
8937 middlewareData
8938 };
8939};
8940
8941/**
8942 * Resolves with an object of overflow side offsets that determine how much the
8943 * element is overflowing a given clipping boundary on each side.
8944 * - positive = overflowing the boundary by that number of pixels
8945 * - negative = how many pixels left before it will overflow
8946 * - 0 = lies flush with the boundary
8947 * @see https://floating-ui.com/docs/detectOverflow
8948 */
8949async function detectOverflow(state, options) {
8950 var _await$platform$isEle;
8951 if (options === void 0) {
8952 options = {};
8953 }
8954 const {
8955 x,
8956 y,
8957 platform,
8958 rects,
8959 elements,
8960 strategy
8961 } = state;
8962 const {
8963 boundary = 'clippingAncestors',
8964 rootBoundary = 'viewport',
8965 elementContext = 'floating',
8966 altBoundary = false,
8967 padding = 0
8968 } = floating_ui_utils_evaluate(options, state);
8969 const paddingObject = floating_ui_utils_getPaddingObject(padding);
8970 const altContext = elementContext === 'floating' ? 'reference' : 'floating';
8971 const element = elements[altBoundary ? altContext : elementContext];
8972 const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({
8973 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
8974 boundary,
8975 rootBoundary,
8976 strategy
8977 }));
8978 const rect = elementContext === 'floating' ? {
8979 ...rects.floating,
8980 x,
8981 y
8982 } : rects.reference;
8983 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
8984 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
8985 x: 1,
8986 y: 1
8987 } : {
8988 x: 1,
8989 y: 1
8990 };
8991 const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
8992 rect,
8993 offsetParent,
8994 strategy
8995 }) : rect);
8996 return {
8997 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
8998 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
8999 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
9000 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
9001 };
9002}
9003
9004/**
9005 * Provides data to position an inner element of the floating element so that it
9006 * appears centered to the reference element.
9007 * @see https://floating-ui.com/docs/arrow
9008 */
9009const arrow = options => ({
9010 name: 'arrow',
9011 options,
9012 async fn(state) {
9013 const {
9014 x,
9015 y,
9016 placement,
9017 rects,
9018 platform,
9019 elements,
9020 middlewareData
9021 } = state;
9022 // Since `element` is required, we don't Partial<> the type.
9023 const {
9024 element,
9025 padding = 0
9026 } = floating_ui_utils_evaluate(options, state) || {};
9027 if (element == null) {
9028 return {};
9029 }
9030 const paddingObject = floating_ui_utils_getPaddingObject(padding);
9031 const coords = {
9032 x,
9033 y
9034 };
9035 const axis = getAlignmentAxis(placement);
9036 const length = getAxisLength(axis);
9037 const arrowDimensions = await platform.getDimensions(element);
9038 const isYAxis = axis === 'y';
9039 const minProp = isYAxis ? 'top' : 'left';
9040 const maxProp = isYAxis ? 'bottom' : 'right';
9041 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
9042 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
9043 const startDiff = coords[axis] - rects.reference[axis];
9044 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
9045 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
9046
9047 // DOM platform can return `window` as the `offsetParent`.
9048 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
9049 clientSize = elements.floating[clientProp] || rects.floating[length];
9050 }
9051 const centerToReference = endDiff / 2 - startDiff / 2;
9052
9053 // If the padding is large enough that it causes the arrow to no longer be
9054 // centered, modify the padding so that it is centered.
9055 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
9056 const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding);
9057 const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding);
9058
9059 // Make sure the arrow doesn't overflow the floating element if the center
9060 // point is outside the floating element's bounds.
9061 const min$1 = minPadding;
9062 const max = clientSize - arrowDimensions[length] - maxPadding;
9063 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
9064 const offset = clamp(min$1, center, max);
9065
9066 // If the reference is small enough that the arrow's padding causes it to
9067 // to point to nothing for an aligned placement, adjust the offset of the
9068 // floating element itself. To ensure `shift()` continues to take action,
9069 // a single reset is performed when this is true.
9070 const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
9071 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
9072 return {
9073 [axis]: coords[axis] + alignmentOffset,
9074 data: {
9075 [axis]: offset,
9076 centerOffset: center - offset - alignmentOffset,
9077 ...(shouldAddOffset && {
9078 alignmentOffset
9079 })
9080 },
9081 reset: shouldAddOffset
9082 };
9083 }
9084});
9085
9086function getPlacementList(alignment, autoAlignment, allowedPlacements) {
9087 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
9088 return allowedPlacementsSortedByAlignment.filter(placement => {
9089 if (alignment) {
9090 return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
9091 }
9092 return true;
9093 });
9094}
9095/**
9096 * Optimizes the visibility of the floating element by choosing the placement
9097 * that has the most space available automatically, without needing to specify a
9098 * preferred placement. Alternative to `flip`.
9099 * @see https://floating-ui.com/docs/autoPlacement
9100 */
9101const autoPlacement = function (options) {
9102 if (options === void 0) {
9103 options = {};
9104 }
9105 return {
9106 name: 'autoPlacement',
9107 options,
9108 async fn(state) {
9109 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
9110 const {
9111 rects,
9112 middlewareData,
9113 placement,
9114 platform,
9115 elements
9116 } = state;
9117 const {
9118 crossAxis = false,
9119 alignment,
9120 allowedPlacements = placements,
9121 autoAlignment = true,
9122 ...detectOverflowOptions
9123 } = evaluate(options, state);
9124 const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
9125 const overflow = await detectOverflow(state, detectOverflowOptions);
9126 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
9127 const currentPlacement = placements$1[currentIndex];
9128 if (currentPlacement == null) {
9129 return {};
9130 }
9131 const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
9132
9133 // Make `computeCoords` start from the right place.
9134 if (placement !== currentPlacement) {
9135 return {
9136 reset: {
9137 placement: placements$1[0]
9138 }
9139 };
9140 }
9141 const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
9142 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
9143 placement: currentPlacement,
9144 overflows: currentOverflows
9145 }];
9146 const nextPlacement = placements$1[currentIndex + 1];
9147
9148 // There are more placements to check.
9149 if (nextPlacement) {
9150 return {
9151 data: {
9152 index: currentIndex + 1,
9153 overflows: allOverflows
9154 },
9155 reset: {
9156 placement: nextPlacement
9157 }
9158 };
9159 }
9160 const placementsSortedByMostSpace = allOverflows.map(d => {
9161 const alignment = getAlignment(d.placement);
9162 return [d.placement, alignment && crossAxis ?
9163 // Check along the mainAxis and main crossAxis side.
9164 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
9165 // Check only the mainAxis.
9166 d.overflows[0], d.overflows];
9167 }).sort((a, b) => a[1] - b[1]);
9168 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
9169 // Aligned placements should not check their opposite crossAxis
9170 // side.
9171 getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
9172 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
9173 if (resetPlacement !== placement) {
9174 return {
9175 data: {
9176 index: currentIndex + 1,
9177 overflows: allOverflows
9178 },
9179 reset: {
9180 placement: resetPlacement
9181 }
9182 };
9183 }
9184 return {};
9185 }
9186 };
9187};
9188
9189/**
9190 * Optimizes the visibility of the floating element by flipping the `placement`
9191 * in order to keep it in view when the preferred placement(s) will overflow the
9192 * clipping boundary. Alternative to `autoPlacement`.
9193 * @see https://floating-ui.com/docs/flip
9194 */
9195const flip = function (options) {
9196 if (options === void 0) {
9197 options = {};
9198 }
9199 return {
9200 name: 'flip',
9201 options,
9202 async fn(state) {
9203 var _middlewareData$arrow, _middlewareData$flip;
9204 const {
9205 placement,
9206 middlewareData,
9207 rects,
9208 initialPlacement,
9209 platform,
9210 elements
9211 } = state;
9212 const {
9213 mainAxis: checkMainAxis = true,
9214 crossAxis: checkCrossAxis = true,
9215 fallbackPlacements: specifiedFallbackPlacements,
9216 fallbackStrategy = 'bestFit',
9217 fallbackAxisSideDirection = 'none',
9218 flipAlignment = true,
9219 ...detectOverflowOptions
9220 } = floating_ui_utils_evaluate(options, state);
9221
9222 // If a reset by the arrow was caused due to an alignment offset being
9223 // added, we should skip any logic now since `flip()` has already done its
9224 // work.
9225 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
9226 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
9227 return {};
9228 }
9229 const side = floating_ui_utils_getSide(placement);
9230 const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement;
9231 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
9232 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
9233 if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
9234 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
9235 }
9236 const placements = [initialPlacement, ...fallbackPlacements];
9237 const overflow = await detectOverflow(state, detectOverflowOptions);
9238 const overflows = [];
9239 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
9240 if (checkMainAxis) {
9241 overflows.push(overflow[side]);
9242 }
9243 if (checkCrossAxis) {
9244 const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl);
9245 overflows.push(overflow[sides[0]], overflow[sides[1]]);
9246 }
9247 overflowsData = [...overflowsData, {
9248 placement,
9249 overflows
9250 }];
9251
9252 // One or more sides is overflowing.
9253 if (!overflows.every(side => side <= 0)) {
9254 var _middlewareData$flip2, _overflowsData$filter;
9255 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
9256 const nextPlacement = placements[nextIndex];
9257 if (nextPlacement) {
9258 // Try next placement and re-run the lifecycle.
9259 return {
9260 data: {
9261 index: nextIndex,
9262 overflows: overflowsData
9263 },
9264 reset: {
9265 placement: nextPlacement
9266 }
9267 };
9268 }
9269
9270 // First, find the candidates that fit on the mainAxis side of overflow,
9271 // then find the placement that fits the best on the main crossAxis side.
9272 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
9273
9274 // Otherwise fallback.
9275 if (!resetPlacement) {
9276 switch (fallbackStrategy) {
9277 case 'bestFit':
9278 {
9279 var _overflowsData$map$so;
9280 const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
9281 if (placement) {
9282 resetPlacement = placement;
9283 }
9284 break;
9285 }
9286 case 'initialPlacement':
9287 resetPlacement = initialPlacement;
9288 break;
9289 }
9290 }
9291 if (placement !== resetPlacement) {
9292 return {
9293 reset: {
9294 placement: resetPlacement
9295 }
9296 };
9297 }
9298 }
9299 return {};
9300 }
9301 };
9302};
9303
9304function getSideOffsets(overflow, rect) {
9305 return {
9306 top: overflow.top - rect.height,
9307 right: overflow.right - rect.width,
9308 bottom: overflow.bottom - rect.height,
9309 left: overflow.left - rect.width
9310 };
9311}
9312function isAnySideFullyClipped(overflow) {
9313 return sides.some(side => overflow[side] >= 0);
9314}
9315/**
9316 * Provides data to hide the floating element in applicable situations, such as
9317 * when it is not in the same clipping context as the reference element.
9318 * @see https://floating-ui.com/docs/hide
9319 */
9320const hide = function (options) {
9321 if (options === void 0) {
9322 options = {};
9323 }
9324 return {
9325 name: 'hide',
9326 options,
9327 async fn(state) {
9328 const {
9329 rects
9330 } = state;
9331 const {
9332 strategy = 'referenceHidden',
9333 ...detectOverflowOptions
9334 } = evaluate(options, state);
9335 switch (strategy) {
9336 case 'referenceHidden':
9337 {
9338 const overflow = await detectOverflow(state, {
9339 ...detectOverflowOptions,
9340 elementContext: 'reference'
9341 });
9342 const offsets = getSideOffsets(overflow, rects.reference);
9343 return {
9344 data: {
9345 referenceHiddenOffsets: offsets,
9346 referenceHidden: isAnySideFullyClipped(offsets)
9347 }
9348 };
9349 }
9350 case 'escaped':
9351 {
9352 const overflow = await detectOverflow(state, {
9353 ...detectOverflowOptions,
9354 altBoundary: true
9355 });
9356 const offsets = getSideOffsets(overflow, rects.floating);
9357 return {
9358 data: {
9359 escapedOffsets: offsets,
9360 escaped: isAnySideFullyClipped(offsets)
9361 }
9362 };
9363 }
9364 default:
9365 {
9366 return {};
9367 }
9368 }
9369 }
9370 };
9371};
9372
9373function getBoundingRect(rects) {
9374 const minX = min(...rects.map(rect => rect.left));
9375 const minY = min(...rects.map(rect => rect.top));
9376 const maxX = max(...rects.map(rect => rect.right));
9377 const maxY = max(...rects.map(rect => rect.bottom));
9378 return {
9379 x: minX,
9380 y: minY,
9381 width: maxX - minX,
9382 height: maxY - minY
9383 };
9384}
9385function getRectsByLine(rects) {
9386 const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
9387 const groups = [];
9388 let prevRect = null;
9389 for (let i = 0; i < sortedRects.length; i++) {
9390 const rect = sortedRects[i];
9391 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
9392 groups.push([rect]);
9393 } else {
9394 groups[groups.length - 1].push(rect);
9395 }
9396 prevRect = rect;
9397 }
9398 return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
9399}
9400/**
9401 * Provides improved positioning for inline reference elements that can span
9402 * over multiple lines, such as hyperlinks or range selections.
9403 * @see https://floating-ui.com/docs/inline
9404 */
9405const inline = function (options) {
9406 if (options === void 0) {
9407 options = {};
9408 }
9409 return {
9410 name: 'inline',
9411 options,
9412 async fn(state) {
9413 const {
9414 placement,
9415 elements,
9416 rects,
9417 platform,
9418 strategy
9419 } = state;
9420 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
9421 // ClientRect's bounds, despite the event listener being triggered. A
9422 // padding of 2 seems to handle this issue.
9423 const {
9424 padding = 2,
9425 x,
9426 y
9427 } = evaluate(options, state);
9428 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
9429 const clientRects = getRectsByLine(nativeClientRects);
9430 const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
9431 const paddingObject = getPaddingObject(padding);
9432 function getBoundingClientRect() {
9433 // There are two rects and they are disjoined.
9434 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
9435 // Find the first rect in which the point is fully inside.
9436 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
9437 }
9438
9439 // There are 2 or more connected rects.
9440 if (clientRects.length >= 2) {
9441 if (getSideAxis(placement) === 'y') {
9442 const firstRect = clientRects[0];
9443 const lastRect = clientRects[clientRects.length - 1];
9444 const isTop = getSide(placement) === 'top';
9445 const top = firstRect.top;
9446 const bottom = lastRect.bottom;
9447 const left = isTop ? firstRect.left : lastRect.left;
9448 const right = isTop ? firstRect.right : lastRect.right;
9449 const width = right - left;
9450 const height = bottom - top;
9451 return {
9452 top,
9453 bottom,
9454 left,
9455 right,
9456 width,
9457 height,
9458 x: left,
9459 y: top
9460 };
9461 }
9462 const isLeftSide = getSide(placement) === 'left';
9463 const maxRight = max(...clientRects.map(rect => rect.right));
9464 const minLeft = min(...clientRects.map(rect => rect.left));
9465 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
9466 const top = measureRects[0].top;
9467 const bottom = measureRects[measureRects.length - 1].bottom;
9468 const left = minLeft;
9469 const right = maxRight;
9470 const width = right - left;
9471 const height = bottom - top;
9472 return {
9473 top,
9474 bottom,
9475 left,
9476 right,
9477 width,
9478 height,
9479 x: left,
9480 y: top
9481 };
9482 }
9483 return fallback;
9484 }
9485 const resetRects = await platform.getElementRects({
9486 reference: {
9487 getBoundingClientRect
9488 },
9489 floating: elements.floating,
9490 strategy
9491 });
9492 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
9493 return {
9494 reset: {
9495 rects: resetRects
9496 }
9497 };
9498 }
9499 return {};
9500 }
9501 };
9502};
9503
9504// For type backwards-compatibility, the `OffsetOptions` type was also
9505// Derivable.
9506async function convertValueToCoords(state, options) {
9507 const {
9508 placement,
9509 platform,
9510 elements
9511 } = state;
9512 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
9513 const side = floating_ui_utils_getSide(placement);
9514 const alignment = floating_ui_utils_getAlignment(placement);
9515 const isVertical = floating_ui_utils_getSideAxis(placement) === 'y';
9516 const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
9517 const crossAxisMulti = rtl && isVertical ? -1 : 1;
9518 const rawValue = floating_ui_utils_evaluate(options, state);
9519
9520 // eslint-disable-next-line prefer-const
9521 let {
9522 mainAxis,
9523 crossAxis,
9524 alignmentAxis
9525 } = typeof rawValue === 'number' ? {
9526 mainAxis: rawValue,
9527 crossAxis: 0,
9528 alignmentAxis: null
9529 } : {
9530 mainAxis: 0,
9531 crossAxis: 0,
9532 alignmentAxis: null,
9533 ...rawValue
9534 };
9535 if (alignment && typeof alignmentAxis === 'number') {
9536 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
9537 }
9538 return isVertical ? {
9539 x: crossAxis * crossAxisMulti,
9540 y: mainAxis * mainAxisMulti
9541 } : {
9542 x: mainAxis * mainAxisMulti,
9543 y: crossAxis * crossAxisMulti
9544 };
9545}
9546
9547/**
9548 * Modifies the placement by translating the floating element along the
9549 * specified axes.
9550 * A number (shorthand for `mainAxis` or distance), or an axes configuration
9551 * object may be passed.
9552 * @see https://floating-ui.com/docs/offset
9553 */
9554const offset = function (options) {
9555 if (options === void 0) {
9556 options = 0;
9557 }
9558 return {
9559 name: 'offset',
9560 options,
9561 async fn(state) {
9562 const {
9563 x,
9564 y
9565 } = state;
9566 const diffCoords = await convertValueToCoords(state, options);
9567 return {
9568 x: x + diffCoords.x,
9569 y: y + diffCoords.y,
9570 data: diffCoords
9571 };
9572 }
9573 };
9574};
9575
9576/**
9577 * Optimizes the visibility of the floating element by shifting it in order to
9578 * keep it in view when it will overflow the clipping boundary.
9579 * @see https://floating-ui.com/docs/shift
9580 */
9581const shift = function (options) {
9582 if (options === void 0) {
9583 options = {};
9584 }
9585 return {
9586 name: 'shift',
9587 options,
9588 async fn(state) {
9589 const {
9590 x,
9591 y,
9592 placement
9593 } = state;
9594 const {
9595 mainAxis: checkMainAxis = true,
9596 crossAxis: checkCrossAxis = false,
9597 limiter = {
9598 fn: _ref => {
9599 let {
9600 x,
9601 y
9602 } = _ref;
9603 return {
9604 x,
9605 y
9606 };
9607 }
9608 },
9609 ...detectOverflowOptions
9610 } = floating_ui_utils_evaluate(options, state);
9611 const coords = {
9612 x,
9613 y
9614 };
9615 const overflow = await detectOverflow(state, detectOverflowOptions);
9616 const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement));
9617 const mainAxis = getOppositeAxis(crossAxis);
9618 let mainAxisCoord = coords[mainAxis];
9619 let crossAxisCoord = coords[crossAxis];
9620 if (checkMainAxis) {
9621 const minSide = mainAxis === 'y' ? 'top' : 'left';
9622 const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
9623 const min = mainAxisCoord + overflow[minSide];
9624 const max = mainAxisCoord - overflow[maxSide];
9625 mainAxisCoord = clamp(min, mainAxisCoord, max);
9626 }
9627 if (checkCrossAxis) {
9628 const minSide = crossAxis === 'y' ? 'top' : 'left';
9629 const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
9630 const min = crossAxisCoord + overflow[minSide];
9631 const max = crossAxisCoord - overflow[maxSide];
9632 crossAxisCoord = clamp(min, crossAxisCoord, max);
9633 }
9634 const limitedCoords = limiter.fn({
9635 ...state,
9636 [mainAxis]: mainAxisCoord,
9637 [crossAxis]: crossAxisCoord
9638 });
9639 return {
9640 ...limitedCoords,
9641 data: {
9642 x: limitedCoords.x - x,
9643 y: limitedCoords.y - y
9644 }
9645 };
9646 }
9647 };
9648};
9649/**
9650 * Built-in `limiter` that will stop `shift()` at a certain point.
9651 */
9652const limitShift = function (options) {
9653 if (options === void 0) {
9654 options = {};
9655 }
9656 return {
9657 options,
9658 fn(state) {
9659 const {
9660 x,
9661 y,
9662 placement,
9663 rects,
9664 middlewareData
9665 } = state;
9666 const {
9667 offset = 0,
9668 mainAxis: checkMainAxis = true,
9669 crossAxis: checkCrossAxis = true
9670 } = floating_ui_utils_evaluate(options, state);
9671 const coords = {
9672 x,
9673 y
9674 };
9675 const crossAxis = floating_ui_utils_getSideAxis(placement);
9676 const mainAxis = getOppositeAxis(crossAxis);
9677 let mainAxisCoord = coords[mainAxis];
9678 let crossAxisCoord = coords[crossAxis];
9679 const rawOffset = floating_ui_utils_evaluate(offset, state);
9680 const computedOffset = typeof rawOffset === 'number' ? {
9681 mainAxis: rawOffset,
9682 crossAxis: 0
9683 } : {
9684 mainAxis: 0,
9685 crossAxis: 0,
9686 ...rawOffset
9687 };
9688 if (checkMainAxis) {
9689 const len = mainAxis === 'y' ? 'height' : 'width';
9690 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
9691 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
9692 if (mainAxisCoord < limitMin) {
9693 mainAxisCoord = limitMin;
9694 } else if (mainAxisCoord > limitMax) {
9695 mainAxisCoord = limitMax;
9696 }
9697 }
9698 if (checkCrossAxis) {
9699 var _middlewareData$offse, _middlewareData$offse2;
9700 const len = mainAxis === 'y' ? 'width' : 'height';
9701 const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement));
9702 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
9703 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
9704 if (crossAxisCoord < limitMin) {
9705 crossAxisCoord = limitMin;
9706 } else if (crossAxisCoord > limitMax) {
9707 crossAxisCoord = limitMax;
9708 }
9709 }
9710 return {
9711 [mainAxis]: mainAxisCoord,
9712 [crossAxis]: crossAxisCoord
9713 };
9714 }
9715 };
9716};
9717
9718/**
9719 * Provides data that allows you to change the size of the floating element —
9720 * for instance, prevent it from overflowing the clipping boundary or match the
9721 * width of the reference element.
9722 * @see https://floating-ui.com/docs/size
9723 */
9724const size = function (options) {
9725 if (options === void 0) {
9726 options = {};
9727 }
9728 return {
9729 name: 'size',
9730 options,
9731 async fn(state) {
9732 const {
9733 placement,
9734 rects,
9735 platform,
9736 elements
9737 } = state;
9738 const {
9739 apply = () => {},
9740 ...detectOverflowOptions
9741 } = floating_ui_utils_evaluate(options, state);
9742 const overflow = await detectOverflow(state, detectOverflowOptions);
9743 const side = floating_ui_utils_getSide(placement);
9744 const alignment = floating_ui_utils_getAlignment(placement);
9745 const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y';
9746 const {
9747 width,
9748 height
9749 } = rects.floating;
9750 let heightSide;
9751 let widthSide;
9752 if (side === 'top' || side === 'bottom') {
9753 heightSide = side;
9754 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
9755 } else {
9756 widthSide = side;
9757 heightSide = alignment === 'end' ? 'top' : 'bottom';
9758 }
9759 const overflowAvailableHeight = height - overflow[heightSide];
9760 const overflowAvailableWidth = width - overflow[widthSide];
9761 const noShift = !state.middlewareData.shift;
9762 let availableHeight = overflowAvailableHeight;
9763 let availableWidth = overflowAvailableWidth;
9764 if (isYAxis) {
9765 const maximumClippingWidth = width - overflow.left - overflow.right;
9766 availableWidth = alignment || noShift ? floating_ui_utils_min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
9767 } else {
9768 const maximumClippingHeight = height - overflow.top - overflow.bottom;
9769 availableHeight = alignment || noShift ? floating_ui_utils_min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
9770 }
9771 if (noShift && !alignment) {
9772 const xMin = floating_ui_utils_max(overflow.left, 0);
9773 const xMax = floating_ui_utils_max(overflow.right, 0);
9774 const yMin = floating_ui_utils_max(overflow.top, 0);
9775 const yMax = floating_ui_utils_max(overflow.bottom, 0);
9776 if (isYAxis) {
9777 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right));
9778 } else {
9779 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom));
9780 }
9781 }
9782 await apply({
9783 ...state,
9784 availableWidth,
9785 availableHeight
9786 });
9787 const nextDimensions = await platform.getDimensions(elements.floating);
9788 if (width !== nextDimensions.width || height !== nextDimensions.height) {
9789 return {
9790 reset: {
9791 rects: true
9792 }
9793 };
9794 }
9795 return {};
9796 }
9797 };
9798};
9799
9800
9801
9802;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
9803/**
9804 * Custom positioning reference element.
9805 * @see https://floating-ui.com/docs/virtual-elements
9806 */
9807
9808const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
9809const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end']));
9810const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), [])));
9811const dist_floating_ui_utils_min = Math.min;
9812const dist_floating_ui_utils_max = Math.max;
9813const floating_ui_utils_round = Math.round;
9814const floating_ui_utils_floor = Math.floor;
9815const floating_ui_utils_createCoords = v => ({
9816 x: v,
9817 y: v
9818});
9819const floating_ui_utils_oppositeSideMap = {
9820 left: 'right',
9821 right: 'left',
9822 bottom: 'top',
9823 top: 'bottom'
9824};
9825const floating_ui_utils_oppositeAlignmentMap = {
9826 start: 'end',
9827 end: 'start'
9828};
9829function floating_ui_utils_clamp(start, value, end) {
9830 return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end));
9831}
9832function dist_floating_ui_utils_evaluate(value, param) {
9833 return typeof value === 'function' ? value(param) : value;
9834}
9835function dist_floating_ui_utils_getSide(placement) {
9836 return placement.split('-')[0];
9837}
9838function dist_floating_ui_utils_getAlignment(placement) {
9839 return placement.split('-')[1];
9840}
9841function floating_ui_utils_getOppositeAxis(axis) {
9842 return axis === 'x' ? 'y' : 'x';
9843}
9844function floating_ui_utils_getAxisLength(axis) {
9845 return axis === 'y' ? 'height' : 'width';
9846}
9847function dist_floating_ui_utils_getSideAxis(placement) {
9848 return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x';
9849}
9850function floating_ui_utils_getAlignmentAxis(placement) {
9851 return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement));
9852}
9853function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) {
9854 if (rtl === void 0) {
9855 rtl = false;
9856 }
9857 const alignment = dist_floating_ui_utils_getAlignment(placement);
9858 const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement);
9859 const length = floating_ui_utils_getAxisLength(alignmentAxis);
9860 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
9861 if (rects.reference[length] > rects.floating[length]) {
9862 mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide);
9863 }
9864 return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)];
9865}
9866function floating_ui_utils_getExpandedPlacements(placement) {
9867 const oppositePlacement = floating_ui_utils_getOppositePlacement(placement);
9868 return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)];
9869}
9870function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) {
9871 return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]);
9872}
9873function floating_ui_utils_getSideList(side, isStart, rtl) {
9874 const lr = ['left', 'right'];
9875 const rl = ['right', 'left'];
9876 const tb = ['top', 'bottom'];
9877 const bt = ['bottom', 'top'];
9878 switch (side) {
9879 case 'top':
9880 case 'bottom':
9881 if (rtl) return isStart ? rl : lr;
9882 return isStart ? lr : rl;
9883 case 'left':
9884 case 'right':
9885 return isStart ? tb : bt;
9886 default:
9887 return [];
9888 }
9889}
9890function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
9891 const alignment = dist_floating_ui_utils_getAlignment(placement);
9892 let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl);
9893 if (alignment) {
9894 list = list.map(side => side + "-" + alignment);
9895 if (flipAlignment) {
9896 list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement));
9897 }
9898 }
9899 return list;
9900}
9901function floating_ui_utils_getOppositePlacement(placement) {
9902 return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]);
9903}
9904function floating_ui_utils_expandPaddingObject(padding) {
9905 return {
9906 top: 0,
9907 right: 0,
9908 bottom: 0,
9909 left: 0,
9910 ...padding
9911 };
9912}
9913function dist_floating_ui_utils_getPaddingObject(padding) {
9914 return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : {
9915 top: padding,
9916 right: padding,
9917 bottom: padding,
9918 left: padding
9919 };
9920}
9921function dist_floating_ui_utils_rectToClientRect(rect) {
9922 const {
9923 x,
9924 y,
9925 width,
9926 height
9927 } = rect;
9928 return {
9929 width,
9930 height,
9931 top: y,
9932 left: x,
9933 right: x + width,
9934 bottom: y + height,
9935 x,
9936 y
9937 };
9938}
9939
9940
9941
9942;// ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
9943function hasWindow() {
9944 return typeof window !== 'undefined';
9945}
9946function getNodeName(node) {
9947 if (isNode(node)) {
9948 return (node.nodeName || '').toLowerCase();
9949 }
9950 // Mocked nodes in testing environments may not be instances of Node. By
9951 // returning `#document` an infinite loop won't occur.
9952 // https://github.com/floating-ui/floating-ui/issues/2317
9953 return '#document';
9954}
9955function floating_ui_utils_dom_getWindow(node) {
9956 var _node$ownerDocument;
9957 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
9958}
9959function getDocumentElement(node) {
9960 var _ref;
9961 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
9962}
9963function isNode(value) {
9964 if (!hasWindow()) {
9965 return false;
9966 }
9967 return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node;
9968}
9969function isElement(value) {
9970 if (!hasWindow()) {
9971 return false;
9972 }
9973 return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element;
9974}
9975function isHTMLElement(value) {
9976 if (!hasWindow()) {
9977 return false;
9978 }
9979 return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement;
9980}
9981function isShadowRoot(value) {
9982 if (!hasWindow() || typeof ShadowRoot === 'undefined') {
9983 return false;
9984 }
9985 return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot;
9986}
9987function isOverflowElement(element) {
9988 const {
9989 overflow,
9990 overflowX,
9991 overflowY,
9992 display
9993 } = floating_ui_utils_dom_getComputedStyle(element);
9994 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
9995}
9996function isTableElement(element) {
9997 return ['table', 'td', 'th'].includes(getNodeName(element));
9998}
9999function isTopLayer(element) {
10000 return [':popover-open', ':modal'].some(selector => {
10001 try {
10002 return element.matches(selector);
10003 } catch (e) {
10004 return false;
10005 }
10006 });
10007}
10008function isContainingBlock(elementOrCss) {
10009 const webkit = isWebKit();
10010 const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss;
10011
10012 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
10013 // https://drafts.csswg.org/css-transforms-2/#individual-transforms
10014 return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
10015}
10016function getContainingBlock(element) {
10017 let currentNode = getParentNode(element);
10018 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
10019 if (isContainingBlock(currentNode)) {
10020 return currentNode;
10021 } else if (isTopLayer(currentNode)) {
10022 return null;
10023 }
10024 currentNode = getParentNode(currentNode);
10025 }
10026 return null;
10027}
10028function isWebKit() {
10029 if (typeof CSS === 'undefined' || !CSS.supports) return false;
10030 return CSS.supports('-webkit-backdrop-filter', 'none');
10031}
10032function isLastTraversableNode(node) {
10033 return ['html', 'body', '#document'].includes(getNodeName(node));
10034}
10035function floating_ui_utils_dom_getComputedStyle(element) {
10036 return floating_ui_utils_dom_getWindow(element).getComputedStyle(element);
10037}
10038function getNodeScroll(element) {
10039 if (isElement(element)) {
10040 return {
10041 scrollLeft: element.scrollLeft,
10042 scrollTop: element.scrollTop
10043 };
10044 }
10045 return {
10046 scrollLeft: element.scrollX,
10047 scrollTop: element.scrollY
10048 };
10049}
10050function getParentNode(node) {
10051 if (getNodeName(node) === 'html') {
10052 return node;
10053 }
10054 const result =
10055 // Step into the shadow DOM of the parent of a slotted node.
10056 node.assignedSlot ||
10057 // DOM Element detected.
10058 node.parentNode ||
10059 // ShadowRoot detected.
10060 isShadowRoot(node) && node.host ||
10061 // Fallback.
10062 getDocumentElement(node);
10063 return isShadowRoot(result) ? result.host : result;
10064}
10065function getNearestOverflowAncestor(node) {
10066 const parentNode = getParentNode(node);
10067 if (isLastTraversableNode(parentNode)) {
10068 return node.ownerDocument ? node.ownerDocument.body : node.body;
10069 }
10070 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
10071 return parentNode;
10072 }
10073 return getNearestOverflowAncestor(parentNode);
10074}
10075function getOverflowAncestors(node, list, traverseIframes) {
10076 var _node$ownerDocument2;
10077 if (list === void 0) {
10078 list = [];
10079 }
10080 if (traverseIframes === void 0) {
10081 traverseIframes = true;
10082 }
10083 const scrollableAncestor = getNearestOverflowAncestor(node);
10084 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
10085 const win = floating_ui_utils_dom_getWindow(scrollableAncestor);
10086 if (isBody) {
10087 const frameElement = getFrameElement(win);
10088 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
10089 }
10090 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
10091}
10092function getFrameElement(win) {
10093 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
10094}
10095
10096
10097
10098;// ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
10099
10100
10101
10102
10103
10104
10105function getCssDimensions(element) {
10106 const css = floating_ui_utils_dom_getComputedStyle(element);
10107 // In testing environments, the `width` and `height` properties are empty
10108 // strings for SVG elements, returning NaN. Fallback to `0` in this case.
10109 let width = parseFloat(css.width) || 0;
10110 let height = parseFloat(css.height) || 0;
10111 const hasOffset = isHTMLElement(element);
10112 const offsetWidth = hasOffset ? element.offsetWidth : width;
10113 const offsetHeight = hasOffset ? element.offsetHeight : height;
10114 const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight;
10115 if (shouldFallback) {
10116 width = offsetWidth;
10117 height = offsetHeight;
10118 }
10119 return {
10120 width,
10121 height,
10122 $: shouldFallback
10123 };
10124}
10125
10126function unwrapElement(element) {
10127 return !isElement(element) ? element.contextElement : element;
10128}
10129
10130function getScale(element) {
10131 const domElement = unwrapElement(element);
10132 if (!isHTMLElement(domElement)) {
10133 return floating_ui_utils_createCoords(1);
10134 }
10135 const rect = domElement.getBoundingClientRect();
10136 const {
10137 width,
10138 height,
10139 $
10140 } = getCssDimensions(domElement);
10141 let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width;
10142 let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height;
10143
10144 // 0, NaN, or Infinity should always fallback to 1.
10145
10146 if (!x || !Number.isFinite(x)) {
10147 x = 1;
10148 }
10149 if (!y || !Number.isFinite(y)) {
10150 y = 1;
10151 }
10152 return {
10153 x,
10154 y
10155 };
10156}
10157
10158const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0);
10159function getVisualOffsets(element) {
10160 const win = floating_ui_utils_dom_getWindow(element);
10161 if (!isWebKit() || !win.visualViewport) {
10162 return noOffsets;
10163 }
10164 return {
10165 x: win.visualViewport.offsetLeft,
10166 y: win.visualViewport.offsetTop
10167 };
10168}
10169function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
10170 if (isFixed === void 0) {
10171 isFixed = false;
10172 }
10173 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) {
10174 return false;
10175 }
10176 return isFixed;
10177}
10178
10179function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
10180 if (includeScale === void 0) {
10181 includeScale = false;
10182 }
10183 if (isFixedStrategy === void 0) {
10184 isFixedStrategy = false;
10185 }
10186 const clientRect = element.getBoundingClientRect();
10187 const domElement = unwrapElement(element);
10188 let scale = floating_ui_utils_createCoords(1);
10189 if (includeScale) {
10190 if (offsetParent) {
10191 if (isElement(offsetParent)) {
10192 scale = getScale(offsetParent);
10193 }
10194 } else {
10195 scale = getScale(element);
10196 }
10197 }
10198 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0);
10199 let x = (clientRect.left + visualOffsets.x) / scale.x;
10200 let y = (clientRect.top + visualOffsets.y) / scale.y;
10201 let width = clientRect.width / scale.x;
10202 let height = clientRect.height / scale.y;
10203 if (domElement) {
10204 const win = floating_ui_utils_dom_getWindow(domElement);
10205 const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent;
10206 let currentWin = win;
10207 let currentIFrame = currentWin.frameElement;
10208 while (currentIFrame && offsetParent && offsetWin !== currentWin) {
10209 const iframeScale = getScale(currentIFrame);
10210 const iframeRect = currentIFrame.getBoundingClientRect();
10211 const css = floating_ui_utils_dom_getComputedStyle(currentIFrame);
10212 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
10213 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
10214 x *= iframeScale.x;
10215 y *= iframeScale.y;
10216 width *= iframeScale.x;
10217 height *= iframeScale.y;
10218 x += left;
10219 y += top;
10220 currentWin = floating_ui_utils_dom_getWindow(currentIFrame);
10221 currentIFrame = currentWin.frameElement;
10222 }
10223 }
10224 return floating_ui_utils_rectToClientRect({
10225 width,
10226 height,
10227 x,
10228 y
10229 });
10230}
10231
10232const topLayerSelectors = [':popover-open', ':modal'];
10233function floating_ui_dom_isTopLayer(floating) {
10234 return topLayerSelectors.some(selector => {
10235 try {
10236 return floating.matches(selector);
10237 } catch (e) {
10238 return false;
10239 }
10240 });
10241}
10242
10243function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
10244 let {
10245 elements,
10246 rect,
10247 offsetParent,
10248 strategy
10249 } = _ref;
10250 const isFixed = strategy === 'fixed';
10251 const documentElement = getDocumentElement(offsetParent);
10252 const topLayer = elements ? floating_ui_dom_isTopLayer(elements.floating) : false;
10253 if (offsetParent === documentElement || topLayer && isFixed) {
10254 return rect;
10255 }
10256 let scroll = {
10257 scrollLeft: 0,
10258 scrollTop: 0
10259 };
10260 let scale = floating_ui_utils_createCoords(1);
10261 const offsets = floating_ui_utils_createCoords(0);
10262 const isOffsetParentAnElement = isHTMLElement(offsetParent);
10263 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
10264 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
10265 scroll = getNodeScroll(offsetParent);
10266 }
10267 if (isHTMLElement(offsetParent)) {
10268 const offsetRect = getBoundingClientRect(offsetParent);
10269 scale = getScale(offsetParent);
10270 offsets.x = offsetRect.x + offsetParent.clientLeft;
10271 offsets.y = offsetRect.y + offsetParent.clientTop;
10272 }
10273 }
10274 return {
10275 width: rect.width * scale.x,
10276 height: rect.height * scale.y,
10277 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
10278 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
10279 };
10280}
10281
10282function getClientRects(element) {
10283 return Array.from(element.getClientRects());
10284}
10285
10286function getWindowScrollBarX(element) {
10287 // If <html> has a CSS width greater than the viewport, then this will be
10288 // incorrect for RTL.
10289 return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
10290}
10291
10292// Gets the entire size of the scrollable document area, even extending outside
10293// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
10294function getDocumentRect(element) {
10295 const html = getDocumentElement(element);
10296 const scroll = getNodeScroll(element);
10297 const body = element.ownerDocument.body;
10298 const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
10299 const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
10300 let x = -scroll.scrollLeft + getWindowScrollBarX(element);
10301 const y = -scroll.scrollTop;
10302 if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') {
10303 x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
10304 }
10305 return {
10306 width,
10307 height,
10308 x,
10309 y
10310 };
10311}
10312
10313function getViewportRect(element, strategy) {
10314 const win = floating_ui_utils_dom_getWindow(element);
10315 const html = getDocumentElement(element);
10316 const visualViewport = win.visualViewport;
10317 let width = html.clientWidth;
10318 let height = html.clientHeight;
10319 let x = 0;
10320 let y = 0;
10321 if (visualViewport) {
10322 width = visualViewport.width;
10323 height = visualViewport.height;
10324 const visualViewportBased = isWebKit();
10325 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
10326 x = visualViewport.offsetLeft;
10327 y = visualViewport.offsetTop;
10328 }
10329 }
10330 return {
10331 width,
10332 height,
10333 x,
10334 y
10335 };
10336}
10337
10338// Returns the inner client rect, subtracting scrollbars if present.
10339function getInnerBoundingClientRect(element, strategy) {
10340 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
10341 const top = clientRect.top + element.clientTop;
10342 const left = clientRect.left + element.clientLeft;
10343 const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1);
10344 const width = element.clientWidth * scale.x;
10345 const height = element.clientHeight * scale.y;
10346 const x = left * scale.x;
10347 const y = top * scale.y;
10348 return {
10349 width,
10350 height,
10351 x,
10352 y
10353 };
10354}
10355function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
10356 let rect;
10357 if (clippingAncestor === 'viewport') {
10358 rect = getViewportRect(element, strategy);
10359 } else if (clippingAncestor === 'document') {
10360 rect = getDocumentRect(getDocumentElement(element));
10361 } else if (isElement(clippingAncestor)) {
10362 rect = getInnerBoundingClientRect(clippingAncestor, strategy);
10363 } else {
10364 const visualOffsets = getVisualOffsets(element);
10365 rect = {
10366 ...clippingAncestor,
10367 x: clippingAncestor.x - visualOffsets.x,
10368 y: clippingAncestor.y - visualOffsets.y
10369 };
10370 }
10371 return floating_ui_utils_rectToClientRect(rect);
10372}
10373function hasFixedPositionAncestor(element, stopNode) {
10374 const parentNode = getParentNode(element);
10375 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
10376 return false;
10377 }
10378 return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
10379}
10380
10381// A "clipping ancestor" is an `overflow` element with the characteristic of
10382// clipping (or hiding) child elements. This returns all clipping ancestors
10383// of the given element up the tree.
10384function getClippingElementAncestors(element, cache) {
10385 const cachedResult = cache.get(element);
10386 if (cachedResult) {
10387 return cachedResult;
10388 }
10389 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
10390 let currentContainingBlockComputedStyle = null;
10391 const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed';
10392 let currentNode = elementIsFixed ? getParentNode(element) : element;
10393
10394 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
10395 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
10396 const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode);
10397 const currentNodeIsContaining = isContainingBlock(currentNode);
10398 if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
10399 currentContainingBlockComputedStyle = null;
10400 }
10401 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
10402 if (shouldDropCurrentNode) {
10403 // Drop non-containing blocks.
10404 result = result.filter(ancestor => ancestor !== currentNode);
10405 } else {
10406 // Record last containing block for next iteration.
10407 currentContainingBlockComputedStyle = computedStyle;
10408 }
10409 currentNode = getParentNode(currentNode);
10410 }
10411 cache.set(element, result);
10412 return result;
10413}
10414
10415// Gets the maximum area that the element is visible in due to any number of
10416// clipping ancestors.
10417function getClippingRect(_ref) {
10418 let {
10419 element,
10420 boundary,
10421 rootBoundary,
10422 strategy
10423 } = _ref;
10424 const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
10425 const clippingAncestors = [...elementClippingAncestors, rootBoundary];
10426 const firstClippingAncestor = clippingAncestors[0];
10427 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
10428 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
10429 accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top);
10430 accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right);
10431 accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom);
10432 accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left);
10433 return accRect;
10434 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
10435 return {
10436 width: clippingRect.right - clippingRect.left,
10437 height: clippingRect.bottom - clippingRect.top,
10438 x: clippingRect.left,
10439 y: clippingRect.top
10440 };
10441}
10442
10443function getDimensions(element) {
10444 const {
10445 width,
10446 height
10447 } = getCssDimensions(element);
10448 return {
10449 width,
10450 height
10451 };
10452}
10453
10454function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
10455 const isOffsetParentAnElement = isHTMLElement(offsetParent);
10456 const documentElement = getDocumentElement(offsetParent);
10457 const isFixed = strategy === 'fixed';
10458 const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
10459 let scroll = {
10460 scrollLeft: 0,
10461 scrollTop: 0
10462 };
10463 const offsets = floating_ui_utils_createCoords(0);
10464 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
10465 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
10466 scroll = getNodeScroll(offsetParent);
10467 }
10468 if (isOffsetParentAnElement) {
10469 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
10470 offsets.x = offsetRect.x + offsetParent.clientLeft;
10471 offsets.y = offsetRect.y + offsetParent.clientTop;
10472 } else if (documentElement) {
10473 offsets.x = getWindowScrollBarX(documentElement);
10474 }
10475 }
10476 const x = rect.left + scroll.scrollLeft - offsets.x;
10477 const y = rect.top + scroll.scrollTop - offsets.y;
10478 return {
10479 x,
10480 y,
10481 width: rect.width,
10482 height: rect.height
10483 };
10484}
10485
10486function getTrueOffsetParent(element, polyfill) {
10487 if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') {
10488 return null;
10489 }
10490 if (polyfill) {
10491 return polyfill(element);
10492 }
10493 return element.offsetParent;
10494}
10495
10496// Gets the closest ancestor positioned element. Handles some edge cases,
10497// such as table ancestors and cross browser bugs.
10498function getOffsetParent(element, polyfill) {
10499 const window = floating_ui_utils_dom_getWindow(element);
10500 if (!isHTMLElement(element) || floating_ui_dom_isTopLayer(element)) {
10501 return window;
10502 }
10503 let offsetParent = getTrueOffsetParent(element, polyfill);
10504 while (offsetParent && isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') {
10505 offsetParent = getTrueOffsetParent(offsetParent, polyfill);
10506 }
10507 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
10508 return window;
10509 }
10510 return offsetParent || getContainingBlock(element) || window;
10511}
10512
10513const getElementRects = async function (data) {
10514 const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
10515 const getDimensionsFn = this.getDimensions;
10516 return {
10517 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
10518 floating: {
10519 x: 0,
10520 y: 0,
10521 ...(await getDimensionsFn(data.floating))
10522 }
10523 };
10524};
10525
10526function isRTL(element) {
10527 return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl';
10528}
10529
10530const platform = {
10531 convertOffsetParentRelativeRectToViewportRelativeRect,
10532 getDocumentElement: getDocumentElement,
10533 getClippingRect,
10534 getOffsetParent,
10535 getElementRects,
10536 getClientRects,
10537 getDimensions,
10538 getScale,
10539 isElement: isElement,
10540 isRTL
10541};
10542
10543// https://samthor.au/2021/observing-dom/
10544function observeMove(element, onMove) {
10545 let io = null;
10546 let timeoutId;
10547 const root = getDocumentElement(element);
10548 function cleanup() {
10549 var _io;
10550 clearTimeout(timeoutId);
10551 (_io = io) == null || _io.disconnect();
10552 io = null;
10553 }
10554 function refresh(skip, threshold) {
10555 if (skip === void 0) {
10556 skip = false;
10557 }
10558 if (threshold === void 0) {
10559 threshold = 1;
10560 }
10561 cleanup();
10562 const {
10563 left,
10564 top,
10565 width,
10566 height
10567 } = element.getBoundingClientRect();
10568 if (!skip) {
10569 onMove();
10570 }
10571 if (!width || !height) {
10572 return;
10573 }
10574 const insetTop = floating_ui_utils_floor(top);
10575 const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width));
10576 const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height));
10577 const insetLeft = floating_ui_utils_floor(left);
10578 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
10579 const options = {
10580 rootMargin,
10581 threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1
10582 };
10583 let isFirstUpdate = true;
10584 function handleObserve(entries) {
10585 const ratio = entries[0].intersectionRatio;
10586 if (ratio !== threshold) {
10587 if (!isFirstUpdate) {
10588 return refresh();
10589 }
10590 if (!ratio) {
10591 timeoutId = setTimeout(() => {
10592 refresh(false, 1e-7);
10593 }, 100);
10594 } else {
10595 refresh(false, ratio);
10596 }
10597 }
10598 isFirstUpdate = false;
10599 }
10600
10601 // Older browsers don't support a `document` as the root and will throw an
10602 // error.
10603 try {
10604 io = new IntersectionObserver(handleObserve, {
10605 ...options,
10606 // Handle <iframe>s
10607 root: root.ownerDocument
10608 });
10609 } catch (e) {
10610 io = new IntersectionObserver(handleObserve, options);
10611 }
10612 io.observe(element);
10613 }
10614 refresh(true);
10615 return cleanup;
10616}
10617
10618/**
10619 * Automatically updates the position of the floating element when necessary.
10620 * Should only be called when the floating element is mounted on the DOM or
10621 * visible on the screen.
10622 * @returns cleanup function that should be invoked when the floating element is
10623 * removed from the DOM or hidden from the screen.
10624 * @see https://floating-ui.com/docs/autoUpdate
10625 */
10626function autoUpdate(reference, floating, update, options) {
10627 if (options === void 0) {
10628 options = {};
10629 }
10630 const {
10631 ancestorScroll = true,
10632 ancestorResize = true,
10633 elementResize = typeof ResizeObserver === 'function',
10634 layoutShift = typeof IntersectionObserver === 'function',
10635 animationFrame = false
10636 } = options;
10637 const referenceEl = unwrapElement(reference);
10638 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
10639 ancestors.forEach(ancestor => {
10640 ancestorScroll && ancestor.addEventListener('scroll', update, {
10641 passive: true
10642 });
10643 ancestorResize && ancestor.addEventListener('resize', update);
10644 });
10645 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
10646 let reobserveFrame = -1;
10647 let resizeObserver = null;
10648 if (elementResize) {
10649 resizeObserver = new ResizeObserver(_ref => {
10650 let [firstEntry] = _ref;
10651 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
10652 // Prevent update loops when using the `size` middleware.
10653 // https://github.com/floating-ui/floating-ui/issues/1740
10654 resizeObserver.unobserve(floating);
10655 cancelAnimationFrame(reobserveFrame);
10656 reobserveFrame = requestAnimationFrame(() => {
10657 var _resizeObserver;
10658 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
10659 });
10660 }
10661 update();
10662 });
10663 if (referenceEl && !animationFrame) {
10664 resizeObserver.observe(referenceEl);
10665 }
10666 resizeObserver.observe(floating);
10667 }
10668 let frameId;
10669 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
10670 if (animationFrame) {
10671 frameLoop();
10672 }
10673 function frameLoop() {
10674 const nextRefRect = getBoundingClientRect(reference);
10675 if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
10676 update();
10677 }
10678 prevRefRect = nextRefRect;
10679 frameId = requestAnimationFrame(frameLoop);
10680 }
10681 update();
10682 return () => {
10683 var _resizeObserver2;
10684 ancestors.forEach(ancestor => {
10685 ancestorScroll && ancestor.removeEventListener('scroll', update);
10686 ancestorResize && ancestor.removeEventListener('resize', update);
10687 });
10688 cleanupIo == null || cleanupIo();
10689 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
10690 resizeObserver = null;
10691 if (animationFrame) {
10692 cancelAnimationFrame(frameId);
10693 }
10694 };
10695}
10696
10697/**
10698 * Optimizes the visibility of the floating element by choosing the placement
10699 * that has the most space available automatically, without needing to specify a
10700 * preferred placement. Alternative to `flip`.
10701 * @see https://floating-ui.com/docs/autoPlacement
10702 */
10703const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));
10704
10705/**
10706 * Optimizes the visibility of the floating element by shifting it in order to
10707 * keep it in view when it will overflow the clipping boundary.
10708 * @see https://floating-ui.com/docs/shift
10709 */
10710const floating_ui_dom_shift = shift;
10711
10712/**
10713 * Optimizes the visibility of the floating element by flipping the `placement`
10714 * in order to keep it in view when the preferred placement(s) will overflow the
10715 * clipping boundary. Alternative to `autoPlacement`.
10716 * @see https://floating-ui.com/docs/flip
10717 */
10718const floating_ui_dom_flip = flip;
10719
10720/**
10721 * Provides data that allows you to change the size of the floating element —
10722 * for instance, prevent it from overflowing the clipping boundary or match the
10723 * width of the reference element.
10724 * @see https://floating-ui.com/docs/size
10725 */
10726const floating_ui_dom_size = size;
10727
10728/**
10729 * Provides data to hide the floating element in applicable situations, such as
10730 * when it is not in the same clipping context as the reference element.
10731 * @see https://floating-ui.com/docs/hide
10732 */
10733const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));
10734
10735/**
10736 * Provides data to position an inner element of the floating element so that it
10737 * appears centered to the reference element.
10738 * @see https://floating-ui.com/docs/arrow
10739 */
10740const floating_ui_dom_arrow = arrow;
10741
10742/**
10743 * Provides improved positioning for inline reference elements that can span
10744 * over multiple lines, such as hyperlinks or range selections.
10745 * @see https://floating-ui.com/docs/inline
10746 */
10747const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1));
10748
10749/**
10750 * Built-in `limiter` that will stop `shift()` at a certain point.
10751 */
10752const floating_ui_dom_limitShift = limitShift;
10753
10754/**
10755 * Computes the `x` and `y` coordinates that will place the floating element
10756 * next to a given reference element.
10757 */
10758const floating_ui_dom_computePosition = (reference, floating, options) => {
10759 // This caches the expensive `getClippingElementAncestors` function so that
10760 // multiple lifecycle resets re-use the same result. It only lives for a
10761 // single call. If other functions become expensive, we can add them as well.
10762 const cache = new Map();
10763 const mergedOptions = {
10764 platform,
10765 ...options
10766 };
10767 const platformWithCache = {
10768 ...mergedOptions.platform,
10769 _c: cache
10770 };
10771 return computePosition(reference, floating, {
10772 ...mergedOptions,
10773 platform: platformWithCache
10774 });
10775};
10776
10777
10778
10779;// ./node_modules/@ariakit/react-core/esm/__chunks/T6C2RYFI.js
10780"use client";
10781
10782
10783
10784
10785
10786
10787// src/popover/popover.tsx
10788
10789
10790
10791
10792var T6C2RYFI_TagName = "div";
10793function createDOMRect(x = 0, y = 0, width = 0, height = 0) {
10794 if (typeof DOMRect === "function") {
10795 return new DOMRect(x, y, width, height);
10796 }
10797 const rect = {
10798 x,
10799 y,
10800 width,
10801 height,
10802 top: y,
10803 right: x + width,
10804 bottom: y + height,
10805 left: x
10806 };
10807 return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, rect), { toJSON: () => rect });
10808}
10809function getDOMRect(anchorRect) {
10810 if (!anchorRect) return createDOMRect();
10811 const { x, y, width, height } = anchorRect;
10812 return createDOMRect(x, y, width, height);
10813}
10814function getAnchorElement(anchorElement, getAnchorRect) {
10815 const contextElement = anchorElement || void 0;
10816 return {
10817 contextElement,
10818 getBoundingClientRect: () => {
10819 const anchor = anchorElement;
10820 const anchorRect = getAnchorRect == null ? void 0 : getAnchorRect(anchor);
10821 if (anchorRect || !anchor) {
10822 return getDOMRect(anchorRect);
10823 }
10824 return anchor.getBoundingClientRect();
10825 }
10826 };
10827}
10828function isValidPlacement(flip2) {
10829 return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(flip2);
10830}
10831function roundByDPR(value) {
10832 const dpr = window.devicePixelRatio || 1;
10833 return Math.round(value * dpr) / dpr;
10834}
10835function getOffsetMiddleware(arrowElement, props) {
10836 return offset(({ placement }) => {
10837 var _a;
10838 const arrowOffset = ((arrowElement == null ? void 0 : arrowElement.clientHeight) || 0) / 2;
10839 const finalGutter = typeof props.gutter === "number" ? props.gutter + arrowOffset : (_a = props.gutter) != null ? _a : arrowOffset;
10840 const hasAlignment = !!placement.split("-")[1];
10841 return {
10842 crossAxis: !hasAlignment ? props.shift : void 0,
10843 mainAxis: finalGutter,
10844 alignmentAxis: props.shift
10845 };
10846 });
10847}
10848function getFlipMiddleware(props) {
10849 if (props.flip === false) return;
10850 const fallbackPlacements = typeof props.flip === "string" ? props.flip.split(" ") : void 0;
10851 invariant(
10852 !fallbackPlacements || fallbackPlacements.every(isValidPlacement),
10853 false && 0
10854 );
10855 return floating_ui_dom_flip({
10856 padding: props.overflowPadding,
10857 fallbackPlacements
10858 });
10859}
10860function getShiftMiddleware(props) {
10861 if (!props.slide && !props.overlap) return;
10862 return floating_ui_dom_shift({
10863 mainAxis: props.slide,
10864 crossAxis: props.overlap,
10865 padding: props.overflowPadding,
10866 limiter: floating_ui_dom_limitShift()
10867 });
10868}
10869function getSizeMiddleware(props) {
10870 return floating_ui_dom_size({
10871 padding: props.overflowPadding,
10872 apply({ elements, availableWidth, availableHeight, rects }) {
10873 const wrapper = elements.floating;
10874 const referenceWidth = Math.round(rects.reference.width);
10875 availableWidth = Math.floor(availableWidth);
10876 availableHeight = Math.floor(availableHeight);
10877 wrapper.style.setProperty(
10878 "--popover-anchor-width",
10879 `${referenceWidth}px`
10880 );
10881 wrapper.style.setProperty(
10882 "--popover-available-width",
10883 `${availableWidth}px`
10884 );
10885 wrapper.style.setProperty(
10886 "--popover-available-height",
10887 `${availableHeight}px`
10888 );
10889 if (props.sameWidth) {
10890 wrapper.style.width = `${referenceWidth}px`;
10891 }
10892 if (props.fitViewport) {
10893 wrapper.style.maxWidth = `${availableWidth}px`;
10894 wrapper.style.maxHeight = `${availableHeight}px`;
10895 }
10896 }
10897 });
10898}
10899function getArrowMiddleware(arrowElement, props) {
10900 if (!arrowElement) return;
10901 return floating_ui_dom_arrow({
10902 element: arrowElement,
10903 padding: props.arrowPadding
10904 });
10905}
10906var usePopover = createHook(
10907 function usePopover2(_a) {
10908 var _b = _a, {
10909 store,
10910 modal = false,
10911 portal = !!modal,
10912 preserveTabOrder = true,
10913 autoFocusOnShow = true,
10914 wrapperProps,
10915 fixed = false,
10916 flip: flip2 = true,
10917 shift: shift2 = 0,
10918 slide = true,
10919 overlap = false,
10920 sameWidth = false,
10921 fitViewport = false,
10922 gutter,
10923 arrowPadding = 4,
10924 overflowPadding = 8,
10925 getAnchorRect,
10926 updatePosition
10927 } = _b, props = __objRest(_b, [
10928 "store",
10929 "modal",
10930 "portal",
10931 "preserveTabOrder",
10932 "autoFocusOnShow",
10933 "wrapperProps",
10934 "fixed",
10935 "flip",
10936 "shift",
10937 "slide",
10938 "overlap",
10939 "sameWidth",
10940 "fitViewport",
10941 "gutter",
10942 "arrowPadding",
10943 "overflowPadding",
10944 "getAnchorRect",
10945 "updatePosition"
10946 ]);
10947 const context = usePopoverProviderContext();
10948 store = store || context;
10949 invariant(
10950 store,
10951 false && 0
10952 );
10953 const arrowElement = store.useState("arrowElement");
10954 const anchorElement = store.useState("anchorElement");
10955 const disclosureElement = store.useState("disclosureElement");
10956 const popoverElement = store.useState("popoverElement");
10957 const contentElement = store.useState("contentElement");
10958 const placement = store.useState("placement");
10959 const mounted = store.useState("mounted");
10960 const rendered = store.useState("rendered");
10961 const defaultArrowElementRef = (0,external_React_.useRef)(null);
10962 const [positioned, setPositioned] = (0,external_React_.useState)(false);
10963 const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
10964 const getAnchorRectProp = useEvent(getAnchorRect);
10965 const updatePositionProp = useEvent(updatePosition);
10966 const hasCustomUpdatePosition = !!updatePosition;
10967 useSafeLayoutEffect(() => {
10968 if (!(popoverElement == null ? void 0 : popoverElement.isConnected)) return;
10969 popoverElement.style.setProperty(
10970 "--popover-overflow-padding",
10971 `${overflowPadding}px`
10972 );
10973 const anchor = getAnchorElement(anchorElement, getAnchorRectProp);
10974 const updatePosition2 = async () => {
10975 if (!mounted) return;
10976 if (!arrowElement) {
10977 defaultArrowElementRef.current = defaultArrowElementRef.current || document.createElement("div");
10978 }
10979 const arrow2 = arrowElement || defaultArrowElementRef.current;
10980 const middleware = [
10981 getOffsetMiddleware(arrow2, { gutter, shift: shift2 }),
10982 getFlipMiddleware({ flip: flip2, overflowPadding }),
10983 getShiftMiddleware({ slide, shift: shift2, overlap, overflowPadding }),
10984 getArrowMiddleware(arrow2, { arrowPadding }),
10985 getSizeMiddleware({
10986 sameWidth,
10987 fitViewport,
10988 overflowPadding
10989 })
10990 ];
10991 const pos = await floating_ui_dom_computePosition(anchor, popoverElement, {
10992 placement,
10993 strategy: fixed ? "fixed" : "absolute",
10994 middleware
10995 });
10996 store == null ? void 0 : store.setState("currentPlacement", pos.placement);
10997 setPositioned(true);
10998 const x = roundByDPR(pos.x);
10999 const y = roundByDPR(pos.y);
11000 Object.assign(popoverElement.style, {
11001 top: "0",
11002 left: "0",
11003 transform: `translate3d(${x}px,${y}px,0)`
11004 });
11005 if (arrow2 && pos.middlewareData.arrow) {
11006 const { x: arrowX, y: arrowY } = pos.middlewareData.arrow;
11007 const side = pos.placement.split("-")[0];
11008 const centerX = arrow2.clientWidth / 2;
11009 const centerY = arrow2.clientHeight / 2;
11010 const originX = arrowX != null ? arrowX + centerX : -centerX;
11011 const originY = arrowY != null ? arrowY + centerY : -centerY;
11012 popoverElement.style.setProperty(
11013 "--popover-transform-origin",
11014 {
11015 top: `${originX}px calc(100% + ${centerY}px)`,
11016 bottom: `${originX}px ${-centerY}px`,
11017 left: `calc(100% + ${centerX}px) ${originY}px`,
11018 right: `${-centerX}px ${originY}px`
11019 }[side]
11020 );
11021 Object.assign(arrow2.style, {
11022 left: arrowX != null ? `${arrowX}px` : "",
11023 top: arrowY != null ? `${arrowY}px` : "",
11024 [side]: "100%"
11025 });
11026 }
11027 };
11028 const update = async () => {
11029 if (hasCustomUpdatePosition) {
11030 await updatePositionProp({ updatePosition: updatePosition2 });
11031 setPositioned(true);
11032 } else {
11033 await updatePosition2();
11034 }
11035 };
11036 const cancelAutoUpdate = autoUpdate(anchor, popoverElement, update, {
11037 // JSDOM doesn't support ResizeObserver
11038 elementResize: typeof ResizeObserver === "function"
11039 });
11040 return () => {
11041 setPositioned(false);
11042 cancelAutoUpdate();
11043 };
11044 }, [
11045 store,
11046 rendered,
11047 popoverElement,
11048 arrowElement,
11049 anchorElement,
11050 popoverElement,
11051 placement,
11052 mounted,
11053 domReady,
11054 fixed,
11055 flip2,
11056 shift2,
11057 slide,
11058 overlap,
11059 sameWidth,
11060 fitViewport,
11061 gutter,
11062 arrowPadding,
11063 overflowPadding,
11064 getAnchorRectProp,
11065 hasCustomUpdatePosition,
11066 updatePositionProp
11067 ]);
11068 useSafeLayoutEffect(() => {
11069 if (!mounted) return;
11070 if (!domReady) return;
11071 if (!(popoverElement == null ? void 0 : popoverElement.isConnected)) return;
11072 if (!(contentElement == null ? void 0 : contentElement.isConnected)) return;
11073 const applyZIndex = () => {
11074 popoverElement.style.zIndex = getComputedStyle(contentElement).zIndex;
11075 };
11076 applyZIndex();
11077 let raf = requestAnimationFrame(() => {
11078 raf = requestAnimationFrame(applyZIndex);
11079 });
11080 return () => cancelAnimationFrame(raf);
11081 }, [mounted, domReady, popoverElement, contentElement]);
11082 const position = fixed ? "fixed" : "absolute";
11083 props = useWrapElement(
11084 props,
11085 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
11086 "div",
11087 _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, wrapperProps), {
11088 style: _3YLGPPWQ_spreadValues({
11089 // https://floating-ui.com/docs/computeposition#initial-layout
11090 position,
11091 top: 0,
11092 left: 0,
11093 width: "max-content"
11094 }, wrapperProps == null ? void 0 : wrapperProps.style),
11095 ref: store == null ? void 0 : store.setPopoverElement,
11096 children: element
11097 })
11098 ),
11099 [store, position, wrapperProps]
11100 );
11101 props = useWrapElement(
11102 props,
11103 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverScopedContextProvider, { value: store, children: element }),
11104 [store]
11105 );
11106 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
11107 // data-placing is not part of the public API. We're setting this here so
11108 // we can wait for the popover to be positioned before other components
11109 // move focus into it. For example, this attribute is observed by the
11110 // Combobox component with the autoSelect behavior.
11111 "data-placing": !positioned || void 0
11112 }, props), {
11113 style: _3YLGPPWQ_spreadValues({
11114 position: "relative"
11115 }, props.style)
11116 });
11117 props = useDialog(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
11118 store,
11119 modal,
11120 portal,
11121 preserveTabOrder,
11122 preserveTabOrderAnchor: disclosureElement || anchorElement,
11123 autoFocusOnShow: positioned && autoFocusOnShow
11124 }, props), {
11125 portalRef
11126 }));
11127 return props;
11128 }
11129);
11130var Popover = createDialogComponent(
11131 forwardRef2(function Popover2(props) {
11132 const htmlProps = usePopover(props);
11133 return LMDWO4NN_createElement(T6C2RYFI_TagName, htmlProps);
11134 }),
11135 usePopoverProviderContext
11136);
11137
11138
11139
11140;// ./node_modules/@ariakit/react-core/esm/__chunks/KQKDTOT4.js
11141"use client";
11142
11143
11144
11145
11146
11147
11148
11149
11150// src/hovercard/hovercard.tsx
11151
11152
11153
11154
11155
11156
11157
11158var KQKDTOT4_TagName = "div";
11159function isMovingOnHovercard(target, card, anchor, nested) {
11160 if (hasFocusWithin(card)) return true;
11161 if (!target) return false;
11162 if (contains(card, target)) return true;
11163 if (anchor && contains(anchor, target)) return true;
11164 if (nested == null ? void 0 : nested.some((card2) => isMovingOnHovercard(target, card2, anchor))) {
11165 return true;
11166 }
11167 return false;
11168}
11169function useAutoFocusOnHide(_a) {
11170 var _b = _a, {
11171 store
11172 } = _b, props = __objRest(_b, [
11173 "store"
11174 ]);
11175 const [autoFocusOnHide, setAutoFocusOnHide] = (0,external_React_.useState)(false);
11176 const mounted = store.useState("mounted");
11177 (0,external_React_.useEffect)(() => {
11178 if (!mounted) {
11179 setAutoFocusOnHide(false);
11180 }
11181 }, [mounted]);
11182 const onFocusProp = props.onFocus;
11183 const onFocus = useEvent((event) => {
11184 onFocusProp == null ? void 0 : onFocusProp(event);
11185 if (event.defaultPrevented) return;
11186 setAutoFocusOnHide(true);
11187 });
11188 const finalFocusRef = (0,external_React_.useRef)(null);
11189 (0,external_React_.useEffect)(() => {
11190 return sync(store, ["anchorElement"], (state) => {
11191 finalFocusRef.current = state.anchorElement;
11192 });
11193 }, []);
11194 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
11195 autoFocusOnHide,
11196 finalFocus: finalFocusRef
11197 }, props), {
11198 onFocus
11199 });
11200 return props;
11201}
11202var NestedHovercardContext = (0,external_React_.createContext)(null);
11203var useHovercard = createHook(
11204 function useHovercard2(_a) {
11205 var _b = _a, {
11206 store,
11207 modal = false,
11208 portal = !!modal,
11209 hideOnEscape = true,
11210 hideOnHoverOutside = true,
11211 disablePointerEventsOnApproach = !!hideOnHoverOutside
11212 } = _b, props = __objRest(_b, [
11213 "store",
11214 "modal",
11215 "portal",
11216 "hideOnEscape",
11217 "hideOnHoverOutside",
11218 "disablePointerEventsOnApproach"
11219 ]);
11220 const context = useHovercardProviderContext();
11221 store = store || context;
11222 invariant(
11223 store,
11224 false && 0
11225 );
11226 const ref = (0,external_React_.useRef)(null);
11227 const [nestedHovercards, setNestedHovercards] = (0,external_React_.useState)([]);
11228 const hideTimeoutRef = (0,external_React_.useRef)(0);
11229 const enterPointRef = (0,external_React_.useRef)(null);
11230 const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
11231 const isMouseMoving = useIsMouseMoving();
11232 const mayHideOnHoverOutside = !!hideOnHoverOutside;
11233 const hideOnHoverOutsideProp = useBooleanEvent(hideOnHoverOutside);
11234 const mayDisablePointerEvents = !!disablePointerEventsOnApproach;
11235 const disablePointerEventsProp = useBooleanEvent(
11236 disablePointerEventsOnApproach
11237 );
11238 const open = store.useState("open");
11239 const mounted = store.useState("mounted");
11240 (0,external_React_.useEffect)(() => {
11241 if (!domReady) return;
11242 if (!mounted) return;
11243 if (!mayHideOnHoverOutside && !mayDisablePointerEvents) return;
11244 const element = ref.current;
11245 if (!element) return;
11246 const onMouseMove = (event) => {
11247 if (!store) return;
11248 if (!isMouseMoving()) return;
11249 const { anchorElement, hideTimeout, timeout } = store.getState();
11250 const enterPoint = enterPointRef.current;
11251 const [target] = event.composedPath();
11252 const anchor = anchorElement;
11253 if (isMovingOnHovercard(target, element, anchor, nestedHovercards)) {
11254 enterPointRef.current = target && anchor && contains(anchor, target) ? getEventPoint(event) : null;
11255 window.clearTimeout(hideTimeoutRef.current);
11256 hideTimeoutRef.current = 0;
11257 return;
11258 }
11259 if (hideTimeoutRef.current) return;
11260 if (enterPoint) {
11261 const currentPoint = getEventPoint(event);
11262 const polygon = getElementPolygon(element, enterPoint);
11263 if (isPointInPolygon(currentPoint, polygon)) {
11264 enterPointRef.current = currentPoint;
11265 if (!disablePointerEventsProp(event)) return;
11266 event.preventDefault();
11267 event.stopPropagation();
11268 return;
11269 }
11270 }
11271 if (!hideOnHoverOutsideProp(event)) return;
11272 hideTimeoutRef.current = window.setTimeout(() => {
11273 hideTimeoutRef.current = 0;
11274 store == null ? void 0 : store.hide();
11275 }, hideTimeout != null ? hideTimeout : timeout);
11276 };
11277 return chain(
11278 addGlobalEventListener("mousemove", onMouseMove, true),
11279 () => clearTimeout(hideTimeoutRef.current)
11280 );
11281 }, [
11282 store,
11283 isMouseMoving,
11284 domReady,
11285 mounted,
11286 mayHideOnHoverOutside,
11287 mayDisablePointerEvents,
11288 nestedHovercards,
11289 disablePointerEventsProp,
11290 hideOnHoverOutsideProp
11291 ]);
11292 (0,external_React_.useEffect)(() => {
11293 if (!domReady) return;
11294 if (!mounted) return;
11295 if (!mayDisablePointerEvents) return;
11296 const disableEvent = (event) => {
11297 const element = ref.current;
11298 if (!element) return;
11299 const enterPoint = enterPointRef.current;
11300 if (!enterPoint) return;
11301 const polygon = getElementPolygon(element, enterPoint);
11302 if (isPointInPolygon(getEventPoint(event), polygon)) {
11303 if (!disablePointerEventsProp(event)) return;
11304 event.preventDefault();
11305 event.stopPropagation();
11306 }
11307 };
11308 return chain(
11309 // Note: we may need to add pointer events here in the future.
11310 addGlobalEventListener("mouseenter", disableEvent, true),
11311 addGlobalEventListener("mouseover", disableEvent, true),
11312 addGlobalEventListener("mouseout", disableEvent, true),
11313 addGlobalEventListener("mouseleave", disableEvent, true)
11314 );
11315 }, [domReady, mounted, mayDisablePointerEvents, disablePointerEventsProp]);
11316 (0,external_React_.useEffect)(() => {
11317 if (!domReady) return;
11318 if (open) return;
11319 store == null ? void 0 : store.setAutoFocusOnShow(false);
11320 }, [store, domReady, open]);
11321 const openRef = useLiveRef(open);
11322 (0,external_React_.useEffect)(() => {
11323 if (!domReady) return;
11324 return () => {
11325 if (!openRef.current) {
11326 store == null ? void 0 : store.setAutoFocusOnShow(false);
11327 }
11328 };
11329 }, [store, domReady]);
11330 const registerOnParent = (0,external_React_.useContext)(NestedHovercardContext);
11331 useSafeLayoutEffect(() => {
11332 if (modal) return;
11333 if (!portal) return;
11334 if (!mounted) return;
11335 if (!domReady) return;
11336 const element = ref.current;
11337 if (!element) return;
11338 return registerOnParent == null ? void 0 : registerOnParent(element);
11339 }, [modal, portal, mounted, domReady]);
11340 const registerNestedHovercard = (0,external_React_.useCallback)(
11341 (element) => {
11342 setNestedHovercards((prevElements) => [...prevElements, element]);
11343 const parentUnregister = registerOnParent == null ? void 0 : registerOnParent(element);
11344 return () => {
11345 setNestedHovercards(
11346 (prevElements) => prevElements.filter((item) => item !== element)
11347 );
11348 parentUnregister == null ? void 0 : parentUnregister();
11349 };
11350 },
11351 [registerOnParent]
11352 );
11353 props = useWrapElement(
11354 props,
11355 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HovercardScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedHovercardContext.Provider, { value: registerNestedHovercard, children: element }) }),
11356 [store, registerNestedHovercard]
11357 );
11358 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
11359 ref: useMergeRefs(ref, props.ref)
11360 });
11361 props = useAutoFocusOnHide(_3YLGPPWQ_spreadValues({ store }, props));
11362 const autoFocusOnShow = store.useState(
11363 (state) => modal || state.autoFocusOnShow
11364 );
11365 props = usePopover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
11366 store,
11367 modal,
11368 portal,
11369 autoFocusOnShow
11370 }, props), {
11371 portalRef,
11372 hideOnEscape(event) {
11373 if (isFalsyBooleanCallback(hideOnEscape, event)) return false;
11374 requestAnimationFrame(() => {
11375 requestAnimationFrame(() => {
11376 store == null ? void 0 : store.hide();
11377 });
11378 });
11379 return true;
11380 }
11381 }));
11382 return props;
11383 }
11384);
11385var Hovercard = createDialogComponent(
11386 forwardRef2(function Hovercard2(props) {
11387 const htmlProps = useHovercard(props);
11388 return LMDWO4NN_createElement(KQKDTOT4_TagName, htmlProps);
11389 }),
11390 useHovercardProviderContext
11391);
11392
11393
11394
11395;// ./node_modules/@ariakit/react-core/esm/tooltip/tooltip.js
11396"use client";
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440// src/tooltip/tooltip.tsx
11441
11442
11443
11444var tooltip_TagName = "div";
11445var useTooltip = createHook(
11446 function useTooltip2(_a) {
11447 var _b = _a, {
11448 store,
11449 portal = true,
11450 gutter = 8,
11451 preserveTabOrder = false,
11452 hideOnHoverOutside = true,
11453 hideOnInteractOutside = true
11454 } = _b, props = __objRest(_b, [
11455 "store",
11456 "portal",
11457 "gutter",
11458 "preserveTabOrder",
11459 "hideOnHoverOutside",
11460 "hideOnInteractOutside"
11461 ]);
11462 const context = useTooltipProviderContext();
11463 store = store || context;
11464 invariant(
11465 store,
11466 false && 0
11467 );
11468 props = useWrapElement(
11469 props,
11470 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipScopedContextProvider, { value: store, children: element }),
11471 [store]
11472 );
11473 const role = store.useState(
11474 (state) => state.type === "description" ? "tooltip" : "none"
11475 );
11476 props = _3YLGPPWQ_spreadValues({ role }, props);
11477 props = useHovercard(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
11478 store,
11479 portal,
11480 gutter,
11481 preserveTabOrder,
11482 hideOnHoverOutside(event) {
11483 if (isFalsyBooleanCallback(hideOnHoverOutside, event)) return false;
11484 const anchorElement = store == null ? void 0 : store.getState().anchorElement;
11485 if (!anchorElement) return true;
11486 if ("focusVisible" in anchorElement.dataset) return false;
11487 return true;
11488 },
11489 hideOnInteractOutside: (event) => {
11490 if (isFalsyBooleanCallback(hideOnInteractOutside, event)) return false;
11491 const anchorElement = store == null ? void 0 : store.getState().anchorElement;
11492 if (!anchorElement) return true;
11493 if (contains(anchorElement, event.target)) return false;
11494 return true;
11495 }
11496 }));
11497 return props;
11498 }
11499);
11500var Tooltip = createDialogComponent(
11501 forwardRef2(function Tooltip2(props) {
11502 const htmlProps = useTooltip(props);
11503 return LMDWO4NN_createElement(tooltip_TagName, htmlProps);
11504 }),
11505 useTooltipProviderContext
11506);
11507
11508
11509;// external ["wp","deprecated"]
11510const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
11511var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
11512;// ./node_modules/@wordpress/components/build-module/shortcut/index.js
11513
11514function Shortcut(props) {
11515 const {
11516 shortcut,
11517 className
11518 } = props;
11519 if (!shortcut) {
11520 return null;
11521 }
11522 let displayText;
11523 let ariaLabel;
11524 if (typeof shortcut === "string") {
11525 displayText = shortcut;
11526 }
11527 if (shortcut !== null && typeof shortcut === "object") {
11528 displayText = shortcut.display;
11529 ariaLabel = shortcut.ariaLabel;
11530 }
11531 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
11532 className,
11533 "aria-label": ariaLabel,
11534 children: displayText
11535 });
11536}
11537var shortcut_default = Shortcut;
11538
11539
11540;// ./node_modules/@wordpress/components/build-module/popover/utils.js
11541const POSITION_TO_PLACEMENT = {
11542 bottom: "bottom",
11543 top: "top",
11544 "middle left": "left",
11545 "middle right": "right",
11546 "bottom left": "bottom-end",
11547 "bottom center": "bottom",
11548 "bottom right": "bottom-start",
11549 "top left": "top-end",
11550 "top center": "top",
11551 "top right": "top-start",
11552 "middle left left": "left",
11553 "middle left right": "left",
11554 "middle left bottom": "left-end",
11555 "middle left top": "left-start",
11556 "middle right left": "right",
11557 "middle right right": "right",
11558 "middle right bottom": "right-end",
11559 "middle right top": "right-start",
11560 "bottom left left": "bottom-end",
11561 "bottom left right": "bottom-end",
11562 "bottom left bottom": "bottom-end",
11563 "bottom left top": "bottom-end",
11564 "bottom center left": "bottom",
11565 "bottom center right": "bottom",
11566 "bottom center bottom": "bottom",
11567 "bottom center top": "bottom",
11568 "bottom right left": "bottom-start",
11569 "bottom right right": "bottom-start",
11570 "bottom right bottom": "bottom-start",
11571 "bottom right top": "bottom-start",
11572 "top left left": "top-end",
11573 "top left right": "top-end",
11574 "top left bottom": "top-end",
11575 "top left top": "top-end",
11576 "top center left": "top",
11577 "top center right": "top",
11578 "top center bottom": "top",
11579 "top center top": "top",
11580 "top right left": "top-start",
11581 "top right right": "top-start",
11582 "top right bottom": "top-start",
11583 "top right top": "top-start",
11584 // `middle`/`middle center [corner?]` positions are associated to a fallback
11585 // `bottom` placement because there aren't any corresponding placement values.
11586 middle: "bottom",
11587 "middle center": "bottom",
11588 "middle center bottom": "bottom",
11589 "middle center left": "bottom",
11590 "middle center right": "bottom",
11591 "middle center top": "bottom"
11592};
11593const positionToPlacement = (position) => {
11594 var _POSITION_TO_PLACEMEN;
11595 return (_POSITION_TO_PLACEMEN = POSITION_TO_PLACEMENT[position]) !== null && _POSITION_TO_PLACEMEN !== void 0 ? _POSITION_TO_PLACEMEN : "bottom";
11596};
11597const PLACEMENT_TO_ANIMATION_ORIGIN = {
11598 top: {
11599 originX: 0.5,
11600 originY: 1
11601 },
11602 // open from bottom, center
11603 "top-start": {
11604 originX: 0,
11605 originY: 1
11606 },
11607 // open from bottom, left
11608 "top-end": {
11609 originX: 1,
11610 originY: 1
11611 },
11612 // open from bottom, right
11613 right: {
11614 originX: 0,
11615 originY: 0.5
11616 },
11617 // open from middle, left
11618 "right-start": {
11619 originX: 0,
11620 originY: 0
11621 },
11622 // open from top, left
11623 "right-end": {
11624 originX: 0,
11625 originY: 1
11626 },
11627 // open from bottom, left
11628 bottom: {
11629 originX: 0.5,
11630 originY: 0
11631 },
11632 // open from top, center
11633 "bottom-start": {
11634 originX: 0,
11635 originY: 0
11636 },
11637 // open from top, left
11638 "bottom-end": {
11639 originX: 1,
11640 originY: 0
11641 },
11642 // open from top, right
11643 left: {
11644 originX: 1,
11645 originY: 0.5
11646 },
11647 // open from middle, right
11648 "left-start": {
11649 originX: 1,
11650 originY: 0
11651 },
11652 // open from top, right
11653 "left-end": {
11654 originX: 1,
11655 originY: 1
11656 },
11657 // open from bottom, right
11658 overlay: {
11659 originX: 0.5,
11660 originY: 0.5
11661 }
11662 // open from center, center
11663};
11664const placementToMotionAnimationProps = (placement) => {
11665 const translateProp = placement.startsWith("top") || placement.startsWith("bottom") ? "translateY" : "translateX";
11666 const translateDirection = placement.startsWith("top") || placement.startsWith("left") ? 1 : -1;
11667 return {
11668 style: PLACEMENT_TO_ANIMATION_ORIGIN[placement],
11669 initial: {
11670 opacity: 0,
11671 scale: 0,
11672 [translateProp]: `${2 * translateDirection}em`
11673 },
11674 animate: {
11675 opacity: 1,
11676 scale: 1,
11677 [translateProp]: 0
11678 },
11679 transition: {
11680 duration: 0.1,
11681 ease: [0, 0, 0.2, 1]
11682 }
11683 };
11684};
11685function isTopBottom(anchorRef) {
11686 return !!anchorRef?.top;
11687}
11688function isRef(anchorRef) {
11689 return !!anchorRef?.current;
11690}
11691const getReferenceElement = ({
11692 anchor,
11693 anchorRef,
11694 anchorRect,
11695 getAnchorRect,
11696 fallbackReferenceElement
11697}) => {
11698 var _referenceElement;
11699 let referenceElement = null;
11700 if (anchor) {
11701 referenceElement = anchor;
11702 } else if (isTopBottom(anchorRef)) {
11703 referenceElement = {
11704 getBoundingClientRect() {
11705 const topRect = anchorRef.top.getBoundingClientRect();
11706 const bottomRect = anchorRef.bottom.getBoundingClientRect();
11707 return new window.DOMRect(topRect.x, topRect.y, topRect.width, bottomRect.bottom - topRect.top);
11708 }
11709 };
11710 } else if (isRef(anchorRef)) {
11711 referenceElement = anchorRef.current;
11712 } else if (anchorRef) {
11713 referenceElement = anchorRef;
11714 } else if (anchorRect) {
11715 referenceElement = {
11716 getBoundingClientRect() {
11717 return anchorRect;
11718 }
11719 };
11720 } else if (getAnchorRect) {
11721 referenceElement = {
11722 getBoundingClientRect() {
11723 var _rect$x, _rect$y, _rect$width, _rect$height;
11724 const rect = getAnchorRect(fallbackReferenceElement);
11725 return new window.DOMRect((_rect$x = rect.x) !== null && _rect$x !== void 0 ? _rect$x : rect.left, (_rect$y = rect.y) !== null && _rect$y !== void 0 ? _rect$y : rect.top, (_rect$width = rect.width) !== null && _rect$width !== void 0 ? _rect$width : rect.right - rect.left, (_rect$height = rect.height) !== null && _rect$height !== void 0 ? _rect$height : rect.bottom - rect.top);
11726 }
11727 };
11728 } else if (fallbackReferenceElement) {
11729 referenceElement = fallbackReferenceElement.parentElement;
11730 }
11731 return (_referenceElement = referenceElement) !== null && _referenceElement !== void 0 ? _referenceElement : null;
11732};
11733const computePopoverPosition = (c) => c === null || Number.isNaN(c) ? void 0 : Math.round(c);
11734
11735
11736;// ./node_modules/@wordpress/components/build-module/tooltip/index.js
11737
11738
11739
11740
11741
11742
11743
11744
11745const TooltipInternalContext = (0,external_wp_element_namespaceObject.createContext)({
11746 isNestedInTooltip: false
11747});
11748TooltipInternalContext.displayName = "TooltipInternalContext";
11749const TOOLTIP_DELAY = 700;
11750const CONTEXT_VALUE = {
11751 isNestedInTooltip: true
11752};
11753function UnforwardedTooltip(props, ref) {
11754 const {
11755 children,
11756 className,
11757 delay = TOOLTIP_DELAY,
11758 hideOnClick = true,
11759 placement,
11760 position,
11761 shortcut,
11762 text,
11763 ...restProps
11764 } = props;
11765 const {
11766 isNestedInTooltip
11767 } = (0,external_wp_element_namespaceObject.useContext)(TooltipInternalContext);
11768 const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(tooltip_Tooltip, "tooltip");
11769 const describedById = text || shortcut ? baseId : void 0;
11770 const isOnlyChild = external_wp_element_namespaceObject.Children.count(children) === 1;
11771 if (!isOnlyChild) {
11772 if (false) {}
11773 }
11774 let computedPlacement;
11775 if (placement !== void 0) {
11776 computedPlacement = placement;
11777 } else if (position !== void 0) {
11778 computedPlacement = positionToPlacement(position);
11779 external_wp_deprecated_default()("`position` prop in wp.components.tooltip", {
11780 since: "6.4",
11781 alternative: "`placement` prop"
11782 });
11783 }
11784 computedPlacement = computedPlacement || "bottom";
11785 const tooltipStore = useTooltipStore({
11786 placement: computedPlacement,
11787 showTimeout: delay
11788 });
11789 const mounted = useStoreState(tooltipStore, "mounted");
11790 if (isNestedInTooltip) {
11791 return isOnlyChild ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, {
11792 ...restProps,
11793 render: children
11794 }) : children;
11795 }
11796 function addDescribedById(element) {
11797 return describedById && mounted && element.props["aria-describedby"] === void 0 && element.props["aria-label"] !== text ? (0,external_wp_element_namespaceObject.cloneElement)(element, {
11798 "aria-describedby": describedById
11799 }) : element;
11800 }
11801 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(TooltipInternalContext.Provider, {
11802 value: CONTEXT_VALUE,
11803 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipAnchor, {
11804 onClick: hideOnClick ? tooltipStore.hide : void 0,
11805 store: tooltipStore,
11806 render: isOnlyChild ? addDescribedById(children) : void 0,
11807 ref,
11808 children: isOnlyChild ? void 0 : children
11809 }), isOnlyChild && (text || shortcut) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tooltip, {
11810 ...restProps,
11811 className: dist_clsx("components-tooltip", className),
11812 unmountOnHide: true,
11813 gutter: 4,
11814 id: describedById,
11815 overflowPadding: 0.5,
11816 store: tooltipStore,
11817 children: [text, shortcut && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, {
11818 className: text ? "components-tooltip__shortcut" : "",
11819 shortcut
11820 })]
11821 })]
11822 });
11823}
11824const tooltip_Tooltip = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTooltip);
11825var tooltip_default = tooltip_Tooltip;
11826
11827
11828;// external ["wp","warning"]
11829const external_wp_warning_namespaceObject = window["wp"]["warning"];
11830var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
11831// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
11832var cjs = __webpack_require__(66);
11833var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
11834// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
11835var es6 = __webpack_require__(7734);
11836var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
11837;// ./node_modules/is-plain-object/dist/is-plain-object.mjs
11838/*!
11839 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
11840 *
11841 * Copyright (c) 2014-2017, Jon Schlinkert.
11842 * Released under the MIT License.
11843 */
11844
11845function is_plain_object_isObject(o) {
11846 return Object.prototype.toString.call(o) === '[object Object]';
11847}
11848
11849function isPlainObject(o) {
11850 var ctor,prot;
11851
11852 if (is_plain_object_isObject(o) === false) return false;
11853
11854 // If has modified constructor
11855 ctor = o.constructor;
11856 if (ctor === undefined) return true;
11857
11858 // If has modified prototype
11859 prot = ctor.prototype;
11860 if (is_plain_object_isObject(prot) === false) return false;
11861
11862 // If constructor does not have an Object-specific method
11863 if (prot.hasOwnProperty('isPrototypeOf') === false) {
11864 return false;
11865 }
11866
11867 // Most likely a plain Object
11868 return true;
11869}
11870
11871
11872
11873;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js
11874
11875function use_update_effect_useUpdateEffect(effect, deps) {
11876 const mountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
11877 (0,external_wp_element_namespaceObject.useEffect)(() => {
11878 if (mountedRef.current) {
11879 return effect();
11880 }
11881 mountedRef.current = true;
11882 return void 0;
11883 }, deps);
11884 (0,external_wp_element_namespaceObject.useEffect)(() => () => {
11885 mountedRef.current = false;
11886 }, []);
11887}
11888var use_update_effect_default = use_update_effect_useUpdateEffect;
11889
11890
11891;// ./node_modules/@wordpress/components/build-module/context/context-system-provider.js
11892
11893
11894
11895
11896
11897
11898
11899const ComponentsContext = (0,external_wp_element_namespaceObject.createContext)(
11900 /** @type {Record<string, any>} */
11901 {}
11902);
11903ComponentsContext.displayName = "ComponentsContext";
11904const useComponentsContext = () => (0,external_wp_element_namespaceObject.useContext)(ComponentsContext);
11905function useContextSystemBridge({
11906 value
11907}) {
11908 const parentContext = useComponentsContext();
11909 const valueRef = (0,external_wp_element_namespaceObject.useRef)(value);
11910 use_update_effect_default(() => {
11911 if (
11912 // Objects are equivalent.
11913 es6_default()(valueRef.current, value) && // But not the same reference.
11914 valueRef.current !== value
11915 ) {
11916 true ? external_wp_warning_default()(`Please memoize your context: ${JSON.stringify(value)}`) : 0;
11917 }
11918 }, [value]);
11919 const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
11920 return cjs_default()(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {
11921 isMergeableObject: isPlainObject
11922 });
11923 }, [parentContext, value]);
11924 return config;
11925}
11926const BaseContextSystemProvider = ({
11927 children,
11928 value
11929}) => {
11930 const contextValue = useContextSystemBridge({
11931 value
11932 });
11933 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentsContext.Provider, {
11934 value: contextValue,
11935 children
11936 });
11937};
11938const ContextSystemProvider = (0,external_wp_element_namespaceObject.memo)(BaseContextSystemProvider);
11939
11940
11941;// ./node_modules/@wordpress/components/build-module/context/constants.js
11942const COMPONENT_NAMESPACE = "data-wp-component";
11943const CONNECTED_NAMESPACE = "data-wp-c16t";
11944const CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
11945
11946
11947;// ./node_modules/@wordpress/components/build-module/context/utils.js
11948
11949function getNamespace(componentName) {
11950 return {
11951 [COMPONENT_NAMESPACE]: componentName
11952 };
11953}
11954function getConnectedNamespace() {
11955 return {
11956 [CONNECTED_NAMESPACE]: true
11957 };
11958}
11959
11960
11961;// ./node_modules/tslib/tslib.es6.mjs
11962/******************************************************************************
11963Copyright (c) Microsoft Corporation.
11964
11965Permission to use, copy, modify, and/or distribute this software for any
11966purpose with or without fee is hereby granted.
11967
11968THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11969REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11970AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11971INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11972LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
11973OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
11974PERFORMANCE OF THIS SOFTWARE.
11975***************************************************************************** */
11976/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
11977
11978var extendStatics = function(d, b) {
11979 extendStatics = Object.setPrototypeOf ||
11980 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11981 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
11982 return extendStatics(d, b);
11983};
11984
11985function __extends(d, b) {
11986 if (typeof b !== "function" && b !== null)
11987 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11988 extendStatics(d, b);
11989 function __() { this.constructor = d; }
11990 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11991}
11992
11993var __assign = function() {
11994 __assign = Object.assign || function __assign(t) {
11995 for (var s, i = 1, n = arguments.length; i < n; i++) {
11996 s = arguments[i];
11997 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
11998 }
11999 return t;
12000 }
12001 return __assign.apply(this, arguments);
12002}
12003
12004function __rest(s, e) {
12005 var t = {};
12006 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12007 t[p] = s[p];
12008 if (s != null && typeof Object.getOwnPropertySymbols === "function")
12009 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12010 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12011 t[p[i]] = s[p[i]];
12012 }
12013 return t;
12014}
12015
12016function __decorate(decorators, target, key, desc) {
12017 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12018 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12019 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12020 return c > 3 && r && Object.defineProperty(target, key, r), r;
12021}
12022
12023function __param(paramIndex, decorator) {
12024 return function (target, key) { decorator(target, key, paramIndex); }
12025}
12026
12027function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
12028 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
12029 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
12030 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12031 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
12032 var _, done = false;
12033 for (var i = decorators.length - 1; i >= 0; i--) {
12034 var context = {};
12035 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
12036 for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12037 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12038 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
12039 if (kind === "accessor") {
12040 if (result === void 0) continue;
12041 if (result === null || typeof result !== "object") throw new TypeError("Object expected");
12042 if (_ = accept(result.get)) descriptor.get = _;
12043 if (_ = accept(result.set)) descriptor.set = _;
12044 if (_ = accept(result.init)) initializers.unshift(_);
12045 }
12046 else if (_ = accept(result)) {
12047 if (kind === "field") initializers.unshift(_);
12048 else descriptor[key] = _;
12049 }
12050 }
12051 if (target) Object.defineProperty(target, contextIn.name, descriptor);
12052 done = true;
12053};
12054
12055function __runInitializers(thisArg, initializers, value) {
12056 var useValue = arguments.length > 2;
12057 for (var i = 0; i < initializers.length; i++) {
12058 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
12059 }
12060 return useValue ? value : void 0;
12061};
12062
12063function __propKey(x) {
12064 return typeof x === "symbol" ? x : "".concat(x);
12065};
12066
12067function __setFunctionName(f, name, prefix) {
12068 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
12069 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
12070};
12071
12072function __metadata(metadataKey, metadataValue) {
12073 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
12074}
12075
12076function __awaiter(thisArg, _arguments, P, generator) {
12077 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12078 return new (P || (P = Promise))(function (resolve, reject) {
12079 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12080 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12081 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12082 step((generator = generator.apply(thisArg, _arguments || [])).next());
12083 });
12084}
12085
12086function __generator(thisArg, body) {
12087 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12088 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12089 function verb(n) { return function (v) { return step([n, v]); }; }
12090 function step(op) {
12091 if (f) throw new TypeError("Generator is already executing.");
12092 while (g && (g = 0, op[0] && (_ = 0)), _) try {
12093 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
12094 if (y = 0, t) op = [op[0] & 2, t.value];
12095 switch (op[0]) {
12096 case 0: case 1: t = op; break;
12097 case 4: _.label++; return { value: op[1], done: false };
12098 case 5: _.label++; y = op[1]; op = [0]; continue;
12099 case 7: op = _.ops.pop(); _.trys.pop(); continue;
12100 default:
12101 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
12102 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
12103 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
12104 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
12105 if (t[2]) _.ops.pop();
12106 _.trys.pop(); continue;
12107 }
12108 op = body.call(thisArg, _);
12109 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
12110 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
12111 }
12112}
12113
12114var __createBinding = Object.create ? (function(o, m, k, k2) {
12115 if (k2 === undefined) k2 = k;
12116 var desc = Object.getOwnPropertyDescriptor(m, k);
12117 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12118 desc = { enumerable: true, get: function() { return m[k]; } };
12119 }
12120 Object.defineProperty(o, k2, desc);
12121}) : (function(o, m, k, k2) {
12122 if (k2 === undefined) k2 = k;
12123 o[k2] = m[k];
12124});
12125
12126function __exportStar(m, o) {
12127 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
12128}
12129
12130function __values(o) {
12131 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
12132 if (m) return m.call(o);
12133 if (o && typeof o.length === "number") return {
12134 next: function () {
12135 if (o && i >= o.length) o = void 0;
12136 return { value: o && o[i++], done: !o };
12137 }
12138 };
12139 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12140}
12141
12142function __read(o, n) {
12143 var m = typeof Symbol === "function" && o[Symbol.iterator];
12144 if (!m) return o;
12145 var i = m.call(o), r, ar = [], e;
12146 try {
12147 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12148 }
12149 catch (error) { e = { error: error }; }
12150 finally {
12151 try {
12152 if (r && !r.done && (m = i["return"])) m.call(i);
12153 }
12154 finally { if (e) throw e.error; }
12155 }
12156 return ar;
12157}
12158
12159/** @deprecated */
12160function __spread() {
12161 for (var ar = [], i = 0; i < arguments.length; i++)
12162 ar = ar.concat(__read(arguments[i]));
12163 return ar;
12164}
12165
12166/** @deprecated */
12167function __spreadArrays() {
12168 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
12169 for (var r = Array(s), k = 0, i = 0; i < il; i++)
12170 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
12171 r[k] = a[j];
12172 return r;
12173}
12174
12175function __spreadArray(to, from, pack) {
12176 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
12177 if (ar || !(i in from)) {
12178 if (!ar) ar = Array.prototype.slice.call(from, 0, i);
12179 ar[i] = from[i];
12180 }
12181 }
12182 return to.concat(ar || Array.prototype.slice.call(from));
12183}
12184
12185function __await(v) {
12186 return this instanceof __await ? (this.v = v, this) : new __await(v);
12187}
12188
12189function __asyncGenerator(thisArg, _arguments, generator) {
12190 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
12191 var g = generator.apply(thisArg, _arguments || []), i, q = [];
12192 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
12193 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
12194 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
12195 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
12196 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
12197 function fulfill(value) { resume("next", value); }
12198 function reject(value) { resume("throw", value); }
12199 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
12200}
12201
12202function __asyncDelegator(o) {
12203 var i, p;
12204 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
12205 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
12206}
12207
12208function __asyncValues(o) {
12209 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
12210 var m = o[Symbol.asyncIterator], i;
12211 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
12212 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
12213 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
12214}
12215
12216function __makeTemplateObject(cooked, raw) {
12217 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
12218 return cooked;
12219};
12220
12221var __setModuleDefault = Object.create ? (function(o, v) {
12222 Object.defineProperty(o, "default", { enumerable: true, value: v });
12223}) : function(o, v) {
12224 o["default"] = v;
12225};
12226
12227var ownKeys = function(o) {
12228 ownKeys = Object.getOwnPropertyNames || function (o) {
12229 var ar = [];
12230 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
12231 return ar;
12232 };
12233 return ownKeys(o);
12234};
12235
12236function __importStar(mod) {
12237 if (mod && mod.__esModule) return mod;
12238 var result = {};
12239 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
12240 __setModuleDefault(result, mod);
12241 return result;
12242}
12243
12244function __importDefault(mod) {
12245 return (mod && mod.__esModule) ? mod : { default: mod };
12246}
12247
12248function __classPrivateFieldGet(receiver, state, kind, f) {
12249 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12250 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12251 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12252}
12253
12254function __classPrivateFieldSet(receiver, state, value, kind, f) {
12255 if (kind === "m") throw new TypeError("Private method is not writable");
12256 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12257 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
12258 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12259}
12260
12261function __classPrivateFieldIn(state, receiver) {
12262 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
12263 return typeof state === "function" ? receiver === state : state.has(receiver);
12264}
12265
12266function __addDisposableResource(env, value, async) {
12267 if (value !== null && value !== void 0) {
12268 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
12269 var dispose, inner;
12270 if (async) {
12271 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
12272 dispose = value[Symbol.asyncDispose];
12273 }
12274 if (dispose === void 0) {
12275 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
12276 dispose = value[Symbol.dispose];
12277 if (async) inner = dispose;
12278 }
12279 if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
12280 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
12281 env.stack.push({ value: value, dispose: dispose, async: async });
12282 }
12283 else if (async) {
12284 env.stack.push({ async: true });
12285 }
12286 return value;
12287}
12288
12289var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
12290 var e = new Error(message);
12291 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
12292};
12293
12294function __disposeResources(env) {
12295 function fail(e) {
12296 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
12297 env.hasError = true;
12298 }
12299 var r, s = 0;
12300 function next() {
12301 while (r = env.stack.pop()) {
12302 try {
12303 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
12304 if (r.dispose) {
12305 var result = r.dispose.call(r.value);
12306 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
12307 }
12308 else s |= 1;
12309 }
12310 catch (e) {
12311 fail(e);
12312 }
12313 }
12314 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
12315 if (env.hasError) throw env.error;
12316 }
12317 return next();
12318}
12319
12320function __rewriteRelativeImportExtension(path, preserveJsx) {
12321 if (typeof path === "string" && /^\.\.?\//.test(path)) {
12322 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
12323 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
12324 });
12325 }
12326 return path;
12327}
12328
12329/* harmony default export */ const tslib_es6 = ({
12330 __extends,
12331 __assign,
12332 __rest,
12333 __decorate,
12334 __param,
12335 __esDecorate,
12336 __runInitializers,
12337 __propKey,
12338 __setFunctionName,
12339 __metadata,
12340 __awaiter,
12341 __generator,
12342 __createBinding,
12343 __exportStar,
12344 __values,
12345 __read,
12346 __spread,
12347 __spreadArrays,
12348 __spreadArray,
12349 __await,
12350 __asyncGenerator,
12351 __asyncDelegator,
12352 __asyncValues,
12353 __makeTemplateObject,
12354 __importStar,
12355 __importDefault,
12356 __classPrivateFieldGet,
12357 __classPrivateFieldSet,
12358 __classPrivateFieldIn,
12359 __addDisposableResource,
12360 __disposeResources,
12361 __rewriteRelativeImportExtension,
12362});
12363
12364;// ./node_modules/lower-case/dist.es2015/index.js
12365/**
12366 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
12367 */
12368var SUPPORTED_LOCALE = {
12369 tr: {
12370 regexp: /\u0130|\u0049|\u0049\u0307/g,
12371 map: {
12372 İ: "\u0069",
12373 I: "\u0131",
12374 İ: "\u0069",
12375 },
12376 },
12377 az: {
12378 regexp: /\u0130/g,
12379 map: {
12380 İ: "\u0069",
12381 I: "\u0131",
12382 İ: "\u0069",
12383 },
12384 },
12385 lt: {
12386 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
12387 map: {
12388 I: "\u0069\u0307",
12389 J: "\u006A\u0307",
12390 Į: "\u012F\u0307",
12391 Ì: "\u0069\u0307\u0300",
12392 Í: "\u0069\u0307\u0301",
12393 Ĩ: "\u0069\u0307\u0303",
12394 },
12395 },
12396};
12397/**
12398 * Localized lower case.
12399 */
12400function localeLowerCase(str, locale) {
12401 var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
12402 if (lang)
12403 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
12404 return lowerCase(str);
12405}
12406/**
12407 * Lower case as a function.
12408 */
12409function lowerCase(str) {
12410 return str.toLowerCase();
12411}
12412
12413;// ./node_modules/no-case/dist.es2015/index.js
12414
12415// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
12416var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
12417// Remove all non-word characters.
12418var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
12419/**
12420 * Normalize the string into something other libraries can manipulate easier.
12421 */
12422function noCase(input, options) {
12423 if (options === void 0) { options = {}; }
12424 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
12425 var result = dist_es2015_replace(dist_es2015_replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
12426 var start = 0;
12427 var end = result.length;
12428 // Trim the delimiter from around the output string.
12429 while (result.charAt(start) === "\0")
12430 start++;
12431 while (result.charAt(end - 1) === "\0")
12432 end--;
12433 // Transform each token independently.
12434 return result.slice(start, end).split("\0").map(transform).join(delimiter);
12435}
12436/**
12437 * Replace `re` in the input string with the replacement value.
12438 */
12439function dist_es2015_replace(input, re, value) {
12440 if (re instanceof RegExp)
12441 return input.replace(re, value);
12442 return re.reduce(function (input, re) { return input.replace(re, value); }, input);
12443}
12444
12445;// ./node_modules/dot-case/dist.es2015/index.js
12446
12447
12448function dotCase(input, options) {
12449 if (options === void 0) { options = {}; }
12450 return noCase(input, __assign({ delimiter: "." }, options));
12451}
12452
12453;// ./node_modules/param-case/dist.es2015/index.js
12454
12455
12456function paramCase(input, options) {
12457 if (options === void 0) { options = {}; }
12458 return dotCase(input, __assign({ delimiter: "-" }, options));
12459}
12460
12461;// ./node_modules/memize/dist/index.js
12462/**
12463 * Memize options object.
12464 *
12465 * @typedef MemizeOptions
12466 *
12467 * @property {number} [maxSize] Maximum size of the cache.
12468 */
12469
12470/**
12471 * Internal cache entry.
12472 *
12473 * @typedef MemizeCacheNode
12474 *
12475 * @property {?MemizeCacheNode|undefined} [prev] Previous node.
12476 * @property {?MemizeCacheNode|undefined} [next] Next node.
12477 * @property {Array<*>} args Function arguments for cache
12478 * entry.
12479 * @property {*} val Function result.
12480 */
12481
12482/**
12483 * Properties of the enhanced function for controlling cache.
12484 *
12485 * @typedef MemizeMemoizedFunction
12486 *
12487 * @property {()=>void} clear Clear the cache.
12488 */
12489
12490/**
12491 * Accepts a function to be memoized, and returns a new memoized function, with
12492 * optional options.
12493 *
12494 * @template {(...args: any[]) => any} F
12495 *
12496 * @param {F} fn Function to memoize.
12497 * @param {MemizeOptions} [options] Options object.
12498 *
12499 * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
12500 */
12501function memize(fn, options) {
12502 var size = 0;
12503
12504 /** @type {?MemizeCacheNode|undefined} */
12505 var head;
12506
12507 /** @type {?MemizeCacheNode|undefined} */
12508 var tail;
12509
12510 options = options || {};
12511
12512 function memoized(/* ...args */) {
12513 var node = head,
12514 len = arguments.length,
12515 args,
12516 i;
12517
12518 searchCache: while (node) {
12519 // Perform a shallow equality test to confirm that whether the node
12520 // under test is a candidate for the arguments passed. Two arrays
12521 // are shallowly equal if their length matches and each entry is
12522 // strictly equal between the two sets. Avoid abstracting to a
12523 // function which could incur an arguments leaking deoptimization.
12524
12525 // Check whether node arguments match arguments length
12526 if (node.args.length !== arguments.length) {
12527 node = node.next;
12528 continue;
12529 }
12530
12531 // Check whether node arguments match arguments values
12532 for (i = 0; i < len; i++) {
12533 if (node.args[i] !== arguments[i]) {
12534 node = node.next;
12535 continue searchCache;
12536 }
12537 }
12538
12539 // At this point we can assume we've found a match
12540
12541 // Surface matched node to head if not already
12542 if (node !== head) {
12543 // As tail, shift to previous. Must only shift if not also
12544 // head, since if both head and tail, there is no previous.
12545 if (node === tail) {
12546 tail = node.prev;
12547 }
12548
12549 // Adjust siblings to point to each other. If node was tail,
12550 // this also handles new tail's empty `next` assignment.
12551 /** @type {MemizeCacheNode} */ (node.prev).next = node.next;
12552 if (node.next) {
12553 node.next.prev = node.prev;
12554 }
12555
12556 node.next = head;
12557 node.prev = null;
12558 /** @type {MemizeCacheNode} */ (head).prev = node;
12559 head = node;
12560 }
12561
12562 // Return immediately
12563 return node.val;
12564 }
12565
12566 // No cached value found. Continue to insertion phase:
12567
12568 // Create a copy of arguments (avoid leaking deoptimization)
12569 args = new Array(len);
12570 for (i = 0; i < len; i++) {
12571 args[i] = arguments[i];
12572 }
12573
12574 node = {
12575 args: args,
12576
12577 // Generate the result from original function
12578 val: fn.apply(null, args),
12579 };
12580
12581 // Don't need to check whether node is already head, since it would
12582 // have been returned above already if it was
12583
12584 // Shift existing head down list
12585 if (head) {
12586 head.prev = node;
12587 node.next = head;
12588 } else {
12589 // If no head, follows that there's no tail (at initial or reset)
12590 tail = node;
12591 }
12592
12593 // Trim tail if we're reached max size and are pending cache insertion
12594 if (size === /** @type {MemizeOptions} */ (options).maxSize) {
12595 tail = /** @type {MemizeCacheNode} */ (tail).prev;
12596 /** @type {MemizeCacheNode} */ (tail).next = null;
12597 } else {
12598 size++;
12599 }
12600
12601 head = node;
12602
12603 return node.val;
12604 }
12605
12606 memoized.clear = function () {
12607 head = null;
12608 tail = null;
12609 size = 0;
12610 };
12611
12612 // Ignore reason: There's not a clear solution to create an intersection of
12613 // the function with additional properties, where the goal is to retain the
12614 // function signature of the incoming argument and add control properties
12615 // on the return value.
12616
12617 // @ts-ignore
12618 return memoized;
12619}
12620
12621
12622
12623;// ./node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.js
12624
12625
12626function getStyledClassName(namespace) {
12627 const kebab = paramCase(namespace);
12628 return `components-${kebab}`;
12629}
12630const getStyledClassNameFromKey = memize(getStyledClassName);
12631
12632
12633;// ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
12634/*
12635
12636Based off glamor's StyleSheet, thanks Sunil ❤️
12637
12638high performance StyleSheet for css-in-js systems
12639
12640- uses multiple style tags behind the scenes for millions of rules
12641- uses `insertRule` for appending in production for *much* faster performance
12642
12643// usage
12644
12645import { StyleSheet } from '@emotion/sheet'
12646
12647let styleSheet = new StyleSheet({ key: '', container: document.head })
12648
12649styleSheet.insert('#box { border: 1px solid red; }')
12650- appends a css rule into the stylesheet
12651
12652styleSheet.flush()
12653- empties the stylesheet of all its contents
12654
12655*/
12656// $FlowFixMe
12657function sheetForTag(tag) {
12658 if (tag.sheet) {
12659 // $FlowFixMe
12660 return tag.sheet;
12661 } // this weirdness brought to you by firefox
12662
12663 /* istanbul ignore next */
12664
12665
12666 for (var i = 0; i < document.styleSheets.length; i++) {
12667 if (document.styleSheets[i].ownerNode === tag) {
12668 // $FlowFixMe
12669 return document.styleSheets[i];
12670 }
12671 }
12672}
12673
12674function createStyleElement(options) {
12675 var tag = document.createElement('style');
12676 tag.setAttribute('data-emotion', options.key);
12677
12678 if (options.nonce !== undefined) {
12679 tag.setAttribute('nonce', options.nonce);
12680 }
12681
12682 tag.appendChild(document.createTextNode(''));
12683 tag.setAttribute('data-s', '');
12684 return tag;
12685}
12686
12687var StyleSheet = /*#__PURE__*/function () {
12688 // Using Node instead of HTMLElement since container may be a ShadowRoot
12689 function StyleSheet(options) {
12690 var _this = this;
12691
12692 this._insertTag = function (tag) {
12693 var before;
12694
12695 if (_this.tags.length === 0) {
12696 if (_this.insertionPoint) {
12697 before = _this.insertionPoint.nextSibling;
12698 } else if (_this.prepend) {
12699 before = _this.container.firstChild;
12700 } else {
12701 before = _this.before;
12702 }
12703 } else {
12704 before = _this.tags[_this.tags.length - 1].nextSibling;
12705 }
12706
12707 _this.container.insertBefore(tag, before);
12708
12709 _this.tags.push(tag);
12710 };
12711
12712 this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
12713 this.tags = [];
12714 this.ctr = 0;
12715 this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
12716
12717 this.key = options.key;
12718 this.container = options.container;
12719 this.prepend = options.prepend;
12720 this.insertionPoint = options.insertionPoint;
12721 this.before = null;
12722 }
12723
12724 var _proto = StyleSheet.prototype;
12725
12726 _proto.hydrate = function hydrate(nodes) {
12727 nodes.forEach(this._insertTag);
12728 };
12729
12730 _proto.insert = function insert(rule) {
12731 // the max length is how many rules we have per style tag, it's 65000 in speedy mode
12732 // it's 1 in dev because we insert source maps that map a single rule to a location
12733 // and you can only have one source map per style tag
12734 if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
12735 this._insertTag(createStyleElement(this));
12736 }
12737
12738 var tag = this.tags[this.tags.length - 1];
12739
12740 if (false) { var isImportRule; }
12741
12742 if (this.isSpeedy) {
12743 var sheet = sheetForTag(tag);
12744
12745 try {
12746 // this is the ultrafast version, works across browsers
12747 // the big drawback is that the css won't be editable in devtools
12748 sheet.insertRule(rule, sheet.cssRules.length);
12749 } catch (e) {
12750 if (false) {}
12751 }
12752 } else {
12753 tag.appendChild(document.createTextNode(rule));
12754 }
12755
12756 this.ctr++;
12757 };
12758
12759 _proto.flush = function flush() {
12760 // $FlowFixMe
12761 this.tags.forEach(function (tag) {
12762 return tag.parentNode && tag.parentNode.removeChild(tag);
12763 });
12764 this.tags = [];
12765 this.ctr = 0;
12766
12767 if (false) {}
12768 };
12769
12770 return StyleSheet;
12771}();
12772
12773
12774
12775;// ./node_modules/stylis/src/Utility.js
12776/**
12777 * @param {number}
12778 * @return {number}
12779 */
12780var abs = Math.abs
12781
12782/**
12783 * @param {number}
12784 * @return {string}
12785 */
12786var Utility_from = String.fromCharCode
12787
12788/**
12789 * @param {object}
12790 * @return {object}
12791 */
12792var Utility_assign = Object.assign
12793
12794/**
12795 * @param {string} value
12796 * @param {number} length
12797 * @return {number}
12798 */
12799function hash (value, length) {
12800 return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0
12801}
12802
12803/**
12804 * @param {string} value
12805 * @return {string}
12806 */
12807function trim (value) {
12808 return value.trim()
12809}
12810
12811/**
12812 * @param {string} value
12813 * @param {RegExp} pattern
12814 * @return {string?}
12815 */
12816function Utility_match (value, pattern) {
12817 return (value = pattern.exec(value)) ? value[0] : value
12818}
12819
12820/**
12821 * @param {string} value
12822 * @param {(string|RegExp)} pattern
12823 * @param {string} replacement
12824 * @return {string}
12825 */
12826function Utility_replace (value, pattern, replacement) {
12827 return value.replace(pattern, replacement)
12828}
12829
12830/**
12831 * @param {string} value
12832 * @param {string} search
12833 * @return {number}
12834 */
12835function indexof (value, search) {
12836 return value.indexOf(search)
12837}
12838
12839/**
12840 * @param {string} value
12841 * @param {number} index
12842 * @return {number}
12843 */
12844function Utility_charat (value, index) {
12845 return value.charCodeAt(index) | 0
12846}
12847
12848/**
12849 * @param {string} value
12850 * @param {number} begin
12851 * @param {number} end
12852 * @return {string}
12853 */
12854function Utility_substr (value, begin, end) {
12855 return value.slice(begin, end)
12856}
12857
12858/**
12859 * @param {string} value
12860 * @return {number}
12861 */
12862function Utility_strlen (value) {
12863 return value.length
12864}
12865
12866/**
12867 * @param {any[]} value
12868 * @return {number}
12869 */
12870function Utility_sizeof (value) {
12871 return value.length
12872}
12873
12874/**
12875 * @param {any} value
12876 * @param {any[]} array
12877 * @return {any}
12878 */
12879function Utility_append (value, array) {
12880 return array.push(value), value
12881}
12882
12883/**
12884 * @param {string[]} array
12885 * @param {function} callback
12886 * @return {string}
12887 */
12888function Utility_combine (array, callback) {
12889 return array.map(callback).join('')
12890}
12891
12892;// ./node_modules/stylis/src/Tokenizer.js
12893
12894
12895var line = 1
12896var column = 1
12897var Tokenizer_length = 0
12898var position = 0
12899var character = 0
12900var characters = ''
12901
12902/**
12903 * @param {string} value
12904 * @param {object | null} root
12905 * @param {object | null} parent
12906 * @param {string} type
12907 * @param {string[] | string} props
12908 * @param {object[] | string} children
12909 * @param {number} length
12910 */
12911function node (value, root, parent, type, props, children, length) {
12912 return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
12913}
12914
12915/**
12916 * @param {object} root
12917 * @param {object} props
12918 * @return {object}
12919 */
12920function Tokenizer_copy (root, props) {
12921 return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
12922}
12923
12924/**
12925 * @return {number}
12926 */
12927function Tokenizer_char () {
12928 return character
12929}
12930
12931/**
12932 * @return {number}
12933 */
12934function prev () {
12935 character = position > 0 ? Utility_charat(characters, --position) : 0
12936
12937 if (column--, character === 10)
12938 column = 1, line--
12939
12940 return character
12941}
12942
12943/**
12944 * @return {number}
12945 */
12946function next () {
12947 character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0
12948
12949 if (column++, character === 10)
12950 column = 1, line++
12951
12952 return character
12953}
12954
12955/**
12956 * @return {number}
12957 */
12958function peek () {
12959 return Utility_charat(characters, position)
12960}
12961
12962/**
12963 * @return {number}
12964 */
12965function caret () {
12966 return position
12967}
12968
12969/**
12970 * @param {number} begin
12971 * @param {number} end
12972 * @return {string}
12973 */
12974function slice (begin, end) {
12975 return Utility_substr(characters, begin, end)
12976}
12977
12978/**
12979 * @param {number} type
12980 * @return {number}
12981 */
12982function token (type) {
12983 switch (type) {
12984 // \0 \t \n \r \s whitespace token
12985 case 0: case 9: case 10: case 13: case 32:
12986 return 5
12987 // ! + , / > @ ~ isolate token
12988 case 33: case 43: case 44: case 47: case 62: case 64: case 126:
12989 // ; { } breakpoint token
12990 case 59: case 123: case 125:
12991 return 4
12992 // : accompanied token
12993 case 58:
12994 return 3
12995 // " ' ( [ opening delimit token
12996 case 34: case 39: case 40: case 91:
12997 return 2
12998 // ) ] closing delimit token
12999 case 41: case 93:
13000 return 1
13001 }
13002
13003 return 0
13004}
13005
13006/**
13007 * @param {string} value
13008 * @return {any[]}
13009 */
13010function alloc (value) {
13011 return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, []
13012}
13013
13014/**
13015 * @param {any} value
13016 * @return {any}
13017 */
13018function dealloc (value) {
13019 return characters = '', value
13020}
13021
13022/**
13023 * @param {number} type
13024 * @return {string}
13025 */
13026function delimit (type) {
13027 return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
13028}
13029
13030/**
13031 * @param {string} value
13032 * @return {string[]}
13033 */
13034function Tokenizer_tokenize (value) {
13035 return dealloc(tokenizer(alloc(value)))
13036}
13037
13038/**
13039 * @param {number} type
13040 * @return {string}
13041 */
13042function whitespace (type) {
13043 while (character = peek())
13044 if (character < 33)
13045 next()
13046 else
13047 break
13048
13049 return token(type) > 2 || token(character) > 3 ? '' : ' '
13050}
13051
13052/**
13053 * @param {string[]} children
13054 * @return {string[]}
13055 */
13056function tokenizer (children) {
13057 while (next())
13058 switch (token(character)) {
13059 case 0: append(identifier(position - 1), children)
13060 break
13061 case 2: append(delimit(character), children)
13062 break
13063 default: append(from(character), children)
13064 }
13065
13066 return children
13067}
13068
13069/**
13070 * @param {number} index
13071 * @param {number} count
13072 * @return {string}
13073 */
13074function escaping (index, count) {
13075 while (--count && next())
13076 // not 0-9 A-F a-f
13077 if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
13078 break
13079
13080 return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
13081}
13082
13083/**
13084 * @param {number} type
13085 * @return {number}
13086 */
13087function delimiter (type) {
13088 while (next())
13089 switch (character) {
13090 // ] ) " '
13091 case type:
13092 return position
13093 // " '
13094 case 34: case 39:
13095 if (type !== 34 && type !== 39)
13096 delimiter(character)
13097 break
13098 // (
13099 case 40:
13100 if (type === 41)
13101 delimiter(type)
13102 break
13103 // \
13104 case 92:
13105 next()
13106 break
13107 }
13108
13109 return position
13110}
13111
13112/**
13113 * @param {number} type
13114 * @param {number} index
13115 * @return {number}
13116 */
13117function commenter (type, index) {
13118 while (next())
13119 // //
13120 if (type + character === 47 + 10)
13121 break
13122 // /*
13123 else if (type + character === 42 + 42 && peek() === 47)
13124 break
13125
13126 return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next())
13127}
13128
13129/**
13130 * @param {number} index
13131 * @return {string}
13132 */
13133function identifier (index) {
13134 while (!token(peek()))
13135 next()
13136
13137 return slice(index, position)
13138}
13139
13140;// ./node_modules/stylis/src/Enum.js
13141var Enum_MS = '-ms-'
13142var Enum_MOZ = '-moz-'
13143var Enum_WEBKIT = '-webkit-'
13144
13145var COMMENT = 'comm'
13146var Enum_RULESET = 'rule'
13147var Enum_DECLARATION = 'decl'
13148
13149var PAGE = '@page'
13150var MEDIA = '@media'
13151var IMPORT = '@import'
13152var CHARSET = '@charset'
13153var VIEWPORT = '@viewport'
13154var SUPPORTS = '@supports'
13155var DOCUMENT = '@document'
13156var NAMESPACE = '@namespace'
13157var Enum_KEYFRAMES = '@keyframes'
13158var FONT_FACE = '@font-face'
13159var COUNTER_STYLE = '@counter-style'
13160var FONT_FEATURE_VALUES = '@font-feature-values'
13161
13162;// ./node_modules/stylis/src/Serializer.js
13163
13164
13165
13166/**
13167 * @param {object[]} children
13168 * @param {function} callback
13169 * @return {string}
13170 */
13171function Serializer_serialize (children, callback) {
13172 var output = ''
13173 var length = Utility_sizeof(children)
13174
13175 for (var i = 0; i < length; i++)
13176 output += callback(children[i], i, children, callback) || ''
13177
13178 return output
13179}
13180
13181/**
13182 * @param {object} element
13183 * @param {number} index
13184 * @param {object[]} children
13185 * @param {function} callback
13186 * @return {string}
13187 */
13188function stringify (element, index, children, callback) {
13189 switch (element.type) {
13190 case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value
13191 case COMMENT: return ''
13192 case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}'
13193 case Enum_RULESET: element.value = element.props.join(',')
13194 }
13195
13196 return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
13197}
13198
13199;// ./node_modules/stylis/src/Middleware.js
13200
13201
13202
13203
13204
13205
13206/**
13207 * @param {function[]} collection
13208 * @return {function}
13209 */
13210function middleware (collection) {
13211 var length = Utility_sizeof(collection)
13212
13213 return function (element, index, children, callback) {
13214 var output = ''
13215
13216 for (var i = 0; i < length; i++)
13217 output += collection[i](element, index, children, callback) || ''
13218
13219 return output
13220 }
13221}
13222
13223/**
13224 * @param {function} callback
13225 * @return {function}
13226 */
13227function rulesheet (callback) {
13228 return function (element) {
13229 if (!element.root)
13230 if (element = element.return)
13231 callback(element)
13232 }
13233}
13234
13235/**
13236 * @param {object} element
13237 * @param {number} index
13238 * @param {object[]} children
13239 * @param {function} callback
13240 */
13241function prefixer (element, index, children, callback) {
13242 if (element.length > -1)
13243 if (!element.return)
13244 switch (element.type) {
13245 case DECLARATION: element.return = prefix(element.value, element.length, children)
13246 return
13247 case KEYFRAMES:
13248 return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
13249 case RULESET:
13250 if (element.length)
13251 return combine(element.props, function (value) {
13252 switch (match(value, /(::plac\w+|:read-\w+)/)) {
13253 // :read-(only|write)
13254 case ':read-only': case ':read-write':
13255 return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
13256 // :placeholder
13257 case '::placeholder':
13258 return serialize([
13259 copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
13260 copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
13261 copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
13262 ], callback)
13263 }
13264
13265 return ''
13266 })
13267 }
13268}
13269
13270/**
13271 * @param {object} element
13272 * @param {number} index
13273 * @param {object[]} children
13274 */
13275function namespace (element) {
13276 switch (element.type) {
13277 case RULESET:
13278 element.props = element.props.map(function (value) {
13279 return combine(tokenize(value), function (value, index, children) {
13280 switch (charat(value, 0)) {
13281 // \f
13282 case 12:
13283 return substr(value, 1, strlen(value))
13284 // \0 ( + > ~
13285 case 0: case 40: case 43: case 62: case 126:
13286 return value
13287 // :
13288 case 58:
13289 if (children[++index] === 'global')
13290 children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
13291 // \s
13292 case 32:
13293 return index === 1 ? '' : value
13294 default:
13295 switch (index) {
13296 case 0: element = value
13297 return sizeof(children) > 1 ? '' : value
13298 case index = sizeof(children) - 1: case 2:
13299 return index === 2 ? value + element + element : value + element
13300 default:
13301 return value
13302 }
13303 }
13304 })
13305 })
13306 }
13307}
13308
13309;// ./node_modules/stylis/src/Parser.js
13310
13311
13312
13313
13314/**
13315 * @param {string} value
13316 * @return {object[]}
13317 */
13318function compile (value) {
13319 return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
13320}
13321
13322/**
13323 * @param {string} value
13324 * @param {object} root
13325 * @param {object?} parent
13326 * @param {string[]} rule
13327 * @param {string[]} rules
13328 * @param {string[]} rulesets
13329 * @param {number[]} pseudo
13330 * @param {number[]} points
13331 * @param {string[]} declarations
13332 * @return {object}
13333 */
13334function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
13335 var index = 0
13336 var offset = 0
13337 var length = pseudo
13338 var atrule = 0
13339 var property = 0
13340 var previous = 0
13341 var variable = 1
13342 var scanning = 1
13343 var ampersand = 1
13344 var character = 0
13345 var type = ''
13346 var props = rules
13347 var children = rulesets
13348 var reference = rule
13349 var characters = type
13350
13351 while (scanning)
13352 switch (previous = character, character = next()) {
13353 // (
13354 case 40:
13355 if (previous != 108 && Utility_charat(characters, length - 1) == 58) {
13356 if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1)
13357 ampersand = -1
13358 break
13359 }
13360 // " ' [
13361 case 34: case 39: case 91:
13362 characters += delimit(character)
13363 break
13364 // \t \n \r \s
13365 case 9: case 10: case 13: case 32:
13366 characters += whitespace(previous)
13367 break
13368 // \
13369 case 92:
13370 characters += escaping(caret() - 1, 7)
13371 continue
13372 // /
13373 case 47:
13374 switch (peek()) {
13375 case 42: case 47:
13376 Utility_append(comment(commenter(next(), caret()), root, parent), declarations)
13377 break
13378 default:
13379 characters += '/'
13380 }
13381 break
13382 // {
13383 case 123 * variable:
13384 points[index++] = Utility_strlen(characters) * ampersand
13385 // } ; \0
13386 case 125 * variable: case 59: case 0:
13387 switch (character) {
13388 // \0 }
13389 case 0: case 125: scanning = 0
13390 // ;
13391 case 59 + offset:
13392 if (property > 0 && (Utility_strlen(characters) - length))
13393 Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
13394 break
13395 // @ ;
13396 case 59: characters += ';'
13397 // { rule/at-rule
13398 default:
13399 Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)
13400
13401 if (character === 123)
13402 if (offset === 0)
13403 parse(characters, root, reference, reference, props, rulesets, length, points, children)
13404 else
13405 switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) {
13406 // d m s
13407 case 100: case 109: case 115:
13408 parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
13409 break
13410 default:
13411 parse(characters, reference, reference, reference, [''], children, 0, points, children)
13412 }
13413 }
13414
13415 index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
13416 break
13417 // :
13418 case 58:
13419 length = 1 + Utility_strlen(characters), property = previous
13420 default:
13421 if (variable < 1)
13422 if (character == 123)
13423 --variable
13424 else if (character == 125 && variable++ == 0 && prev() == 125)
13425 continue
13426
13427 switch (characters += Utility_from(character), character * variable) {
13428 // &
13429 case 38:
13430 ampersand = offset > 0 ? 1 : (characters += '\f', -1)
13431 break
13432 // ,
13433 case 44:
13434 points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1
13435 break
13436 // @
13437 case 64:
13438 // -
13439 if (peek() === 45)
13440 characters += delimit(next())
13441
13442 atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++
13443 break
13444 // -
13445 case 45:
13446 if (previous === 45 && Utility_strlen(characters) == 2)
13447 variable = 0
13448 }
13449 }
13450
13451 return rulesets
13452}
13453
13454/**
13455 * @param {string} value
13456 * @param {object} root
13457 * @param {object?} parent
13458 * @param {number} index
13459 * @param {number} offset
13460 * @param {string[]} rules
13461 * @param {number[]} points
13462 * @param {string} type
13463 * @param {string[]} props
13464 * @param {string[]} children
13465 * @param {number} length
13466 * @return {object}
13467 */
13468function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
13469 var post = offset - 1
13470 var rule = offset === 0 ? rules : ['']
13471 var size = Utility_sizeof(rule)
13472
13473 for (var i = 0, j = 0, k = 0; i < index; ++i)
13474 for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
13475 if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x])))
13476 props[k++] = z
13477
13478 return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length)
13479}
13480
13481/**
13482 * @param {number} value
13483 * @param {object} root
13484 * @param {object?} parent
13485 * @return {object}
13486 */
13487function comment (value, root, parent) {
13488 return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0)
13489}
13490
13491/**
13492 * @param {string} value
13493 * @param {object} root
13494 * @param {object?} parent
13495 * @param {number} length
13496 * @return {object}
13497 */
13498function declaration (value, root, parent, length) {
13499 return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length)
13500}
13501
13502;// ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
13503
13504
13505
13506
13507
13508var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
13509 var previous = 0;
13510 var character = 0;
13511
13512 while (true) {
13513 previous = character;
13514 character = peek(); // &\f
13515
13516 if (previous === 38 && character === 12) {
13517 points[index] = 1;
13518 }
13519
13520 if (token(character)) {
13521 break;
13522 }
13523
13524 next();
13525 }
13526
13527 return slice(begin, position);
13528};
13529
13530var toRules = function toRules(parsed, points) {
13531 // pretend we've started with a comma
13532 var index = -1;
13533 var character = 44;
13534
13535 do {
13536 switch (token(character)) {
13537 case 0:
13538 // &\f
13539 if (character === 38 && peek() === 12) {
13540 // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
13541 // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
13542 // and when it should just concatenate the outer and inner selectors
13543 // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
13544 points[index] = 1;
13545 }
13546
13547 parsed[index] += identifierWithPointTracking(position - 1, points, index);
13548 break;
13549
13550 case 2:
13551 parsed[index] += delimit(character);
13552 break;
13553
13554 case 4:
13555 // comma
13556 if (character === 44) {
13557 // colon
13558 parsed[++index] = peek() === 58 ? '&\f' : '';
13559 points[index] = parsed[index].length;
13560 break;
13561 }
13562
13563 // fallthrough
13564
13565 default:
13566 parsed[index] += Utility_from(character);
13567 }
13568 } while (character = next());
13569
13570 return parsed;
13571};
13572
13573var getRules = function getRules(value, points) {
13574 return dealloc(toRules(alloc(value), points));
13575}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
13576
13577
13578var fixedElements = /* #__PURE__ */new WeakMap();
13579var compat = function compat(element) {
13580 if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
13581 // negative .length indicates that this rule has been already prefixed
13582 element.length < 1) {
13583 return;
13584 }
13585
13586 var value = element.value,
13587 parent = element.parent;
13588 var isImplicitRule = element.column === parent.column && element.line === parent.line;
13589
13590 while (parent.type !== 'rule') {
13591 parent = parent.parent;
13592 if (!parent) return;
13593 } // short-circuit for the simplest case
13594
13595
13596 if (element.props.length === 1 && value.charCodeAt(0) !== 58
13597 /* colon */
13598 && !fixedElements.get(parent)) {
13599 return;
13600 } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
13601 // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
13602
13603
13604 if (isImplicitRule) {
13605 return;
13606 }
13607
13608 fixedElements.set(element, true);
13609 var points = [];
13610 var rules = getRules(value, points);
13611 var parentRules = parent.props;
13612
13613 for (var i = 0, k = 0; i < rules.length; i++) {
13614 for (var j = 0; j < parentRules.length; j++, k++) {
13615 element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
13616 }
13617 }
13618};
13619var removeLabel = function removeLabel(element) {
13620 if (element.type === 'decl') {
13621 var value = element.value;
13622
13623 if ( // charcode for l
13624 value.charCodeAt(0) === 108 && // charcode for b
13625 value.charCodeAt(2) === 98) {
13626 // this ignores label
13627 element["return"] = '';
13628 element.value = '';
13629 }
13630 }
13631};
13632var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
13633
13634var isIgnoringComment = function isIgnoringComment(element) {
13635 return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
13636};
13637
13638var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
13639 return function (element, index, children) {
13640 if (element.type !== 'rule' || cache.compat) return;
13641 var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
13642
13643 if (unsafePseudoClasses) {
13644 var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
13645 //
13646 // considering this input:
13647 // .a {
13648 // .b /* comm */ {}
13649 // color: hotpink;
13650 // }
13651 // we get output corresponding to this:
13652 // .a {
13653 // & {
13654 // /* comm */
13655 // color: hotpink;
13656 // }
13657 // .b {}
13658 // }
13659
13660 var commentContainer = isNested ? children[0].children : // global rule at the root level
13661 children;
13662
13663 for (var i = commentContainer.length - 1; i >= 0; i--) {
13664 var node = commentContainer[i];
13665
13666 if (node.line < element.line) {
13667 break;
13668 } // it is quite weird but comments are *usually* put at `column: element.column - 1`
13669 // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
13670 // this will also match inputs like this:
13671 // .a {
13672 // /* comm */
13673 // .b {}
13674 // }
13675 //
13676 // but that is fine
13677 //
13678 // it would be the easiest to change the placement of the comment to be the first child of the rule:
13679 // .a {
13680 // .b { /* comm */ }
13681 // }
13682 // with such inputs we wouldn't have to search for the comment at all
13683 // TODO: consider changing this comment placement in the next major version
13684
13685
13686 if (node.column < element.column) {
13687 if (isIgnoringComment(node)) {
13688 return;
13689 }
13690
13691 break;
13692 }
13693 }
13694
13695 unsafePseudoClasses.forEach(function (unsafePseudoClass) {
13696 console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
13697 });
13698 }
13699 };
13700};
13701
13702var isImportRule = function isImportRule(element) {
13703 return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
13704};
13705
13706var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
13707 for (var i = index - 1; i >= 0; i--) {
13708 if (!isImportRule(children[i])) {
13709 return true;
13710 }
13711 }
13712
13713 return false;
13714}; // use this to remove incorrect elements from further processing
13715// so they don't get handed to the `sheet` (or anything else)
13716// as that could potentially lead to additional logs which in turn could be overhelming to the user
13717
13718
13719var nullifyElement = function nullifyElement(element) {
13720 element.type = '';
13721 element.value = '';
13722 element["return"] = '';
13723 element.children = '';
13724 element.props = '';
13725};
13726
13727var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
13728 if (!isImportRule(element)) {
13729 return;
13730 }
13731
13732 if (element.parent) {
13733 console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
13734 nullifyElement(element);
13735 } else if (isPrependedWithRegularRules(index, children)) {
13736 console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
13737 nullifyElement(element);
13738 }
13739};
13740
13741/* eslint-disable no-fallthrough */
13742
13743function emotion_cache_browser_esm_prefix(value, length) {
13744 switch (hash(value, length)) {
13745 // color-adjust
13746 case 5103:
13747 return Enum_WEBKIT + 'print-' + value + value;
13748 // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
13749
13750 case 5737:
13751 case 4201:
13752 case 3177:
13753 case 3433:
13754 case 1641:
13755 case 4457:
13756 case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
13757
13758 case 5572:
13759 case 6356:
13760 case 5844:
13761 case 3191:
13762 case 6645:
13763 case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
13764
13765 case 6391:
13766 case 5879:
13767 case 5623:
13768 case 6135:
13769 case 4599:
13770 case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
13771
13772 case 4215:
13773 case 6389:
13774 case 5109:
13775 case 5365:
13776 case 5621:
13777 case 3829:
13778 return Enum_WEBKIT + value + value;
13779 // appearance, user-select, transform, hyphens, text-size-adjust
13780
13781 case 5349:
13782 case 4246:
13783 case 4810:
13784 case 6968:
13785 case 2756:
13786 return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value;
13787 // flex, flex-direction
13788
13789 case 6828:
13790 case 4268:
13791 return Enum_WEBKIT + value + Enum_MS + value + value;
13792 // order
13793
13794 case 6165:
13795 return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value;
13796 // align-items
13797
13798 case 5187:
13799 return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value;
13800 // align-self
13801
13802 case 5443:
13803 return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value;
13804 // align-content
13805
13806 case 4675:
13807 return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value;
13808 // flex-shrink
13809
13810 case 5548:
13811 return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value;
13812 // flex-basis
13813
13814 case 5292:
13815 return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value;
13816 // flex-grow
13817
13818 case 6060:
13819 return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value;
13820 // transition
13821
13822 case 4554:
13823 return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value;
13824 // cursor
13825
13826 case 6187:
13827 return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value;
13828 // background, background-image
13829
13830 case 5495:
13831 case 3959:
13832 return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1');
13833 // justify-content
13834
13835 case 4968:
13836 return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value;
13837 // (margin|padding)-inline-(start|end)
13838
13839 case 4095:
13840 case 3583:
13841 case 4068:
13842 case 2532:
13843 return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value;
13844 // (min|max)?(width|height|inline-size|block-size)
13845
13846 case 8116:
13847 case 7059:
13848 case 5753:
13849 case 5535:
13850 case 5445:
13851 case 5701:
13852 case 4933:
13853 case 4677:
13854 case 5533:
13855 case 5789:
13856 case 5021:
13857 case 4765:
13858 // stretch, max-content, min-content, fill-available
13859 if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) {
13860 // (m)ax-content, (m)in-content
13861 case 109:
13862 // -
13863 if (Utility_charat(value, length + 4) !== 45) break;
13864 // (f)ill-available, (f)it-content
13865
13866 case 102:
13867 return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
13868 // (s)tretch
13869
13870 case 115:
13871 return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value;
13872 }
13873 break;
13874 // position: sticky
13875
13876 case 4949:
13877 // (s)ticky?
13878 if (Utility_charat(value, length + 1) !== 115) break;
13879 // display: (flex|inline-flex)
13880
13881 case 6444:
13882 switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
13883 // stic(k)y
13884 case 107:
13885 return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value;
13886 // (inline-)?fl(e)x
13887
13888 case 101:
13889 return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value;
13890 }
13891
13892 break;
13893 // writing-mode
13894
13895 case 5936:
13896 switch (Utility_charat(value, length + 11)) {
13897 // vertical-l(r)
13898 case 114:
13899 return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
13900 // vertical-r(l)
13901
13902 case 108:
13903 return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
13904 // horizontal(-)tb
13905
13906 case 45:
13907 return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
13908 }
13909
13910 return Enum_WEBKIT + value + Enum_MS + value + value;
13911 }
13912
13913 return value;
13914}
13915
13916var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) {
13917 if (element.length > -1) if (!element["return"]) switch (element.type) {
13918 case Enum_DECLARATION:
13919 element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length);
13920 break;
13921
13922 case Enum_KEYFRAMES:
13923 return Serializer_serialize([Tokenizer_copy(element, {
13924 value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT)
13925 })], callback);
13926
13927 case Enum_RULESET:
13928 if (element.length) return Utility_combine(element.props, function (value) {
13929 switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) {
13930 // :read-(only|write)
13931 case ':read-only':
13932 case ':read-write':
13933 return Serializer_serialize([Tokenizer_copy(element, {
13934 props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')]
13935 })], callback);
13936 // :placeholder
13937
13938 case '::placeholder':
13939 return Serializer_serialize([Tokenizer_copy(element, {
13940 props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')]
13941 }), Tokenizer_copy(element, {
13942 props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')]
13943 }), Tokenizer_copy(element, {
13944 props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')]
13945 })], callback);
13946 }
13947
13948 return '';
13949 });
13950 }
13951};
13952
13953var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer];
13954
13955var createCache = function createCache(options) {
13956 var key = options.key;
13957
13958 if (false) {}
13959
13960 if ( key === 'css') {
13961 var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
13962 // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
13963 // note this very very intentionally targets all style elements regardless of the key to ensure
13964 // that creating a cache works inside of render of a React component
13965
13966 Array.prototype.forEach.call(ssrStyles, function (node) {
13967 // we want to only move elements which have a space in the data-emotion attribute value
13968 // because that indicates that it is an Emotion 11 server-side rendered style elements
13969 // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
13970 // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
13971 // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
13972 // will not result in the Emotion 10 styles being destroyed
13973 var dataEmotionAttribute = node.getAttribute('data-emotion');
13974
13975 if (dataEmotionAttribute.indexOf(' ') === -1) {
13976 return;
13977 }
13978 document.head.appendChild(node);
13979 node.setAttribute('data-s', '');
13980 });
13981 }
13982
13983 var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
13984
13985 if (false) {}
13986
13987 var inserted = {};
13988 var container;
13989 var nodesToHydrate = [];
13990
13991 {
13992 container = options.container || document.head;
13993 Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
13994 // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
13995 document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
13996 var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
13997
13998 for (var i = 1; i < attrib.length; i++) {
13999 inserted[attrib[i]] = true;
14000 }
14001
14002 nodesToHydrate.push(node);
14003 });
14004 }
14005
14006 var _insert;
14007
14008 var omnipresentPlugins = [compat, removeLabel];
14009
14010 if (false) {}
14011
14012 {
14013 var currentSheet;
14014 var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) {
14015 currentSheet.insert(rule);
14016 })];
14017 var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
14018
14019 var stylis = function stylis(styles) {
14020 return Serializer_serialize(compile(styles), serializer);
14021 };
14022
14023 _insert = function insert(selector, serialized, sheet, shouldCache) {
14024 currentSheet = sheet;
14025
14026 if (false) {}
14027
14028 stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
14029
14030 if (shouldCache) {
14031 cache.inserted[serialized.name] = true;
14032 }
14033 };
14034 }
14035
14036 var cache = {
14037 key: key,
14038 sheet: new StyleSheet({
14039 key: key,
14040 container: container,
14041 nonce: options.nonce,
14042 speedy: options.speedy,
14043 prepend: options.prepend,
14044 insertionPoint: options.insertionPoint
14045 }),
14046 nonce: options.nonce,
14047 inserted: inserted,
14048 registered: {},
14049 insert: _insert
14050 };
14051 cache.sheet.hydrate(nodesToHydrate);
14052 return cache;
14053};
14054
14055/* harmony default export */ const emotion_cache_browser_esm = (createCache);
14056
14057;// ./node_modules/@emotion/hash/dist/emotion-hash.esm.js
14058/* eslint-disable */
14059// Inspired by https://github.com/garycourt/murmurhash-js
14060// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
14061function murmur2(str) {
14062 // 'm' and 'r' are mixing constants generated offline.
14063 // They're not really 'magic', they just happen to work well.
14064 // const m = 0x5bd1e995;
14065 // const r = 24;
14066 // Initialize the hash
14067 var h = 0; // Mix 4 bytes at a time into the hash
14068
14069 var k,
14070 i = 0,
14071 len = str.length;
14072
14073 for (; len >= 4; ++i, len -= 4) {
14074 k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
14075 k =
14076 /* Math.imul(k, m): */
14077 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
14078 k ^=
14079 /* k >>> r: */
14080 k >>> 24;
14081 h =
14082 /* Math.imul(k, m): */
14083 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
14084 /* Math.imul(h, m): */
14085 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
14086 } // Handle the last few bytes of the input array
14087
14088
14089 switch (len) {
14090 case 3:
14091 h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
14092
14093 case 2:
14094 h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
14095
14096 case 1:
14097 h ^= str.charCodeAt(i) & 0xff;
14098 h =
14099 /* Math.imul(h, m): */
14100 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
14101 } // Do a few final mixes of the hash to ensure the last few
14102 // bytes are well-incorporated.
14103
14104
14105 h ^= h >>> 13;
14106 h =
14107 /* Math.imul(h, m): */
14108 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
14109 return ((h ^ h >>> 15) >>> 0).toString(36);
14110}
14111
14112/* harmony default export */ const emotion_hash_esm = (murmur2);
14113
14114;// ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
14115var unitlessKeys = {
14116 animationIterationCount: 1,
14117 borderImageOutset: 1,
14118 borderImageSlice: 1,
14119 borderImageWidth: 1,
14120 boxFlex: 1,
14121 boxFlexGroup: 1,
14122 boxOrdinalGroup: 1,
14123 columnCount: 1,
14124 columns: 1,
14125 flex: 1,
14126 flexGrow: 1,
14127 flexPositive: 1,
14128 flexShrink: 1,
14129 flexNegative: 1,
14130 flexOrder: 1,
14131 gridRow: 1,
14132 gridRowEnd: 1,
14133 gridRowSpan: 1,
14134 gridRowStart: 1,
14135 gridColumn: 1,
14136 gridColumnEnd: 1,
14137 gridColumnSpan: 1,
14138 gridColumnStart: 1,
14139 msGridRow: 1,
14140 msGridRowSpan: 1,
14141 msGridColumn: 1,
14142 msGridColumnSpan: 1,
14143 fontWeight: 1,
14144 lineHeight: 1,
14145 opacity: 1,
14146 order: 1,
14147 orphans: 1,
14148 tabSize: 1,
14149 widows: 1,
14150 zIndex: 1,
14151 zoom: 1,
14152 WebkitLineClamp: 1,
14153 // SVG-related properties
14154 fillOpacity: 1,
14155 floodOpacity: 1,
14156 stopOpacity: 1,
14157 strokeDasharray: 1,
14158 strokeDashoffset: 1,
14159 strokeMiterlimit: 1,
14160 strokeOpacity: 1,
14161 strokeWidth: 1
14162};
14163
14164/* harmony default export */ const emotion_unitless_esm = (unitlessKeys);
14165
14166;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
14167function memoize(fn) {
14168 var cache = Object.create(null);
14169 return function (arg) {
14170 if (cache[arg] === undefined) cache[arg] = fn(arg);
14171 return cache[arg];
14172 };
14173}
14174
14175
14176
14177;// ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
14178
14179
14180
14181
14182var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
14183var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
14184var hyphenateRegex = /[A-Z]|^ms/g;
14185var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
14186
14187var isCustomProperty = function isCustomProperty(property) {
14188 return property.charCodeAt(1) === 45;
14189};
14190
14191var isProcessableValue = function isProcessableValue(value) {
14192 return value != null && typeof value !== 'boolean';
14193};
14194
14195var processStyleName = /* #__PURE__ */memoize(function (styleName) {
14196 return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
14197});
14198
14199var processStyleValue = function processStyleValue(key, value) {
14200 switch (key) {
14201 case 'animation':
14202 case 'animationName':
14203 {
14204 if (typeof value === 'string') {
14205 return value.replace(animationRegex, function (match, p1, p2) {
14206 cursor = {
14207 name: p1,
14208 styles: p2,
14209 next: cursor
14210 };
14211 return p1;
14212 });
14213 }
14214 }
14215 }
14216
14217 if (emotion_unitless_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
14218 return value + 'px';
14219 }
14220
14221 return value;
14222};
14223
14224if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
14225
14226var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'));
14227
14228function handleInterpolation(mergedProps, registered, interpolation) {
14229 if (interpolation == null) {
14230 return '';
14231 }
14232
14233 if (interpolation.__emotion_styles !== undefined) {
14234 if (false) {}
14235
14236 return interpolation;
14237 }
14238
14239 switch (typeof interpolation) {
14240 case 'boolean':
14241 {
14242 return '';
14243 }
14244
14245 case 'object':
14246 {
14247 if (interpolation.anim === 1) {
14248 cursor = {
14249 name: interpolation.name,
14250 styles: interpolation.styles,
14251 next: cursor
14252 };
14253 return interpolation.name;
14254 }
14255
14256 if (interpolation.styles !== undefined) {
14257 var next = interpolation.next;
14258
14259 if (next !== undefined) {
14260 // not the most efficient thing ever but this is a pretty rare case
14261 // and there will be very few iterations of this generally
14262 while (next !== undefined) {
14263 cursor = {
14264 name: next.name,
14265 styles: next.styles,
14266 next: cursor
14267 };
14268 next = next.next;
14269 }
14270 }
14271
14272 var styles = interpolation.styles + ";";
14273
14274 if (false) {}
14275
14276 return styles;
14277 }
14278
14279 return createStringFromObject(mergedProps, registered, interpolation);
14280 }
14281
14282 case 'function':
14283 {
14284 if (mergedProps !== undefined) {
14285 var previousCursor = cursor;
14286 var result = interpolation(mergedProps);
14287 cursor = previousCursor;
14288 return handleInterpolation(mergedProps, registered, result);
14289 } else if (false) {}
14290
14291 break;
14292 }
14293
14294 case 'string':
14295 if (false) { var replaced, matched; }
14296
14297 break;
14298 } // finalize string values (regular strings and functions interpolated into css calls)
14299
14300
14301 if (registered == null) {
14302 return interpolation;
14303 }
14304
14305 var cached = registered[interpolation];
14306 return cached !== undefined ? cached : interpolation;
14307}
14308
14309function createStringFromObject(mergedProps, registered, obj) {
14310 var string = '';
14311
14312 if (Array.isArray(obj)) {
14313 for (var i = 0; i < obj.length; i++) {
14314 string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
14315 }
14316 } else {
14317 for (var _key in obj) {
14318 var value = obj[_key];
14319
14320 if (typeof value !== 'object') {
14321 if (registered != null && registered[value] !== undefined) {
14322 string += _key + "{" + registered[value] + "}";
14323 } else if (isProcessableValue(value)) {
14324 string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
14325 }
14326 } else {
14327 if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {}
14328
14329 if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
14330 for (var _i = 0; _i < value.length; _i++) {
14331 if (isProcessableValue(value[_i])) {
14332 string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
14333 }
14334 }
14335 } else {
14336 var interpolated = handleInterpolation(mergedProps, registered, value);
14337
14338 switch (_key) {
14339 case 'animation':
14340 case 'animationName':
14341 {
14342 string += processStyleName(_key) + ":" + interpolated + ";";
14343 break;
14344 }
14345
14346 default:
14347 {
14348 if (false) {}
14349
14350 string += _key + "{" + interpolated + "}";
14351 }
14352 }
14353 }
14354 }
14355 }
14356 }
14357
14358 return string;
14359}
14360
14361var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
14362var sourceMapPattern;
14363
14364if (false) {} // this is the cursor for keyframes
14365// keyframes are stored on the SerializedStyles object as a linked list
14366
14367
14368var cursor;
14369var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
14370 if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
14371 return args[0];
14372 }
14373
14374 var stringMode = true;
14375 var styles = '';
14376 cursor = undefined;
14377 var strings = args[0];
14378
14379 if (strings == null || strings.raw === undefined) {
14380 stringMode = false;
14381 styles += handleInterpolation(mergedProps, registered, strings);
14382 } else {
14383 if (false) {}
14384
14385 styles += strings[0];
14386 } // we start at 1 since we've already handled the first arg
14387
14388
14389 for (var i = 1; i < args.length; i++) {
14390 styles += handleInterpolation(mergedProps, registered, args[i]);
14391
14392 if (stringMode) {
14393 if (false) {}
14394
14395 styles += strings[i];
14396 }
14397 }
14398
14399 var sourceMap;
14400
14401 if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
14402
14403
14404 labelPattern.lastIndex = 0;
14405 var identifierName = '';
14406 var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
14407
14408 while ((match = labelPattern.exec(styles)) !== null) {
14409 identifierName += '-' + // $FlowFixMe we know it's not null
14410 match[1];
14411 }
14412
14413 var name = emotion_hash_esm(styles) + identifierName;
14414
14415 if (false) {}
14416
14417 return {
14418 name: name,
14419 styles: styles,
14420 next: cursor
14421 };
14422};
14423
14424
14425
14426;// ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
14427
14428
14429
14430var syncFallback = function syncFallback(create) {
14431 return create();
14432};
14433
14434var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false;
14435var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
14436var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectWithLayoutFallback = (/* unused pure expression or super */ null && (useInsertionEffect || useLayoutEffect));
14437
14438
14439
14440;// ./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450var emotion_element_6a883da9_browser_esm_hasOwnProperty = {}.hasOwnProperty;
14451
14452var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case
14453// because this module is primarily intended for the browser and node
14454// but it's also required in react native and similar environments sometimes
14455// and we could have a special build just for that
14456// but this is much easier and the native packages
14457// might use a different theme context in the future anyway
14458typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({
14459 key: 'css'
14460}) : null);
14461
14462if (false) {}
14463
14464var CacheProvider = EmotionCacheContext.Provider;
14465var __unsafe_useEmotionCache = function useEmotionCache() {
14466 return (0,external_React_.useContext)(EmotionCacheContext);
14467};
14468
14469var emotion_element_6a883da9_browser_esm_withEmotionCache = function withEmotionCache(func) {
14470 // $FlowFixMe
14471 return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) {
14472 // the cache will never be null in the browser
14473 var cache = (0,external_React_.useContext)(EmotionCacheContext);
14474 return func(props, cache, ref);
14475 });
14476};
14477
14478var emotion_element_6a883da9_browser_esm_ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({});
14479
14480if (false) {}
14481
14482var useTheme = function useTheme() {
14483 return useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
14484};
14485
14486var getTheme = function getTheme(outerTheme, theme) {
14487 if (typeof theme === 'function') {
14488 var mergedTheme = theme(outerTheme);
14489
14490 if (false) {}
14491
14492 return mergedTheme;
14493 }
14494
14495 if (false) {}
14496
14497 return _extends({}, outerTheme, theme);
14498};
14499
14500var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) {
14501 return weakMemoize(function (theme) {
14502 return getTheme(outerTheme, theme);
14503 });
14504})));
14505var ThemeProvider = function ThemeProvider(props) {
14506 var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
14507
14508 if (props.theme !== theme) {
14509 theme = createCacheWithTheme(theme)(props.theme);
14510 }
14511
14512 return /*#__PURE__*/createElement(emotion_element_6a883da9_browser_esm_ThemeContext.Provider, {
14513 value: theme
14514 }, props.children);
14515};
14516function withTheme(Component) {
14517 var componentName = Component.displayName || Component.name || 'Component';
14518
14519 var render = function render(props, ref) {
14520 var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext);
14521 return /*#__PURE__*/createElement(Component, _extends({
14522 theme: theme,
14523 ref: ref
14524 }, props));
14525 }; // $FlowFixMe
14526
14527
14528 var WithTheme = /*#__PURE__*/forwardRef(render);
14529 WithTheme.displayName = "WithTheme(" + componentName + ")";
14530 return hoistNonReactStatics(WithTheme, Component);
14531}
14532
14533var getLastPart = function getLastPart(functionName) {
14534 // The match may be something like 'Object.createEmotionProps' or
14535 // 'Loader.prototype.render'
14536 var parts = functionName.split('.');
14537 return parts[parts.length - 1];
14538};
14539
14540var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
14541 // V8
14542 var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
14543 if (match) return getLastPart(match[1]); // Safari / Firefox
14544
14545 match = /^([A-Za-z0-9$.]+)@/.exec(line);
14546 if (match) return getLastPart(match[1]);
14547 return undefined;
14548};
14549
14550var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
14551// identifiers, thus we only need to replace what is a valid character for JS,
14552// but not for CSS.
14553
14554var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
14555 return identifier.replace(/\$/g, '-');
14556};
14557
14558var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
14559 if (!stackTrace) return undefined;
14560 var lines = stackTrace.split('\n');
14561
14562 for (var i = 0; i < lines.length; i++) {
14563 var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
14564
14565 if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
14566
14567 if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
14568 // uppercase letter
14569
14570 if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
14571 }
14572
14573 return undefined;
14574};
14575
14576var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
14577var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
14578var emotion_element_6a883da9_browser_esm_createEmotionProps = function createEmotionProps(type, props) {
14579 if (false) {}
14580
14581 var newProps = {};
14582
14583 for (var key in props) {
14584 if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key)) {
14585 newProps[key] = props[key];
14586 }
14587 }
14588
14589 newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
14590 // the label hasn't already been computed
14591
14592 if (false) { var label; }
14593
14594 return newProps;
14595};
14596
14597var Insertion = function Insertion(_ref) {
14598 var cache = _ref.cache,
14599 serialized = _ref.serialized,
14600 isStringTag = _ref.isStringTag;
14601 registerStyles(cache, serialized, isStringTag);
14602 var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
14603 return insertStyles(cache, serialized, isStringTag);
14604 });
14605
14606 return null;
14607};
14608
14609var emotion_element_6a883da9_browser_esm_Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) {
14610 var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
14611 // not passing the registered cache to serializeStyles because it would
14612 // make certain babel optimisations not possible
14613
14614 if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
14615 cssProp = cache.registered[cssProp];
14616 }
14617
14618 var WrappedComponent = props[typePropName];
14619 var registeredStyles = [cssProp];
14620 var className = '';
14621
14622 if (typeof props.className === 'string') {
14623 className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
14624 } else if (props.className != null) {
14625 className = props.className + " ";
14626 }
14627
14628 var serialized = serializeStyles(registeredStyles, undefined, useContext(emotion_element_6a883da9_browser_esm_ThemeContext));
14629
14630 if (false) { var labelFromStack; }
14631
14632 className += cache.key + "-" + serialized.name;
14633 var newProps = {};
14634
14635 for (var key in props) {
14636 if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) {
14637 newProps[key] = props[key];
14638 }
14639 }
14640
14641 newProps.ref = ref;
14642 newProps.className = className;
14643 return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {
14644 cache: cache,
14645 serialized: serialized,
14646 isStringTag: typeof WrappedComponent === 'string'
14647 }), /*#__PURE__*/createElement(WrappedComponent, newProps));
14648})));
14649
14650if (false) {}
14651
14652
14653
14654;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
14655var isBrowser = "object" !== 'undefined';
14656function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) {
14657 var rawClassName = '';
14658 classNames.split(' ').forEach(function (className) {
14659 if (registered[className] !== undefined) {
14660 registeredStyles.push(registered[className] + ";");
14661 } else {
14662 rawClassName += className + " ";
14663 }
14664 });
14665 return rawClassName;
14666}
14667var emotion_utils_browser_esm_registerStyles = function registerStyles(cache, serialized, isStringTag) {
14668 var className = cache.key + "-" + serialized.name;
14669
14670 if ( // we only need to add the styles to the registered cache if the
14671 // class name could be used further down
14672 // the tree but if it's a string tag, we know it won't
14673 // so we don't have to add it to registered cache.
14674 // this improves memory usage since we can avoid storing the whole style string
14675 (isStringTag === false || // we need to always store it if we're in compat mode and
14676 // in node since emotion-server relies on whether a style is in
14677 // the registered cache to know whether a style is global or not
14678 // also, note that this check will be dead code eliminated in the browser
14679 isBrowser === false ) && cache.registered[className] === undefined) {
14680 cache.registered[className] = serialized.styles;
14681 }
14682};
14683var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) {
14684 emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
14685 var className = cache.key + "-" + serialized.name;
14686
14687 if (cache.inserted[serialized.name] === undefined) {
14688 var current = serialized;
14689
14690 do {
14691 var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
14692
14693 current = current.next;
14694 } while (current !== undefined);
14695 }
14696};
14697
14698
14699
14700;// ./node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
14701
14702
14703
14704
14705function insertWithoutScoping(cache, serialized) {
14706 if (cache.inserted[serialized.name] === undefined) {
14707 return cache.insert('', serialized, cache.sheet, true);
14708 }
14709}
14710
14711function merge(registered, css, className) {
14712 var registeredStyles = [];
14713 var rawClassName = emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, className);
14714
14715 if (registeredStyles.length < 2) {
14716 return className;
14717 }
14718
14719 return rawClassName + css(registeredStyles);
14720}
14721
14722var createEmotion = function createEmotion(options) {
14723 var cache = emotion_cache_browser_esm(options); // $FlowFixMe
14724
14725 cache.sheet.speedy = function (value) {
14726 if (false) {}
14727
14728 this.isSpeedy = value;
14729 };
14730
14731 cache.compat = true;
14732
14733 var css = function css() {
14734 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14735 args[_key] = arguments[_key];
14736 }
14737
14738 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered, undefined);
14739 emotion_utils_browser_esm_insertStyles(cache, serialized, false);
14740 return cache.key + "-" + serialized.name;
14741 };
14742
14743 var keyframes = function keyframes() {
14744 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
14745 args[_key2] = arguments[_key2];
14746 }
14747
14748 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered);
14749 var animation = "animation-" + serialized.name;
14750 insertWithoutScoping(cache, {
14751 name: serialized.name,
14752 styles: "@keyframes " + animation + "{" + serialized.styles + "}"
14753 });
14754 return animation;
14755 };
14756
14757 var injectGlobal = function injectGlobal() {
14758 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
14759 args[_key3] = arguments[_key3];
14760 }
14761
14762 var serialized = emotion_serialize_browser_esm_serializeStyles(args, cache.registered);
14763 insertWithoutScoping(cache, serialized);
14764 };
14765
14766 var cx = function cx() {
14767 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
14768 args[_key4] = arguments[_key4];
14769 }
14770
14771 return merge(cache.registered, css, classnames(args));
14772 };
14773
14774 return {
14775 css: css,
14776 cx: cx,
14777 injectGlobal: injectGlobal,
14778 keyframes: keyframes,
14779 hydrate: function hydrate(ids) {
14780 ids.forEach(function (key) {
14781 cache.inserted[key] = true;
14782 });
14783 },
14784 flush: function flush() {
14785 cache.registered = {};
14786 cache.inserted = {};
14787 cache.sheet.flush();
14788 },
14789 // $FlowFixMe
14790 sheet: cache.sheet,
14791 cache: cache,
14792 getRegisteredStyles: emotion_utils_browser_esm_getRegisteredStyles.bind(null, cache.registered),
14793 merge: merge.bind(null, cache.registered, css)
14794 };
14795};
14796
14797var classnames = function classnames(args) {
14798 var cls = '';
14799
14800 for (var i = 0; i < args.length; i++) {
14801 var arg = args[i];
14802 if (arg == null) continue;
14803 var toAdd = void 0;
14804
14805 switch (typeof arg) {
14806 case 'boolean':
14807 break;
14808
14809 case 'object':
14810 {
14811 if (Array.isArray(arg)) {
14812 toAdd = classnames(arg);
14813 } else {
14814 toAdd = '';
14815
14816 for (var k in arg) {
14817 if (arg[k] && k) {
14818 toAdd && (toAdd += ' ');
14819 toAdd += k;
14820 }
14821 }
14822 }
14823
14824 break;
14825 }
14826
14827 default:
14828 {
14829 toAdd = arg;
14830 }
14831 }
14832
14833 if (toAdd) {
14834 cls && (cls += ' ');
14835 cls += toAdd;
14836 }
14837 }
14838
14839 return cls;
14840};
14841
14842/* harmony default export */ const emotion_css_create_instance_esm = (createEmotion);
14843
14844;// ./node_modules/@emotion/css/dist/emotion-css.esm.js
14845
14846
14847
14848
14849
14850var _createEmotion = emotion_css_create_instance_esm({
14851 key: 'css'
14852}),
14853 flush = _createEmotion.flush,
14854 hydrate = _createEmotion.hydrate,
14855 emotion_css_esm_cx = _createEmotion.cx,
14856 emotion_css_esm_merge = _createEmotion.merge,
14857 emotion_css_esm_getRegisteredStyles = _createEmotion.getRegisteredStyles,
14858 injectGlobal = _createEmotion.injectGlobal,
14859 keyframes = _createEmotion.keyframes,
14860 emotion_css_esm_css = _createEmotion.css,
14861 sheet = _createEmotion.sheet,
14862 cache = _createEmotion.cache;
14863
14864
14865
14866;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js
14867
14868
14869
14870
14871const isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
14872const useCx = () => {
14873 const cache = __unsafe_useEmotionCache();
14874 const cx = (0,external_wp_element_namespaceObject.useCallback)((...classNames) => {
14875 if (cache === null) {
14876 throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");
14877 }
14878 return emotion_css_esm_cx(...classNames.map((arg) => {
14879 if (isSerializedStyles(arg)) {
14880 emotion_utils_browser_esm_insertStyles(cache, arg, false);
14881 return `${cache.key}-${arg.name}`;
14882 }
14883 return arg;
14884 }));
14885 }, [cache]);
14886 return cx;
14887};
14888
14889
14890;// ./node_modules/@wordpress/components/build-module/context/use-context-system.js
14891
14892
14893
14894
14895
14896function useContextSystem(props, namespace) {
14897 const contextSystemProps = useComponentsContext();
14898 if (typeof namespace === "undefined") {
14899 true ? external_wp_warning_default()("useContextSystem: Please provide a namespace") : 0;
14900 }
14901 const contextProps = contextSystemProps?.[namespace] || {};
14902 const finalComponentProps = {
14903 ...getConnectedNamespace(),
14904 ...getNamespace(namespace)
14905 };
14906 const {
14907 _overrides: overrideProps,
14908 ...otherContextProps
14909 } = contextProps;
14910 const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
14911 const cx = useCx();
14912 const classes = cx(getStyledClassNameFromKey(namespace), props.className);
14913 const rendered = typeof initialMergedProps.renderChildren === "function" ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children;
14914 for (const key in initialMergedProps) {
14915 finalComponentProps[key] = initialMergedProps[key];
14916 }
14917 for (const key in overrideProps) {
14918 finalComponentProps[key] = overrideProps[key];
14919 }
14920 if (rendered !== void 0) {
14921 finalComponentProps.children = rendered;
14922 }
14923 finalComponentProps.className = classes;
14924 return finalComponentProps;
14925}
14926
14927
14928;// ./node_modules/@wordpress/components/build-module/context/context-connect.js
14929
14930
14931
14932
14933function contextConnect(Component, namespace) {
14934 return _contextConnect(Component, namespace, {
14935 forwardsRef: true
14936 });
14937}
14938function contextConnectWithoutRef(Component, namespace) {
14939 return _contextConnect(Component, namespace);
14940}
14941function _contextConnect(Component, namespace, options) {
14942 const WrappedComponent = options?.forwardsRef ? (0,external_wp_element_namespaceObject.forwardRef)(Component) : Component;
14943 if (typeof namespace === "undefined") {
14944 true ? external_wp_warning_default()("contextConnect: Please provide a namespace") : 0;
14945 }
14946 let mergedNamespace = WrappedComponent[CONNECT_STATIC_NAMESPACE] || [namespace];
14947 if (Array.isArray(namespace)) {
14948 mergedNamespace = [...mergedNamespace, ...namespace];
14949 }
14950 if (typeof namespace === "string") {
14951 mergedNamespace = [...mergedNamespace, namespace];
14952 }
14953 return Object.assign(WrappedComponent, {
14954 [CONNECT_STATIC_NAMESPACE]: [...new Set(mergedNamespace)],
14955 displayName: namespace,
14956 selector: `.${getStyledClassNameFromKey(namespace)}`
14957 });
14958}
14959function getConnectNamespace(Component) {
14960 if (!Component) {
14961 return [];
14962 }
14963 let namespaces = [];
14964 if (Component[CONNECT_STATIC_NAMESPACE]) {
14965 namespaces = Component[CONNECT_STATIC_NAMESPACE];
14966 }
14967 if (Component.type && Component.type[CONNECT_STATIC_NAMESPACE]) {
14968 namespaces = Component.type[CONNECT_STATIC_NAMESPACE];
14969 }
14970 return namespaces;
14971}
14972function hasConnectNamespace(Component, match) {
14973 if (!Component) {
14974 return false;
14975 }
14976 if (typeof match === "string") {
14977 return getConnectNamespace(Component).includes(match);
14978 }
14979 if (Array.isArray(match)) {
14980 return match.some((result) => getConnectNamespace(Component).includes(result));
14981 }
14982 return false;
14983}
14984
14985
14986;// ./node_modules/@wordpress/components/build-module/visually-hidden/styles.js
14987const visuallyHidden = {
14988 border: 0,
14989 clip: "rect(1px, 1px, 1px, 1px)",
14990 WebkitClipPath: "inset( 50% )",
14991 clipPath: "inset( 50% )",
14992 height: "1px",
14993 margin: "-1px",
14994 overflow: "hidden",
14995 padding: 0,
14996 position: "absolute",
14997 width: "1px",
14998 wordWrap: "normal"
14999};
15000
15001
15002;// ./node_modules/@babel/runtime/helpers/esm/extends.js
15003function extends_extends() {
15004 return extends_extends = Object.assign ? Object.assign.bind() : function (n) {
15005 for (var e = 1; e < arguments.length; e++) {
15006 var t = arguments[e];
15007 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
15008 }
15009 return n;
15010 }, extends_extends.apply(null, arguments);
15011}
15012
15013;// ./node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
15014
15015
15016var 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|download|draggable|encType|enterKeyHint|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|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)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
15017
15018var isPropValid = /* #__PURE__ */memoize(function (prop) {
15019 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
15020 /* o */
15021 && prop.charCodeAt(1) === 110
15022 /* n */
15023 && prop.charCodeAt(2) < 91;
15024}
15025/* Z+1 */
15026);
15027
15028
15029
15030;// ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
15031
15032
15033
15034
15035
15036
15037
15038
15039var testOmitPropsOnStringTag = isPropValid;
15040
15041var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
15042 return key !== 'theme';
15043};
15044
15045var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
15046 return typeof tag === 'string' && // 96 is one less than the char code
15047 // for "a" so this is checking that
15048 // it's a lowercase character
15049 tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
15050};
15051var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
15052 var shouldForwardProp;
15053
15054 if (options) {
15055 var optionsShouldForwardProp = options.shouldForwardProp;
15056 shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
15057 return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
15058 } : optionsShouldForwardProp;
15059 }
15060
15061 if (typeof shouldForwardProp !== 'function' && isReal) {
15062 shouldForwardProp = tag.__emotion_forwardProp;
15063 }
15064
15065 return shouldForwardProp;
15066};
15067
15068var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
15069
15070var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) {
15071 var cache = _ref.cache,
15072 serialized = _ref.serialized,
15073 isStringTag = _ref.isStringTag;
15074 emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag);
15075 var rules = emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () {
15076 return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag);
15077 });
15078
15079 return null;
15080};
15081
15082var createStyled = function createStyled(tag, options) {
15083 if (false) {}
15084
15085 var isReal = tag.__emotion_real === tag;
15086 var baseTag = isReal && tag.__emotion_base || tag;
15087 var identifierName;
15088 var targetClassName;
15089
15090 if (options !== undefined) {
15091 identifierName = options.label;
15092 targetClassName = options.target;
15093 }
15094
15095 var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
15096 var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
15097 var shouldUseAs = !defaultShouldForwardProp('as');
15098 return function () {
15099 var args = arguments;
15100 var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
15101
15102 if (identifierName !== undefined) {
15103 styles.push("label:" + identifierName + ";");
15104 }
15105
15106 if (args[0] == null || args[0].raw === undefined) {
15107 styles.push.apply(styles, args);
15108 } else {
15109 if (false) {}
15110
15111 styles.push(args[0][0]);
15112 var len = args.length;
15113 var i = 1;
15114
15115 for (; i < len; i++) {
15116 if (false) {}
15117
15118 styles.push(args[i], args[0][i]);
15119 }
15120 } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
15121
15122
15123 var Styled = emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) {
15124 var FinalTag = shouldUseAs && props.as || baseTag;
15125 var className = '';
15126 var classInterpolations = [];
15127 var mergedProps = props;
15128
15129 if (props.theme == null) {
15130 mergedProps = {};
15131
15132 for (var key in props) {
15133 mergedProps[key] = props[key];
15134 }
15135
15136 mergedProps.theme = (0,external_React_.useContext)(emotion_element_6a883da9_browser_esm_ThemeContext);
15137 }
15138
15139 if (typeof props.className === 'string') {
15140 className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className);
15141 } else if (props.className != null) {
15142 className = props.className + " ";
15143 }
15144
15145 var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
15146 className += cache.key + "-" + serialized.name;
15147
15148 if (targetClassName !== undefined) {
15149 className += " " + targetClassName;
15150 }
15151
15152 var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
15153 var newProps = {};
15154
15155 for (var _key in props) {
15156 if (shouldUseAs && _key === 'as') continue;
15157
15158 if ( // $FlowFixMe
15159 finalShouldForwardProp(_key)) {
15160 newProps[_key] = props[_key];
15161 }
15162 }
15163
15164 newProps.className = className;
15165 newProps.ref = ref;
15166 return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, {
15167 cache: cache,
15168 serialized: serialized,
15169 isStringTag: typeof FinalTag === 'string'
15170 }), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps));
15171 });
15172 Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
15173 Styled.defaultProps = tag.defaultProps;
15174 Styled.__emotion_real = Styled;
15175 Styled.__emotion_base = baseTag;
15176 Styled.__emotion_styles = styles;
15177 Styled.__emotion_forwardProp = shouldForwardProp;
15178 Object.defineProperty(Styled, 'toString', {
15179 value: function value() {
15180 if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string
15181
15182
15183 return "." + targetClassName;
15184 }
15185 });
15186
15187 Styled.withComponent = function (nextTag, nextOptions) {
15188 return createStyled(nextTag, extends_extends({}, options, nextOptions, {
15189 shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
15190 })).apply(void 0, styles);
15191 };
15192
15193 return Styled;
15194 };
15195};
15196
15197/* harmony default export */ const emotion_styled_base_browser_esm = (createStyled);
15198
15199;// ./node_modules/@wordpress/components/build-module/view/component.js
15200
15201
15202
15203const PolymorphicDiv = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
15204 target: "e19lxcc00"
15205} : 0)( true ? "" : 0);
15206function UnforwardedView({
15207 as,
15208 ...restProps
15209}, ref) {
15210 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PolymorphicDiv, {
15211 as,
15212 ref,
15213 ...restProps
15214 });
15215}
15216const View = Object.assign((0,external_wp_element_namespaceObject.forwardRef)(UnforwardedView), {
15217 selector: ".components-view"
15218});
15219var component_default = View;
15220
15221
15222;// ./node_modules/@wordpress/components/build-module/visually-hidden/component.js
15223
15224
15225
15226
15227function UnconnectedVisuallyHidden(props, forwardedRef) {
15228 const {
15229 style: styleProp,
15230 ...contextProps
15231 } = useContextSystem(props, "VisuallyHidden");
15232 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
15233 ref: forwardedRef,
15234 ...contextProps,
15235 style: {
15236 ...visuallyHidden,
15237 ...styleProp || {}
15238 }
15239 });
15240}
15241const component_VisuallyHidden = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
15242var component_component_default = component_VisuallyHidden;
15243
15244
15245;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js
15246
15247const GRID = [["top left", "top center", "top right"], ["center left", "center center", "center right"], ["bottom left", "bottom center", "bottom right"]];
15248const ALIGNMENT_LABEL = {
15249 "top left": (0,external_wp_i18n_namespaceObject.__)("Top Left"),
15250 "top center": (0,external_wp_i18n_namespaceObject.__)("Top Center"),
15251 "top right": (0,external_wp_i18n_namespaceObject.__)("Top Right"),
15252 "center left": (0,external_wp_i18n_namespaceObject.__)("Center Left"),
15253 "center center": (0,external_wp_i18n_namespaceObject.__)("Center"),
15254 center: (0,external_wp_i18n_namespaceObject.__)("Center"),
15255 "center right": (0,external_wp_i18n_namespaceObject.__)("Center Right"),
15256 "bottom left": (0,external_wp_i18n_namespaceObject.__)("Bottom Left"),
15257 "bottom center": (0,external_wp_i18n_namespaceObject.__)("Bottom Center"),
15258 "bottom right": (0,external_wp_i18n_namespaceObject.__)("Bottom Right")
15259};
15260const ALIGNMENTS = GRID.flat();
15261function normalize(value) {
15262 const normalized = value === "center" ? "center center" : value;
15263 const transformed = normalized?.replace("-", " ");
15264 return ALIGNMENTS.includes(transformed) ? transformed : void 0;
15265}
15266function getItemId(prefixId, value) {
15267 const normalized = normalize(value);
15268 if (!normalized) {
15269 return;
15270 }
15271 const id = normalized.replace(" ", "-");
15272 return `${prefixId}-${id}`;
15273}
15274function getItemValue(prefixId, id) {
15275 const value = id?.replace(prefixId + "-", "");
15276 return normalize(value);
15277}
15278function getAlignmentIndex(alignment = "center") {
15279 const normalized = normalize(alignment);
15280 if (!normalized) {
15281 return void 0;
15282 }
15283 const index = ALIGNMENTS.indexOf(normalized);
15284 return index > -1 ? index : void 0;
15285}
15286
15287
15288// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
15289var hoist_non_react_statics_cjs = __webpack_require__(1880);
15290;// ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303var pkg = {
15304 name: "@emotion/react",
15305 version: "11.10.6",
15306 main: "dist/emotion-react.cjs.js",
15307 module: "dist/emotion-react.esm.js",
15308 browser: {
15309 "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
15310 },
15311 exports: {
15312 ".": {
15313 module: {
15314 worker: "./dist/emotion-react.worker.esm.js",
15315 browser: "./dist/emotion-react.browser.esm.js",
15316 "default": "./dist/emotion-react.esm.js"
15317 },
15318 "default": "./dist/emotion-react.cjs.js"
15319 },
15320 "./jsx-runtime": {
15321 module: {
15322 worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
15323 browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
15324 "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
15325 },
15326 "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
15327 },
15328 "./_isolated-hnrs": {
15329 module: {
15330 worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
15331 browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
15332 "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
15333 },
15334 "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
15335 },
15336 "./jsx-dev-runtime": {
15337 module: {
15338 worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
15339 browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
15340 "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
15341 },
15342 "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
15343 },
15344 "./package.json": "./package.json",
15345 "./types/css-prop": "./types/css-prop.d.ts",
15346 "./macro": "./macro.js"
15347 },
15348 types: "types/index.d.ts",
15349 files: [
15350 "src",
15351 "dist",
15352 "jsx-runtime",
15353 "jsx-dev-runtime",
15354 "_isolated-hnrs",
15355 "types/*.d.ts",
15356 "macro.js",
15357 "macro.d.ts",
15358 "macro.js.flow"
15359 ],
15360 sideEffects: false,
15361 author: "Emotion Contributors",
15362 license: "MIT",
15363 scripts: {
15364 "test:typescript": "dtslint types"
15365 },
15366 dependencies: {
15367 "@babel/runtime": "^7.18.3",
15368 "@emotion/babel-plugin": "^11.10.6",
15369 "@emotion/cache": "^11.10.5",
15370 "@emotion/serialize": "^1.1.1",
15371 "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0",
15372 "@emotion/utils": "^1.2.0",
15373 "@emotion/weak-memoize": "^0.3.0",
15374 "hoist-non-react-statics": "^3.3.1"
15375 },
15376 peerDependencies: {
15377 react: ">=16.8.0"
15378 },
15379 peerDependenciesMeta: {
15380 "@types/react": {
15381 optional: true
15382 }
15383 },
15384 devDependencies: {
15385 "@definitelytyped/dtslint": "0.0.112",
15386 "@emotion/css": "11.10.6",
15387 "@emotion/css-prettifier": "1.1.1",
15388 "@emotion/server": "11.10.0",
15389 "@emotion/styled": "11.10.6",
15390 "html-tag-names": "^1.1.2",
15391 react: "16.14.0",
15392 "svg-tag-names": "^1.1.1",
15393 typescript: "^4.5.5"
15394 },
15395 repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
15396 publishConfig: {
15397 access: "public"
15398 },
15399 "umd:main": "dist/emotion-react.umd.min.js",
15400 preconstruct: {
15401 entrypoints: [
15402 "./index.js",
15403 "./jsx-runtime.js",
15404 "./jsx-dev-runtime.js",
15405 "./_isolated-hnrs.js"
15406 ],
15407 umdName: "emotionReact",
15408 exports: {
15409 envConditions: [
15410 "browser",
15411 "worker"
15412 ],
15413 extra: {
15414 "./types/css-prop": "./types/css-prop.d.ts",
15415 "./macro": "./macro.js"
15416 }
15417 }
15418 }
15419};
15420
15421var jsx = function jsx(type, props) {
15422 var args = arguments;
15423
15424 if (props == null || !hasOwnProperty.call(props, 'css')) {
15425 // $FlowFixMe
15426 return createElement.apply(undefined, args);
15427 }
15428
15429 var argsLength = args.length;
15430 var createElementArgArray = new Array(argsLength);
15431 createElementArgArray[0] = Emotion;
15432 createElementArgArray[1] = createEmotionProps(type, props);
15433
15434 for (var i = 2; i < argsLength; i++) {
15435 createElementArgArray[i] = args[i];
15436 } // $FlowFixMe
15437
15438
15439 return createElement.apply(null, createElementArgArray);
15440};
15441
15442var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
15443// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
15444// initial client-side render from SSR, use place of hydrating tag
15445
15446var Global = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) {
15447 if (false) {}
15448
15449 var styles = props.styles;
15450 var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));
15451 // but it is based on a constant that will never change at runtime
15452 // it's effectively like having two implementations and switching them out
15453 // so it's not actually breaking anything
15454
15455
15456 var sheetRef = useRef();
15457 useInsertionEffectWithLayoutFallback(function () {
15458 var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
15459
15460 var sheet = new cache.sheet.constructor({
15461 key: key,
15462 nonce: cache.sheet.nonce,
15463 container: cache.sheet.container,
15464 speedy: cache.sheet.isSpeedy
15465 });
15466 var rehydrating = false; // $FlowFixMe
15467
15468 var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
15469
15470 if (cache.sheet.tags.length) {
15471 sheet.before = cache.sheet.tags[0];
15472 }
15473
15474 if (node !== null) {
15475 rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
15476
15477 node.setAttribute('data-emotion', key);
15478 sheet.hydrate([node]);
15479 }
15480
15481 sheetRef.current = [sheet, rehydrating];
15482 return function () {
15483 sheet.flush();
15484 };
15485 }, [cache]);
15486 useInsertionEffectWithLayoutFallback(function () {
15487 var sheetRefCurrent = sheetRef.current;
15488 var sheet = sheetRefCurrent[0],
15489 rehydrating = sheetRefCurrent[1];
15490
15491 if (rehydrating) {
15492 sheetRefCurrent[1] = false;
15493 return;
15494 }
15495
15496 if (serialized.next !== undefined) {
15497 // insert keyframes
15498 insertStyles(cache, serialized.next, true);
15499 }
15500
15501 if (sheet.tags.length) {
15502 // if this doesn't exist then it will be null so the style element will be appended
15503 var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
15504 sheet.before = element;
15505 sheet.flush();
15506 }
15507
15508 cache.insert("", serialized, sheet, false);
15509 }, [cache, serialized.name]);
15510 return null;
15511})));
15512
15513if (false) {}
15514
15515function emotion_react_browser_esm_css() {
15516 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15517 args[_key] = arguments[_key];
15518 }
15519
15520 return emotion_serialize_browser_esm_serializeStyles(args);
15521}
15522
15523var emotion_react_browser_esm_keyframes = function keyframes() {
15524 var insertable = emotion_react_browser_esm_css.apply(void 0, arguments);
15525 var name = "animation-" + insertable.name; // $FlowFixMe
15526
15527 return {
15528 name: name,
15529 styles: "@keyframes " + name + "{" + insertable.styles + "}",
15530 anim: 1,
15531 toString: function toString() {
15532 return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
15533 }
15534 };
15535};
15536
15537var emotion_react_browser_esm_classnames = function classnames(args) {
15538 var len = args.length;
15539 var i = 0;
15540 var cls = '';
15541
15542 for (; i < len; i++) {
15543 var arg = args[i];
15544 if (arg == null) continue;
15545 var toAdd = void 0;
15546
15547 switch (typeof arg) {
15548 case 'boolean':
15549 break;
15550
15551 case 'object':
15552 {
15553 if (Array.isArray(arg)) {
15554 toAdd = classnames(arg);
15555 } else {
15556 if (false) {}
15557
15558 toAdd = '';
15559
15560 for (var k in arg) {
15561 if (arg[k] && k) {
15562 toAdd && (toAdd += ' ');
15563 toAdd += k;
15564 }
15565 }
15566 }
15567
15568 break;
15569 }
15570
15571 default:
15572 {
15573 toAdd = arg;
15574 }
15575 }
15576
15577 if (toAdd) {
15578 cls && (cls += ' ');
15579 cls += toAdd;
15580 }
15581 }
15582
15583 return cls;
15584};
15585
15586function emotion_react_browser_esm_merge(registered, css, className) {
15587 var registeredStyles = [];
15588 var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
15589
15590 if (registeredStyles.length < 2) {
15591 return className;
15592 }
15593
15594 return rawClassName + css(registeredStyles);
15595}
15596
15597var emotion_react_browser_esm_Insertion = function Insertion(_ref) {
15598 var cache = _ref.cache,
15599 serializedArr = _ref.serializedArr;
15600 var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
15601
15602 for (var i = 0; i < serializedArr.length; i++) {
15603 var res = insertStyles(cache, serializedArr[i], false);
15604 }
15605 });
15606
15607 return null;
15608};
15609
15610var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) {
15611 var hasRendered = false;
15612 var serializedArr = [];
15613
15614 var css = function css() {
15615 if (hasRendered && "production" !== 'production') {}
15616
15617 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15618 args[_key] = arguments[_key];
15619 }
15620
15621 var serialized = serializeStyles(args, cache.registered);
15622 serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
15623
15624 registerStyles(cache, serialized, false);
15625 return cache.key + "-" + serialized.name;
15626 };
15627
15628 var cx = function cx() {
15629 if (hasRendered && "production" !== 'production') {}
15630
15631 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
15632 args[_key2] = arguments[_key2];
15633 }
15634
15635 return emotion_react_browser_esm_merge(cache.registered, css, emotion_react_browser_esm_classnames(args));
15636 };
15637
15638 var content = {
15639 css: css,
15640 cx: cx,
15641 theme: useContext(ThemeContext)
15642 };
15643 var ele = props.children(content);
15644 hasRendered = true;
15645 return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(emotion_react_browser_esm_Insertion, {
15646 cache: cache,
15647 serializedArr: serializedArr
15648 }), ele);
15649})));
15650
15651if (false) {}
15652
15653if (false) { var globalKey, globalContext, isTestEnv, emotion_react_browser_esm_isBrowser; }
15654
15655
15656
15657;// ./node_modules/@wordpress/components/build-module/utils/space.js
15658const GRID_BASE = "4px";
15659function space(value) {
15660 if (typeof value === "undefined") {
15661 return void 0;
15662 }
15663 if (!value) {
15664 return "0";
15665 }
15666 const asInt = typeof value === "number" ? value : Number(value);
15667 if (typeof window !== "undefined" && window.CSS?.supports?.("margin", value.toString()) || Number.isNaN(asInt)) {
15668 return value.toString();
15669 }
15670 return `calc(${GRID_BASE} * ${value})`;
15671}
15672
15673
15674;// ./node_modules/@wordpress/components/build-module/utils/colors-values.js
15675const white = "#fff";
15676const GRAY = {
15677 900: "#1e1e1e",
15678 800: "#2f2f2f",
15679 /** Meets 4.6:1 text contrast against white. */
15680 700: "#757575",
15681 /** Meets 3:1 UI or large text contrast against white. */
15682 600: "#949494",
15683 400: "#ccc",
15684 /** Used for most borders. */
15685 300: "#ddd",
15686 /** Used sparingly for light borders. */
15687 200: "#e0e0e0",
15688 /** Used for light gray backgrounds. */
15689 100: "#f0f0f0"
15690};
15691const ALERT = {
15692 yellow: "#f0b849",
15693 red: "#d94f4f",
15694 green: "#4ab866"
15695};
15696const THEME = {
15697 accent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,
15698 accentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,
15699 accentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,
15700 /** Used when placing text on the accent color. */
15701 accentInverted: `var(--wp-components-color-accent-inverted, ${white})`,
15702 background: `var(--wp-components-color-background, ${white})`,
15703 foreground: `var(--wp-components-color-foreground, ${GRAY[900]})`,
15704 /** Used when placing text on the foreground color. */
15705 foregroundInverted: `var(--wp-components-color-foreground-inverted, ${white})`,
15706 gray: {
15707 /** @deprecated Use `COLORS.theme.foreground` instead. */
15708 900: `var(--wp-components-color-foreground, ${GRAY[900]})`,
15709 800: `var(--wp-components-color-gray-800, ${GRAY[800]})`,
15710 700: `var(--wp-components-color-gray-700, ${GRAY[700]})`,
15711 600: `var(--wp-components-color-gray-600, ${GRAY[600]})`,
15712 400: `var(--wp-components-color-gray-400, ${GRAY[400]})`,
15713 300: `var(--wp-components-color-gray-300, ${GRAY[300]})`,
15714 200: `var(--wp-components-color-gray-200, ${GRAY[200]})`,
15715 100: `var(--wp-components-color-gray-100, ${GRAY[100]})`
15716 }
15717};
15718const UI = {
15719 background: THEME.background,
15720 backgroundDisabled: THEME.gray[100],
15721 border: THEME.gray[600],
15722 borderHover: THEME.gray[700],
15723 borderFocus: THEME.accent,
15724 borderDisabled: THEME.gray[400],
15725 textDisabled: THEME.gray[600],
15726 // Matches @wordpress/base-styles
15727 darkGrayPlaceholder: `color-mix(in srgb, ${THEME.foreground}, transparent 38%)`,
15728 lightGrayPlaceholder: `color-mix(in srgb, ${THEME.background}, transparent 35%)`
15729};
15730const COLORS = Object.freeze({
15731 /**
15732 * The main gray color object.
15733 *
15734 * @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`.
15735 */
15736 gray: GRAY,
15737 // TODO: Stop exporting this when everything is migrated to `theme` or `ui`
15738 /**
15739 * @deprecated Prefer theme-ready variables in `COLORS.theme`.
15740 */
15741 white,
15742 alert: ALERT,
15743 /**
15744 * Theme-ready variables with fallbacks.
15745 *
15746 * Prefer semantic aliases in `COLORS.ui` when applicable.
15747 */
15748 theme: THEME,
15749 /**
15750 * Semantic aliases (prefer these over raw variables when applicable).
15751 */
15752 ui: UI
15753});
15754var colors_values_default = (/* unused pure expression or super */ null && (COLORS));
15755
15756
15757;// ./node_modules/@wordpress/components/build-module/utils/config-values.js
15758
15759
15760const CONTROL_HEIGHT = "36px";
15761const CONTROL_PROPS = {
15762 // These values should be shared with TextControl.
15763 controlPaddingX: 12,
15764 controlPaddingXSmall: 8,
15765 controlPaddingXLarge: 12 * 1.3334,
15766 // TODO: Deprecate
15767 controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,
15768 controlHeight: CONTROL_HEIGHT,
15769 controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,
15770 controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,
15771 controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,
15772 controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`
15773};
15774var config_values_default = Object.assign({}, CONTROL_PROPS, {
15775 colorDivider: "rgba(0, 0, 0, 0.1)",
15776 colorScrollbarThumb: "rgba(0, 0, 0, 0.2)",
15777 colorScrollbarThumbHover: "rgba(0, 0, 0, 0.5)",
15778 colorScrollbarTrack: "rgba(0, 0, 0, 0.04)",
15779 elevationIntensity: 1,
15780 radiusXSmall: "1px",
15781 radiusSmall: "2px",
15782 radiusMedium: "4px",
15783 radiusLarge: "8px",
15784 radiusFull: "9999px",
15785 radiusRound: "50%",
15786 borderWidth: "1px",
15787 borderWidthFocus: "1.5px",
15788 borderWidthTab: "4px",
15789 spinnerSize: 16,
15790 fontSize: "13px",
15791 fontSizeH1: "calc(2.44 * 13px)",
15792 fontSizeH2: "calc(1.95 * 13px)",
15793 fontSizeH3: "calc(1.56 * 13px)",
15794 fontSizeH4: "calc(1.25 * 13px)",
15795 fontSizeH5: "13px",
15796 fontSizeH6: "calc(0.8 * 13px)",
15797 fontSizeInputMobile: "16px",
15798 fontSizeMobile: "15px",
15799 fontSizeSmall: "calc(0.92 * 13px)",
15800 fontSizeXSmall: "calc(0.75 * 13px)",
15801 fontLineHeightBase: "1.4",
15802 fontWeight: "normal",
15803 fontWeightHeading: "600",
15804 gridBase: "4px",
15805 cardPaddingXSmall: `${space(2)}`,
15806 cardPaddingSmall: `${space(4)}`,
15807 cardPaddingMedium: `${space(4)} ${space(6)}`,
15808 cardPaddingLarge: `${space(6)} ${space(8)}`,
15809 elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,
15810 elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
15811 elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,
15812 elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,
15813 surfaceBackgroundColor: COLORS.white,
15814 surfaceBackgroundSubtleColor: "#F3F3F3",
15815 surfaceBackgroundTintColor: "#F5F5F5",
15816 surfaceBorderColor: "rgba(0, 0, 0, 0.1)",
15817 surfaceBorderBoldColor: "rgba(0, 0, 0, 0.15)",
15818 surfaceBorderSubtleColor: "rgba(0, 0, 0, 0.05)",
15819 surfaceBackgroundTertiaryColor: COLORS.white,
15820 surfaceColor: COLORS.white,
15821 transitionDuration: "200ms",
15822 transitionDurationFast: "160ms",
15823 transitionDurationFaster: "120ms",
15824 transitionDurationFastest: "100ms",
15825 transitionTimingFunction: "cubic-bezier(0.08, 0.52, 0.52, 1)",
15826 transitionTimingFunctionControl: "cubic-bezier(0.12, 0.8, 0.32, 1)"
15827});
15828
15829
15830;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles.js
15831
15832function _EMOTION_STRINGIFIED_CSS_ERROR__() {
15833 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
15834}
15835
15836
15837const rootBase = ({
15838 size = 92
15839}) => /* @__PURE__ */ emotion_react_browser_esm_css("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:", size, "px;aspect-ratio:1;border-radius:", config_values_default.radiusMedium, ";outline:none;" + ( true ? "" : 0), true ? "" : 0);
15840var _ref = true ? {
15841 name: "e0dnmk",
15842 styles: "cursor:pointer"
15843} : 0;
15844const GridContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
15845 target: "e1r95csn3"
15846} : 0)(rootBase, " border:1px solid transparent;", (props) => props.disablePointerEvents ? /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0) : _ref, ";" + ( true ? "" : 0));
15847const GridRow = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
15848 target: "e1r95csn2"
15849} : 0)( true ? {
15850 name: "1fbxn64",
15851 styles: "grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"
15852} : 0);
15853const Cell = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
15854 target: "e1r95csn1"
15855} : 0)( true ? {
15856 name: "e2kws5",
15857 styles: "position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"
15858} : 0);
15859const POINT_SIZE = 6;
15860const Point = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
15861 target: "e1r95csn0"
15862} : 0)("display:block;contain:strict;box-sizing:border-box;width:", POINT_SIZE, "px;aspect-ratio:1;margin:auto;color:", COLORS.theme.gray[400], ";border:", POINT_SIZE / 2, "px solid currentColor;", Cell, "[data-active-item] &{color:", COLORS.gray[900], ";transform:scale( calc( 5 / 3 ) );}", Cell, ":not([data-active-item]):hover &{color:", COLORS.theme.accent, ";}", Cell, "[data-focus-visible] &{outline:1px solid ", COLORS.theme.accent, ";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}" + ( true ? "" : 0));
15863
15864
15865;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js
15866
15867
15868
15869
15870
15871
15872function cell_Cell({
15873 id,
15874 value,
15875 ...props
15876}) {
15877 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
15878 text: ALIGNMENT_LABEL[value],
15879 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(composite_Composite.Item, {
15880 id,
15881 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Cell, {
15882 ...props,
15883 role: "gridcell"
15884 }),
15885 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
15886 children: value
15887 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Point, {
15888 role: "presentation"
15889 })]
15890 })
15891 });
15892}
15893
15894
15895;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js
15896
15897
15898
15899
15900const BASE_SIZE = 24;
15901const GRID_CELL_SIZE = 7;
15902const GRID_PADDING = (BASE_SIZE - 3 * GRID_CELL_SIZE) / 2;
15903const DOT_SIZE = 2;
15904const DOT_SIZE_SELECTED = 4;
15905function AlignmentMatrixControlIcon({
15906 className,
15907 disablePointerEvents = true,
15908 size,
15909 width,
15910 height,
15911 style = {},
15912 value = "center",
15913 ...props
15914}) {
15915 var _ref, _ref2;
15916 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
15917 xmlns: "http://www.w3.org/2000/svg",
15918 viewBox: `0 0 ${BASE_SIZE} ${BASE_SIZE}`,
15919 width: (_ref = size !== null && size !== void 0 ? size : width) !== null && _ref !== void 0 ? _ref : BASE_SIZE,
15920 height: (_ref2 = size !== null && size !== void 0 ? size : height) !== null && _ref2 !== void 0 ? _ref2 : BASE_SIZE,
15921 role: "presentation",
15922 className: dist_clsx("component-alignment-matrix-control-icon", className),
15923 style: {
15924 pointerEvents: disablePointerEvents ? "none" : void 0,
15925 ...style
15926 },
15927 ...props,
15928 children: ALIGNMENTS.map((align, index) => {
15929 const dotSize = getAlignmentIndex(value) === index ? DOT_SIZE_SELECTED : DOT_SIZE;
15930 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, {
15931 x: GRID_PADDING + index % 3 * GRID_CELL_SIZE + (GRID_CELL_SIZE - dotSize) / 2,
15932 y: GRID_PADDING + Math.floor(index / 3) * GRID_CELL_SIZE + (GRID_CELL_SIZE - dotSize) / 2,
15933 width: dotSize,
15934 height: dotSize,
15935 fill: "currentColor"
15936 }, align);
15937 })
15938 });
15939}
15940var icon_default = AlignmentMatrixControlIcon;
15941
15942
15943;// ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954function UnforwardedAlignmentMatrixControl({
15955 className,
15956 id,
15957 label = (0,external_wp_i18n_namespaceObject.__)("Alignment Matrix Control"),
15958 defaultValue = "center center",
15959 value,
15960 onChange,
15961 width = 92,
15962 ...props
15963}) {
15964 const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedAlignmentMatrixControl, "alignment-matrix-control", id);
15965 const setActiveId = (0,external_wp_element_namespaceObject.useCallback)((nextActiveId) => {
15966 const nextValue = getItemValue(baseId, nextActiveId);
15967 if (nextValue) {
15968 onChange?.(nextValue);
15969 }
15970 }, [baseId, onChange]);
15971 const classes = dist_clsx("component-alignment-matrix-control", className);
15972 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite, {
15973 defaultActiveId: getItemId(baseId, defaultValue),
15974 activeId: getItemId(baseId, value),
15975 setActiveId,
15976 rtl: (0,external_wp_i18n_namespaceObject.isRTL)(),
15977 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridContainer, {
15978 ...props,
15979 "aria-label": label,
15980 className: classes,
15981 id: baseId,
15982 role: "grid",
15983 size: width
15984 }),
15985 children: GRID.map((cells, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite.Row, {
15986 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridRow, {
15987 role: "row"
15988 }),
15989 children: cells.map((cell) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(cell_Cell, {
15990 id: getItemId(baseId, cell),
15991 value: cell
15992 }, cell))
15993 }, index))
15994 });
15995}
15996const AlignmentMatrixControl = Object.assign(UnforwardedAlignmentMatrixControl, {
15997 /**
15998 * Render an alignment matrix as an icon.
15999 *
16000 * ```jsx
16001 * import { AlignmentMatrixControl } from '@wordpress/components';
16002 *
16003 * <Icon icon={<AlignmentMatrixControl.Icon value="top left" />} />
16004 * ```
16005 */
16006 Icon: Object.assign(icon_default, {
16007 displayName: "AlignmentMatrixControl.Icon"
16008 })
16009});
16010var alignment_matrix_control_default = AlignmentMatrixControl;
16011
16012
16013;// ./node_modules/@wordpress/components/build-module/animate/index.js
16014
16015function getDefaultOrigin(type) {
16016 return type === "appear" ? "top" : "left";
16017}
16018function getAnimateClassName(options) {
16019 if (options.type === "loading") {
16020 return "components-animate__loading";
16021 }
16022 const {
16023 type,
16024 origin = getDefaultOrigin(type)
16025 } = options;
16026 if (type === "appear") {
16027 const [yAxis, xAxis = "center"] = origin.split(" ");
16028 return dist_clsx("components-animate__appear", {
16029 ["is-from-" + xAxis]: xAxis !== "center",
16030 ["is-from-" + yAxis]: yAxis !== "middle"
16031 });
16032 }
16033 if (type === "slide-in") {
16034 return dist_clsx("components-animate__slide-in", "is-from-" + origin);
16035 }
16036 return void 0;
16037}
16038function Animate({
16039 type,
16040 options = {},
16041 children
16042}) {
16043 return children({
16044 className: getAnimateClassName({
16045 type,
16046 ...options
16047 })
16048 });
16049}
16050var animate_default = Animate;
16051
16052
16053;// ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs
16054"use client";
16055
16056
16057const LayoutGroupContext = (0,external_React_.createContext)({});
16058
16059
16060
16061;// ./node_modules/framer-motion/dist/es/utils/use-constant.mjs
16062
16063
16064/**
16065 * Creates a constant value over the lifecycle of a component.
16066 *
16067 * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
16068 * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
16069 * you can ensure that initialisers don't execute twice or more.
16070 */
16071function useConstant(init) {
16072 const ref = (0,external_React_.useRef)(null);
16073 if (ref.current === null) {
16074 ref.current = init();
16075 }
16076 return ref.current;
16077}
16078
16079
16080
16081;// ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs
16082"use client";
16083
16084
16085/**
16086 * @public
16087 */
16088const PresenceContext_PresenceContext = (0,external_React_.createContext)(null);
16089
16090
16091
16092;// ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
16093"use client";
16094
16095
16096/**
16097 * @public
16098 */
16099const MotionConfigContext = (0,external_React_.createContext)({
16100 transformPagePoint: (p) => p,
16101 isStatic: false,
16102 reducedMotion: "never",
16103});
16104
16105
16106
16107;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
16108"use client";
16109
16110
16111
16112
16113
16114/**
16115 * Measurement functionality has to be within a separate component
16116 * to leverage snapshot lifecycle.
16117 */
16118class PopChildMeasure extends external_React_.Component {
16119 getSnapshotBeforeUpdate(prevProps) {
16120 const element = this.props.childRef.current;
16121 if (element && prevProps.isPresent && !this.props.isPresent) {
16122 const size = this.props.sizeRef.current;
16123 size.height = element.offsetHeight || 0;
16124 size.width = element.offsetWidth || 0;
16125 size.top = element.offsetTop;
16126 size.left = element.offsetLeft;
16127 }
16128 return null;
16129 }
16130 /**
16131 * Required with getSnapshotBeforeUpdate to stop React complaining.
16132 */
16133 componentDidUpdate() { }
16134 render() {
16135 return this.props.children;
16136 }
16137}
16138function PopChild({ children, isPresent }) {
16139 const id = (0,external_React_.useId)();
16140 const ref = (0,external_React_.useRef)(null);
16141 const size = (0,external_React_.useRef)({
16142 width: 0,
16143 height: 0,
16144 top: 0,
16145 left: 0,
16146 });
16147 const { nonce } = (0,external_React_.useContext)(MotionConfigContext);
16148 /**
16149 * We create and inject a style block so we can apply this explicit
16150 * sizing in a non-destructive manner by just deleting the style block.
16151 *
16152 * We can't apply size via render as the measurement happens
16153 * in getSnapshotBeforeUpdate (post-render), likewise if we apply the
16154 * styles directly on the DOM node, we might be overwriting
16155 * styles set via the style prop.
16156 */
16157 (0,external_React_.useInsertionEffect)(() => {
16158 const { width, height, top, left } = size.current;
16159 if (isPresent || !ref.current || !width || !height)
16160 return;
16161 ref.current.dataset.motionPopId = id;
16162 const style = document.createElement("style");
16163 if (nonce)
16164 style.nonce = nonce;
16165 document.head.appendChild(style);
16166 if (style.sheet) {
16167 style.sheet.insertRule(`
16168 [data-motion-pop-id="${id}"] {
16169 position: absolute !important;
16170 width: ${width}px !important;
16171 height: ${height}px !important;
16172 top: ${top}px !important;
16173 left: ${left}px !important;
16174 }
16175 `);
16176 }
16177 return () => {
16178 document.head.removeChild(style);
16179 };
16180 }, [isPresent]);
16181 return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: external_React_.cloneElement(children, { ref }) }));
16182}
16183
16184
16185
16186;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
16187"use client";
16188
16189
16190
16191
16192
16193
16194
16195const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {
16196 const presenceChildren = useConstant(newChildrenMap);
16197 const id = (0,external_React_.useId)();
16198 const memoizedOnExitComplete = (0,external_React_.useCallback)((childId) => {
16199 presenceChildren.set(childId, true);
16200 for (const isComplete of presenceChildren.values()) {
16201 if (!isComplete)
16202 return; // can stop searching when any is incomplete
16203 }
16204 onExitComplete && onExitComplete();
16205 }, [presenceChildren, onExitComplete]);
16206 const context = (0,external_React_.useMemo)(() => ({
16207 id,
16208 initial,
16209 isPresent,
16210 custom,
16211 onExitComplete: memoizedOnExitComplete,
16212 register: (childId) => {
16213 presenceChildren.set(childId, false);
16214 return () => presenceChildren.delete(childId);
16215 },
16216 }),
16217 /**
16218 * If the presence of a child affects the layout of the components around it,
16219 * we want to make a new context value to ensure they get re-rendered
16220 * so they can detect that layout change.
16221 */
16222 presenceAffectsLayout
16223 ? [Math.random(), memoizedOnExitComplete]
16224 : [isPresent, memoizedOnExitComplete]);
16225 (0,external_React_.useMemo)(() => {
16226 presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
16227 }, [isPresent]);
16228 /**
16229 * If there's no `motion` components to fire exit animations, we want to remove this
16230 * component immediately.
16231 */
16232 external_React_.useEffect(() => {
16233 !isPresent &&
16234 !presenceChildren.size &&
16235 onExitComplete &&
16236 onExitComplete();
16237 }, [isPresent]);
16238 if (mode === "popLayout") {
16239 children = (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopChild, { isPresent: isPresent, children: children });
16240 }
16241 return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PresenceContext_PresenceContext.Provider, { value: context, children: children }));
16242};
16243function newChildrenMap() {
16244 return new Map();
16245}
16246
16247
16248
16249;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
16250
16251
16252
16253/**
16254 * When a component is the child of `AnimatePresence`, it can use `usePresence`
16255 * to access information about whether it's still present in the React tree.
16256 *
16257 * ```jsx
16258 * import { usePresence } from "framer-motion"
16259 *
16260 * export const Component = () => {
16261 * const [isPresent, safeToRemove] = usePresence()
16262 *
16263 * useEffect(() => {
16264 * !isPresent && setTimeout(safeToRemove, 1000)
16265 * }, [isPresent])
16266 *
16267 * return <div />
16268 * }
16269 * ```
16270 *
16271 * If `isPresent` is `false`, it means that a component has been removed the tree, but
16272 * `AnimatePresence` won't really remove it until `safeToRemove` has been called.
16273 *
16274 * @public
16275 */
16276function usePresence(subscribe = true) {
16277 const context = (0,external_React_.useContext)(PresenceContext_PresenceContext);
16278 if (context === null)
16279 return [true, null];
16280 const { isPresent, onExitComplete, register } = context;
16281 // It's safe to call the following hooks conditionally (after an early return) because the context will always
16282 // either be null or non-null for the lifespan of the component.
16283 const id = (0,external_React_.useId)();
16284 (0,external_React_.useEffect)(() => {
16285 if (subscribe)
16286 register(id);
16287 }, [subscribe]);
16288 const safeToRemove = (0,external_React_.useCallback)(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
16289 return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
16290}
16291/**
16292 * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
16293 * There is no `safeToRemove` function.
16294 *
16295 * ```jsx
16296 * import { useIsPresent } from "framer-motion"
16297 *
16298 * export const Component = () => {
16299 * const isPresent = useIsPresent()
16300 *
16301 * useEffect(() => {
16302 * !isPresent && console.log("I've been removed!")
16303 * }, [isPresent])
16304 *
16305 * return <div />
16306 * }
16307 * ```
16308 *
16309 * @public
16310 */
16311function useIsPresent() {
16312 return isPresent(useContext(PresenceContext));
16313}
16314function isPresent(context) {
16315 return context === null ? true : context.isPresent;
16316}
16317
16318
16319
16320;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
16321
16322
16323const getChildKey = (child) => child.key || "";
16324function onlyElements(children) {
16325 const filtered = [];
16326 // We use forEach here instead of map as map mutates the component key by preprending `.$`
16327 external_React_.Children.forEach(children, (child) => {
16328 if ((0,external_React_.isValidElement)(child))
16329 filtered.push(child);
16330 });
16331 return filtered;
16332}
16333
16334
16335
16336;// ./node_modules/framer-motion/dist/es/utils/is-browser.mjs
16337const is_browser_isBrowser = typeof window !== "undefined";
16338
16339
16340
16341;// ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
16342
16343
16344
16345const useIsomorphicLayoutEffect = is_browser_isBrowser ? external_React_.useLayoutEffect : external_React_.useEffect;
16346
16347
16348
16349;// ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
16350"use client";
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360/**
16361 * `AnimatePresence` enables the animation of components that have been removed from the tree.
16362 *
16363 * When adding/removing more than a single child, every child **must** be given a unique `key` prop.
16364 *
16365 * Any `motion` components that have an `exit` property defined will animate out when removed from
16366 * the tree.
16367 *
16368 * ```jsx
16369 * import { motion, AnimatePresence } from 'framer-motion'
16370 *
16371 * export const Items = ({ items }) => (
16372 * <AnimatePresence>
16373 * {items.map(item => (
16374 * <motion.div
16375 * key={item.id}
16376 * initial={{ opacity: 0 }}
16377 * animate={{ opacity: 1 }}
16378 * exit={{ opacity: 0 }}
16379 * />
16380 * ))}
16381 * </AnimatePresence>
16382 * )
16383 * ```
16384 *
16385 * You can sequence exit animations throughout a tree using variants.
16386 *
16387 * If a child contains multiple `motion` components with `exit` props, it will only unmount the child
16388 * once all `motion` components have finished animating out. Likewise, any components using
16389 * `usePresence` all need to call `safeToRemove`.
16390 *
16391 * @public
16392 */
16393const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, }) => {
16394 const [isParentPresent, safeToRemove] = usePresence(propagate);
16395 /**
16396 * Filter any children that aren't ReactElements. We can only track components
16397 * between renders with a props.key.
16398 */
16399 const presentChildren = (0,external_React_.useMemo)(() => onlyElements(children), [children]);
16400 /**
16401 * Track the keys of the currently rendered children. This is used to
16402 * determine which children are exiting.
16403 */
16404 const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
16405 /**
16406 * If `initial={false}` we only want to pass this to components in the first render.
16407 */
16408 const isInitialRender = (0,external_React_.useRef)(true);
16409 /**
16410 * A ref containing the currently present children. When all exit animations
16411 * are complete, we use this to re-render the component with the latest children
16412 * *committed* rather than the latest children *rendered*.
16413 */
16414 const pendingPresentChildren = (0,external_React_.useRef)(presentChildren);
16415 /**
16416 * Track which exiting children have finished animating out.
16417 */
16418 const exitComplete = useConstant(() => new Map());
16419 /**
16420 * Save children to render as React state. To ensure this component is concurrent-safe,
16421 * we check for exiting children via an effect.
16422 */
16423 const [diffedChildren, setDiffedChildren] = (0,external_React_.useState)(presentChildren);
16424 const [renderedChildren, setRenderedChildren] = (0,external_React_.useState)(presentChildren);
16425 useIsomorphicLayoutEffect(() => {
16426 isInitialRender.current = false;
16427 pendingPresentChildren.current = presentChildren;
16428 /**
16429 * Update complete status of exiting children.
16430 */
16431 for (let i = 0; i < renderedChildren.length; i++) {
16432 const key = getChildKey(renderedChildren[i]);
16433 if (!presentKeys.includes(key)) {
16434 if (exitComplete.get(key) !== true) {
16435 exitComplete.set(key, false);
16436 }
16437 }
16438 else {
16439 exitComplete.delete(key);
16440 }
16441 }
16442 }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
16443 const exitingChildren = [];
16444 if (presentChildren !== diffedChildren) {
16445 let nextChildren = [...presentChildren];
16446 /**
16447 * Loop through all the currently rendered components and decide which
16448 * are exiting.
16449 */
16450 for (let i = 0; i < renderedChildren.length; i++) {
16451 const child = renderedChildren[i];
16452 const key = getChildKey(child);
16453 if (!presentKeys.includes(key)) {
16454 nextChildren.splice(i, 0, child);
16455 exitingChildren.push(child);
16456 }
16457 }
16458 /**
16459 * If we're in "wait" mode, and we have exiting children, we want to
16460 * only render these until they've all exited.
16461 */
16462 if (mode === "wait" && exitingChildren.length) {
16463 nextChildren = exitingChildren;
16464 }
16465 setRenderedChildren(onlyElements(nextChildren));
16466 setDiffedChildren(presentChildren);
16467 /**
16468 * Early return to ensure once we've set state with the latest diffed
16469 * children, we can immediately re-render.
16470 */
16471 return;
16472 }
16473 if (false) {}
16474 /**
16475 * If we've been provided a forceRender function by the LayoutGroupContext,
16476 * we can use it to force a re-render amongst all surrounding components once
16477 * all components have finished animating out.
16478 */
16479 const { forceRender } = (0,external_React_.useContext)(LayoutGroupContext);
16480 return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: renderedChildren.map((child) => {
16481 const key = getChildKey(child);
16482 const isPresent = propagate && !isParentPresent
16483 ? false
16484 : presentChildren === renderedChildren ||
16485 presentKeys.includes(key);
16486 const onExit = () => {
16487 if (exitComplete.has(key)) {
16488 exitComplete.set(key, true);
16489 }
16490 else {
16491 return;
16492 }
16493 let isEveryExitComplete = true;
16494 exitComplete.forEach((isExitComplete) => {
16495 if (!isExitComplete)
16496 isEveryExitComplete = false;
16497 });
16498 if (isEveryExitComplete) {
16499 forceRender === null || forceRender === void 0 ? void 0 : forceRender();
16500 setRenderedChildren(pendingPresentChildren.current);
16501 propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());
16502 onExitComplete && onExitComplete();
16503 }
16504 };
16505 return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial
16506 ? undefined
16507 : false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));
16508 }) }));
16509};
16510
16511
16512
16513;// ./node_modules/framer-motion/dist/es/render/components/create-proxy.mjs
16514
16515
16516function createDOMMotionComponentProxy(componentFactory) {
16517 if (typeof Proxy === "undefined") {
16518 return componentFactory;
16519 }
16520 /**
16521 * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
16522 * Rather than generating them anew every render.
16523 */
16524 const componentCache = new Map();
16525 const deprecatedFactoryFunction = (...args) => {
16526 if (false) {}
16527 return componentFactory(...args);
16528 };
16529 return new Proxy(deprecatedFactoryFunction, {
16530 /**
16531 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
16532 * The prop name is passed through as `key` and we can use that to generate a `motion`
16533 * DOM component with that name.
16534 */
16535 get: (_target, key) => {
16536 if (key === "create")
16537 return componentFactory;
16538 /**
16539 * If this element doesn't exist in the component cache, create it and cache.
16540 */
16541 if (!componentCache.has(key)) {
16542 componentCache.set(key, componentFactory(key));
16543 }
16544 return componentCache.get(key);
16545 },
16546 });
16547}
16548
16549
16550
16551;// ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs
16552function isAnimationControls(v) {
16553 return (v !== null &&
16554 typeof v === "object" &&
16555 typeof v.start === "function");
16556}
16557
16558
16559
16560;// ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs
16561const isKeyframesTarget = (v) => {
16562 return Array.isArray(v);
16563};
16564
16565
16566
16567;// ./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs
16568function shallowCompare(next, prev) {
16569 if (!Array.isArray(prev))
16570 return false;
16571 const prevLength = prev.length;
16572 if (prevLength !== next.length)
16573 return false;
16574 for (let i = 0; i < prevLength; i++) {
16575 if (prev[i] !== next[i])
16576 return false;
16577 }
16578 return true;
16579}
16580
16581
16582
16583;// ./node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs
16584/**
16585 * Decides if the supplied variable is variant label
16586 */
16587function isVariantLabel(v) {
16588 return typeof v === "string" || Array.isArray(v);
16589}
16590
16591
16592
16593;// ./node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs
16594function getValueState(visualElement) {
16595 const state = [{}, {}];
16596 visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => {
16597 state[0][key] = value.get();
16598 state[1][key] = value.getVelocity();
16599 });
16600 return state;
16601}
16602function resolveVariantFromProps(props, definition, custom, visualElement) {
16603 /**
16604 * If the variant definition is a function, resolve.
16605 */
16606 if (typeof definition === "function") {
16607 const [current, velocity] = getValueState(visualElement);
16608 definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
16609 }
16610 /**
16611 * If the variant definition is a variant label, or
16612 * the function returned a variant label, resolve.
16613 */
16614 if (typeof definition === "string") {
16615 definition = props.variants && props.variants[definition];
16616 }
16617 /**
16618 * At this point we've resolved both functions and variant labels,
16619 * but the resolved variant label might itself have been a function.
16620 * If so, resolve. This can only have returned a valid target object.
16621 */
16622 if (typeof definition === "function") {
16623 const [current, velocity] = getValueState(visualElement);
16624 definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
16625 }
16626 return definition;
16627}
16628
16629
16630
16631;// ./node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs
16632
16633
16634function resolveVariant(visualElement, definition, custom) {
16635 const props = visualElement.getProps();
16636 return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);
16637}
16638
16639
16640
16641;// ./node_modules/framer-motion/dist/es/render/utils/variant-props.mjs
16642const variantPriorityOrder = [
16643 "animate",
16644 "whileInView",
16645 "whileFocus",
16646 "whileHover",
16647 "whileTap",
16648 "whileDrag",
16649 "exit",
16650];
16651const variantProps = ["initial", ...variantPriorityOrder];
16652
16653
16654
16655;// ./node_modules/motion-utils/dist/es/memo.mjs
16656/*#__NO_SIDE_EFFECTS__*/
16657function memo(callback) {
16658 let result;
16659 return () => {
16660 if (result === undefined)
16661 result = callback();
16662 return result;
16663 };
16664}
16665
16666
16667
16668;// ./node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs
16669
16670
16671const supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);
16672
16673
16674
16675;// ./node_modules/motion-dom/dist/es/animation/controls/BaseGroup.mjs
16676
16677
16678class BaseGroup_BaseGroupPlaybackControls {
16679 constructor(animations) {
16680 // Bound to accomodate common `return animation.stop` pattern
16681 this.stop = () => this.runAll("stop");
16682 this.animations = animations.filter(Boolean);
16683 }
16684 get finished() {
16685 // Support for new finished Promise and legacy thennable API
16686 return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation));
16687 }
16688 /**
16689 * TODO: Filter out cancelled or stopped animations before returning
16690 */
16691 getAll(propName) {
16692 return this.animations[0][propName];
16693 }
16694 setAll(propName, newValue) {
16695 for (let i = 0; i < this.animations.length; i++) {
16696 this.animations[i][propName] = newValue;
16697 }
16698 }
16699 attachTimeline(timeline, fallback) {
16700 const subscriptions = this.animations.map((animation) => {
16701 if (supportsScrollTimeline() && animation.attachTimeline) {
16702 return animation.attachTimeline(timeline);
16703 }
16704 else if (typeof fallback === "function") {
16705 return fallback(animation);
16706 }
16707 });
16708 return () => {
16709 subscriptions.forEach((cancel, i) => {
16710 cancel && cancel();
16711 this.animations[i].stop();
16712 });
16713 };
16714 }
16715 get time() {
16716 return this.getAll("time");
16717 }
16718 set time(time) {
16719 this.setAll("time", time);
16720 }
16721 get speed() {
16722 return this.getAll("speed");
16723 }
16724 set speed(speed) {
16725 this.setAll("speed", speed);
16726 }
16727 get startTime() {
16728 return this.getAll("startTime");
16729 }
16730 get duration() {
16731 let max = 0;
16732 for (let i = 0; i < this.animations.length; i++) {
16733 max = Math.max(max, this.animations[i].duration);
16734 }
16735 return max;
16736 }
16737 runAll(methodName) {
16738 this.animations.forEach((controls) => controls[methodName]());
16739 }
16740 flatten() {
16741 this.runAll("flatten");
16742 }
16743 play() {
16744 this.runAll("play");
16745 }
16746 pause() {
16747 this.runAll("pause");
16748 }
16749 cancel() {
16750 this.runAll("cancel");
16751 }
16752 complete() {
16753 this.runAll("complete");
16754 }
16755}
16756
16757
16758
16759;// ./node_modules/motion-dom/dist/es/animation/controls/Group.mjs
16760
16761
16762/**
16763 * TODO: This is a temporary class to support the legacy
16764 * thennable API
16765 */
16766class GroupPlaybackControls extends BaseGroup_BaseGroupPlaybackControls {
16767 then(onResolve, onReject) {
16768 return Promise.all(this.animations).then(onResolve).catch(onReject);
16769 }
16770}
16771
16772
16773
16774;// ./node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs
16775function get_value_transition_getValueTransition(transition, key) {
16776 return transition
16777 ? transition[key] ||
16778 transition["default"] ||
16779 transition
16780 : undefined;
16781}
16782
16783
16784
16785;// ./node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs
16786/**
16787 * Implement a practical max duration for keyframe generation
16788 * to prevent infinite loops
16789 */
16790const maxGeneratorDuration = 20000;
16791function calcGeneratorDuration(generator) {
16792 let duration = 0;
16793 const timeStep = 50;
16794 let state = generator.next(duration);
16795 while (!state.done && duration < maxGeneratorDuration) {
16796 duration += timeStep;
16797 state = generator.next(duration);
16798 }
16799 return duration >= maxGeneratorDuration ? Infinity : duration;
16800}
16801
16802
16803
16804;// ./node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs
16805function isGenerator(type) {
16806 return typeof type === "function";
16807}
16808
16809
16810
16811;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs
16812function attachTimeline(animation, timeline) {
16813 animation.timeline = timeline;
16814 animation.onfinish = null;
16815}
16816
16817
16818
16819;// ./node_modules/motion-dom/dist/es/utils/is-bezier-definition.mjs
16820const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
16821
16822
16823
16824;// ./node_modules/motion-dom/dist/es/utils/supports/flags.mjs
16825/**
16826 * Add the ability for test suites to manually set support flags
16827 * to better test more environments.
16828 */
16829const supportsFlags = {
16830 linearEasing: undefined,
16831};
16832
16833
16834
16835;// ./node_modules/motion-dom/dist/es/utils/supports/memo.mjs
16836
16837
16838
16839function memoSupports(callback, supportsFlag) {
16840 const memoized = memo(callback);
16841 return () => { var _a; return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized(); };
16842}
16843
16844
16845
16846;// ./node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs
16847
16848
16849const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {
16850 try {
16851 document
16852 .createElement("div")
16853 .animate({ opacity: 0 }, { easing: "linear(0, 1)" });
16854 }
16855 catch (e) {
16856 return false;
16857 }
16858 return true;
16859}, "linearEasing");
16860
16861
16862
16863;// ./node_modules/motion-utils/dist/es/progress.mjs
16864/*
16865 Progress within given range
16866
16867 Given a lower limit and an upper limit, we return the progress
16868 (expressed as a number 0-1) represented by the given value, and
16869 limit that progress to within 0-1.
16870
16871 @param [number]: Lower limit
16872 @param [number]: Upper limit
16873 @param [number]: Value to find progress within given range
16874 @return [number]: Progress of value within range as expressed 0-1
16875*/
16876/*#__NO_SIDE_EFFECTS__*/
16877const progress = (from, to, value) => {
16878 const toFromDifference = to - from;
16879 return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
16880};
16881
16882
16883
16884;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
16885
16886
16887const generateLinearEasing = (easing, duration, // as milliseconds
16888resolution = 10 // as milliseconds
16889) => {
16890 let points = "";
16891 const numPoints = Math.max(Math.round(duration / resolution), 2);
16892 for (let i = 0; i < numPoints; i++) {
16893 points += easing(progress(0, numPoints - 1, i)) + ", ";
16894 }
16895 return `linear(${points.substring(0, points.length - 2)})`;
16896};
16897
16898
16899
16900;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs
16901
16902
16903
16904
16905function isWaapiSupportedEasing(easing) {
16906 return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
16907 !easing ||
16908 (typeof easing === "string" &&
16909 (easing in supportedWaapiEasing || supportsLinearEasing())) ||
16910 isBezierDefinition(easing) ||
16911 (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
16912}
16913const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
16914const supportedWaapiEasing = {
16915 linear: "linear",
16916 ease: "ease",
16917 easeIn: "ease-in",
16918 easeOut: "ease-out",
16919 easeInOut: "ease-in-out",
16920 circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),
16921 circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),
16922 backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
16923 backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
16924};
16925function easing_mapEasingToNativeEasing(easing, duration) {
16926 if (!easing) {
16927 return undefined;
16928 }
16929 else if (typeof easing === "function" && supportsLinearEasing()) {
16930 return generateLinearEasing(easing, duration);
16931 }
16932 else if (isBezierDefinition(easing)) {
16933 return cubicBezierAsString(easing);
16934 }
16935 else if (Array.isArray(easing)) {
16936 return easing.map((segmentEasing) => easing_mapEasingToNativeEasing(segmentEasing, duration) ||
16937 supportedWaapiEasing.easeOut);
16938 }
16939 else {
16940 return supportedWaapiEasing[easing];
16941 }
16942}
16943
16944
16945
16946;// ./node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs
16947const isDragging = {
16948 x: false,
16949 y: false,
16950};
16951function isDragActive() {
16952 return isDragging.x || isDragging.y;
16953}
16954
16955
16956
16957;// ./node_modules/motion-dom/dist/es/utils/resolve-elements.mjs
16958function resolveElements(elementOrSelector, scope, selectorCache) {
16959 var _a;
16960 if (elementOrSelector instanceof Element) {
16961 return [elementOrSelector];
16962 }
16963 else if (typeof elementOrSelector === "string") {
16964 let root = document;
16965 if (scope) {
16966 // TODO: Refactor to utils package
16967 // invariant(
16968 // Boolean(scope.current),
16969 // "Scope provided, but no element detected."
16970 // )
16971 root = scope.current;
16972 }
16973 const elements = (_a = selectorCache === null || selectorCache === void 0 ? void 0 : selectorCache[elementOrSelector]) !== null && _a !== void 0 ? _a : root.querySelectorAll(elementOrSelector);
16974 return elements ? Array.from(elements) : [];
16975 }
16976 return Array.from(elementOrSelector);
16977}
16978
16979
16980
16981;// ./node_modules/motion-dom/dist/es/gestures/utils/setup.mjs
16982
16983
16984function setupGesture(elementOrSelector, options) {
16985 const elements = resolveElements(elementOrSelector);
16986 const gestureAbortController = new AbortController();
16987 const eventOptions = {
16988 passive: true,
16989 ...options,
16990 signal: gestureAbortController.signal,
16991 };
16992 const cancel = () => gestureAbortController.abort();
16993 return [elements, eventOptions, cancel];
16994}
16995
16996
16997
16998;// ./node_modules/motion-dom/dist/es/gestures/hover.mjs
16999
17000
17001
17002/**
17003 * Filter out events that are not pointer events, or are triggering
17004 * while a Motion gesture is active.
17005 */
17006function filterEvents(callback) {
17007 return (event) => {
17008 if (event.pointerType === "touch" || isDragActive())
17009 return;
17010 callback(event);
17011 };
17012}
17013/**
17014 * Create a hover gesture. hover() is different to .addEventListener("pointerenter")
17015 * in that it has an easier syntax, filters out polyfilled touch events, interoperates
17016 * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends.
17017 *
17018 * @public
17019 */
17020function hover(elementOrSelector, onHoverStart, options = {}) {
17021 const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);
17022 const onPointerEnter = filterEvents((enterEvent) => {
17023 const { target } = enterEvent;
17024 const onHoverEnd = onHoverStart(enterEvent);
17025 if (typeof onHoverEnd !== "function" || !target)
17026 return;
17027 const onPointerLeave = filterEvents((leaveEvent) => {
17028 onHoverEnd(leaveEvent);
17029 target.removeEventListener("pointerleave", onPointerLeave);
17030 });
17031 target.addEventListener("pointerleave", onPointerLeave, eventOptions);
17032 });
17033 elements.forEach((element) => {
17034 element.addEventListener("pointerenter", onPointerEnter, eventOptions);
17035 });
17036 return cancel;
17037}
17038
17039
17040
17041;// ./node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs
17042/**
17043 * Recursively traverse up the tree to check whether the provided child node
17044 * is the parent or a descendant of it.
17045 *
17046 * @param parent - Element to find
17047 * @param child - Element to test against parent
17048 */
17049const isNodeOrChild = (parent, child) => {
17050 if (!child) {
17051 return false;
17052 }
17053 else if (parent === child) {
17054 return true;
17055 }
17056 else {
17057 return isNodeOrChild(parent, child.parentElement);
17058 }
17059};
17060
17061
17062
17063;// ./node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs
17064const isPrimaryPointer = (event) => {
17065 if (event.pointerType === "mouse") {
17066 return typeof event.button !== "number" || event.button <= 0;
17067 }
17068 else {
17069 /**
17070 * isPrimary is true for all mice buttons, whereas every touch point
17071 * is regarded as its own input. So subsequent concurrent touch points
17072 * will be false.
17073 *
17074 * Specifically match against false here as incomplete versions of
17075 * PointerEvents in very old browser might have it set as undefined.
17076 */
17077 return event.isPrimary !== false;
17078 }
17079};
17080
17081
17082
17083;// ./node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs
17084const focusableElements = new Set([
17085 "BUTTON",
17086 "INPUT",
17087 "SELECT",
17088 "TEXTAREA",
17089 "A",
17090]);
17091function isElementKeyboardAccessible(element) {
17092 return (focusableElements.has(element.tagName) ||
17093 element.tabIndex !== -1);
17094}
17095
17096
17097
17098;// ./node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs
17099const isPressing = new WeakSet();
17100
17101
17102
17103;// ./node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs
17104
17105
17106/**
17107 * Filter out events that are not "Enter" keys.
17108 */
17109function keyboard_filterEvents(callback) {
17110 return (event) => {
17111 if (event.key !== "Enter")
17112 return;
17113 callback(event);
17114 };
17115}
17116function firePointerEvent(target, type) {
17117 target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true }));
17118}
17119const enableKeyboardPress = (focusEvent, eventOptions) => {
17120 const element = focusEvent.currentTarget;
17121 if (!element)
17122 return;
17123 const handleKeydown = keyboard_filterEvents(() => {
17124 if (isPressing.has(element))
17125 return;
17126 firePointerEvent(element, "down");
17127 const handleKeyup = keyboard_filterEvents(() => {
17128 firePointerEvent(element, "up");
17129 });
17130 const handleBlur = () => firePointerEvent(element, "cancel");
17131 element.addEventListener("keyup", handleKeyup, eventOptions);
17132 element.addEventListener("blur", handleBlur, eventOptions);
17133 });
17134 element.addEventListener("keydown", handleKeydown, eventOptions);
17135 /**
17136 * Add an event listener that fires on blur to remove the keydown events.
17137 */
17138 element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions);
17139};
17140
17141
17142
17143;// ./node_modules/motion-dom/dist/es/gestures/press/index.mjs
17144
17145
17146
17147
17148
17149
17150
17151
17152/**
17153 * Filter out events that are not primary pointer events, or are triggering
17154 * while a Motion gesture is active.
17155 */
17156function isValidPressEvent(event) {
17157 return isPrimaryPointer(event) && !isDragActive();
17158}
17159/**
17160 * Create a press gesture.
17161 *
17162 * Press is different to `"pointerdown"`, `"pointerup"` in that it
17163 * automatically filters out secondary pointer events like right
17164 * click and multitouch.
17165 *
17166 * It also adds accessibility support for keyboards, where
17167 * an element with a press gesture will receive focus and
17168 * trigger on Enter `"keydown"` and `"keyup"` events.
17169 *
17170 * This is different to a browser's `"click"` event, which does
17171 * respond to keyboards but only for the `"click"` itself, rather
17172 * than the press start and end/cancel. The element also needs
17173 * to be focusable for this to work, whereas a press gesture will
17174 * make an element focusable by default.
17175 *
17176 * @public
17177 */
17178function press(elementOrSelector, onPressStart, options = {}) {
17179 const [elements, eventOptions, cancelEvents] = setupGesture(elementOrSelector, options);
17180 const startPress = (startEvent) => {
17181 const element = startEvent.currentTarget;
17182 if (!isValidPressEvent(startEvent) || isPressing.has(element))
17183 return;
17184 isPressing.add(element);
17185 const onPressEnd = onPressStart(startEvent);
17186 const onPointerEnd = (endEvent, success) => {
17187 window.removeEventListener("pointerup", onPointerUp);
17188 window.removeEventListener("pointercancel", onPointerCancel);
17189 if (!isValidPressEvent(endEvent) || !isPressing.has(element)) {
17190 return;
17191 }
17192 isPressing.delete(element);
17193 if (typeof onPressEnd === "function") {
17194 onPressEnd(endEvent, { success });
17195 }
17196 };
17197 const onPointerUp = (upEvent) => {
17198 onPointerEnd(upEvent, options.useGlobalTarget ||
17199 isNodeOrChild(element, upEvent.target));
17200 };
17201 const onPointerCancel = (cancelEvent) => {
17202 onPointerEnd(cancelEvent, false);
17203 };
17204 window.addEventListener("pointerup", onPointerUp, eventOptions);
17205 window.addEventListener("pointercancel", onPointerCancel, eventOptions);
17206 };
17207 elements.forEach((element) => {
17208 if (!isElementKeyboardAccessible(element) &&
17209 element.getAttribute("tabindex") === null) {
17210 element.tabIndex = 0;
17211 }
17212 const target = options.useGlobalTarget ? window : element;
17213 target.addEventListener("pointerdown", startPress, eventOptions);
17214 element.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions);
17215 });
17216 return cancelEvents;
17217}
17218
17219
17220
17221;// ./node_modules/motion-utils/dist/es/time-conversion.mjs
17222/**
17223 * Converts seconds to milliseconds
17224 *
17225 * @param seconds - Time in seconds.
17226 * @return milliseconds - Converted time in milliseconds.
17227 */
17228/*#__NO_SIDE_EFFECTS__*/
17229const time_conversion_secondsToMilliseconds = (seconds) => seconds * 1000;
17230/*#__NO_SIDE_EFFECTS__*/
17231const millisecondsToSeconds = (milliseconds) => milliseconds / 1000;
17232
17233
17234
17235;// ./node_modules/motion-utils/dist/es/noop.mjs
17236/*#__NO_SIDE_EFFECTS__*/
17237const noop_noop = (any) => any;
17238
17239
17240
17241;// ./node_modules/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs
17242
17243
17244
17245class NativeAnimationControls_NativeAnimationControls {
17246 constructor(animation) {
17247 this.animation = animation;
17248 }
17249 get duration() {
17250 var _a, _b, _c;
17251 const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) ||
17252 ((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) ||
17253 300;
17254 return millisecondsToSeconds(Number(durationInMs));
17255 }
17256 get time() {
17257 var _a;
17258 if (this.animation) {
17259 return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
17260 }
17261 return 0;
17262 }
17263 set time(newTime) {
17264 if (this.animation) {
17265 this.animation.currentTime = time_conversion_secondsToMilliseconds(newTime);
17266 }
17267 }
17268 get speed() {
17269 return this.animation ? this.animation.playbackRate : 1;
17270 }
17271 set speed(newSpeed) {
17272 if (this.animation) {
17273 this.animation.playbackRate = newSpeed;
17274 }
17275 }
17276 get state() {
17277 return this.animation ? this.animation.playState : "finished";
17278 }
17279 get startTime() {
17280 return this.animation ? this.animation.startTime : null;
17281 }
17282 get finished() {
17283 return this.animation ? this.animation.finished : Promise.resolve();
17284 }
17285 play() {
17286 this.animation && this.animation.play();
17287 }
17288 pause() {
17289 this.animation && this.animation.pause();
17290 }
17291 stop() {
17292 if (!this.animation ||
17293 this.state === "idle" ||
17294 this.state === "finished") {
17295 return;
17296 }
17297 if (this.animation.commitStyles) {
17298 this.animation.commitStyles();
17299 }
17300 this.cancel();
17301 }
17302 flatten() {
17303 var _a;
17304 if (!this.animation)
17305 return;
17306 (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
17307 }
17308 attachTimeline(timeline) {
17309 if (this.animation)
17310 attachTimeline(this.animation, timeline);
17311 return noop_noop;
17312 }
17313 complete() {
17314 this.animation && this.animation.finish();
17315 }
17316 cancel() {
17317 try {
17318 this.animation && this.animation.cancel();
17319 }
17320 catch (e) { }
17321 }
17322}
17323
17324
17325
17326;// ./node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs
17327
17328
17329
17330/**
17331 * Create a progress => progress easing function from a generator.
17332 */
17333function createGeneratorEasing(options, scale = 100, createGenerator) {
17334 const generator = createGenerator({ ...options, keyframes: [0, scale] });
17335 const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
17336 return {
17337 type: "keyframes",
17338 ease: (progress) => {
17339 return generator.next(duration * progress).value / scale;
17340 },
17341 duration: millisecondsToSeconds(duration),
17342 };
17343}
17344
17345
17346
17347;// ./node_modules/motion-dom/dist/es/animation/waapi/utils/convert-options.mjs
17348
17349
17350
17351
17352
17353
17354const defaultEasing = "easeOut";
17355function convert_options_applyGeneratorOptions(options) {
17356 var _a;
17357 if (isGenerator(options.type)) {
17358 const generatorOptions = createGeneratorEasing(options, 100, options.type);
17359 options.ease = supportsLinearEasing()
17360 ? generatorOptions.ease
17361 : defaultEasing;
17362 options.duration = time_conversion_secondsToMilliseconds(generatorOptions.duration);
17363 options.type = "keyframes";
17364 }
17365 else {
17366 options.duration = time_conversion_secondsToMilliseconds((_a = options.duration) !== null && _a !== void 0 ? _a : 0.3);
17367 options.ease = options.ease || defaultEasing;
17368 }
17369}
17370// TODO: Reuse for NativeAnimation
17371function convertMotionOptionsToNative(valueName, keyframes, options) {
17372 var _a;
17373 const nativeKeyframes = {};
17374 const nativeOptions = {
17375 fill: "both",
17376 easing: "linear",
17377 composite: "replace",
17378 };
17379 nativeOptions.delay = time_conversion_secondsToMilliseconds((_a = options.delay) !== null && _a !== void 0 ? _a : 0);
17380 convert_options_applyGeneratorOptions(options);
17381 nativeOptions.duration = options.duration;
17382 const { ease, times } = options;
17383 if (times)
17384 nativeKeyframes.offset = times;
17385 nativeKeyframes[valueName] = keyframes;
17386 const easing = easing_mapEasingToNativeEasing(ease, options.duration);
17387 /**
17388 * If this is an easing array, apply to keyframes, not animation as a whole
17389 */
17390 if (Array.isArray(easing)) {
17391 nativeKeyframes.easing = easing;
17392 }
17393 else {
17394 nativeOptions.easing = easing;
17395 }
17396 return {
17397 keyframes: nativeKeyframes,
17398 options: nativeOptions,
17399 };
17400}
17401
17402
17403
17404;// ./node_modules/motion-dom/dist/es/animation/waapi/PseudoAnimation.mjs
17405
17406
17407
17408class PseudoAnimation_PseudoAnimation extends NativeAnimationControls_NativeAnimationControls {
17409 constructor(target, pseudoElement, valueName, keyframes, options) {
17410 const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options);
17411 const animation = target.animate(animationOptions.keyframes, {
17412 pseudoElement,
17413 ...animationOptions.options,
17414 });
17415 super(animation);
17416 }
17417}
17418
17419
17420
17421;// ./node_modules/motion-dom/dist/es/view/utils/css.mjs
17422let pendingRules = {};
17423let style = null;
17424const css_css = {
17425 set: (selector, values) => {
17426 pendingRules[selector] = values;
17427 },
17428 commit: () => {
17429 if (!style) {
17430 style = document.createElement("style");
17431 style.id = "motion-view";
17432 }
17433 let cssText = "";
17434 for (const selector in pendingRules) {
17435 const rule = pendingRules[selector];
17436 cssText += `${selector} {\n`;
17437 for (const [property, value] of Object.entries(rule)) {
17438 cssText += ` ${property}: ${value};\n`;
17439 }
17440 cssText += "}\n";
17441 }
17442 style.textContent = cssText;
17443 document.head.appendChild(style);
17444 pendingRules = {};
17445 },
17446 remove: () => {
17447 if (style && style.parentElement) {
17448 style.parentElement.removeChild(style);
17449 }
17450 },
17451};
17452
17453
17454
17455;// ./node_modules/motion-dom/dist/es/view/start.mjs
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469const definitionNames = (/* unused pure expression or super */ null && (["layout", "enter", "exit", "new", "old"]));
17470function start_startViewAnimation(update, defaultOptions, targets) {
17471 if (!document.startViewTransition) {
17472 return new Promise(async (resolve) => {
17473 await update();
17474 resolve(new BaseGroupPlaybackControls([]));
17475 });
17476 }
17477 // TODO: Go over existing targets and ensure they all have ids
17478 /**
17479 * If we don't have any animations defined for the root target,
17480 * remove it from being captured.
17481 */
17482 if (!hasTarget("root", targets)) {
17483 css.set(":root", {
17484 "view-transition-name": "none",
17485 });
17486 }
17487 /**
17488 * Set the timing curve to linear for all view transition layers.
17489 * This gets baked into the keyframes, which can't be changed
17490 * without breaking the generated animation.
17491 *
17492 * This allows us to set easing via updateTiming - which can be changed.
17493 */
17494 css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" });
17495 css.commit(); // Write
17496 const transition = document.startViewTransition(async () => {
17497 await update();
17498 // TODO: Go over new targets and ensure they all have ids
17499 });
17500 transition.finished.finally(() => {
17501 css.remove(); // Write
17502 });
17503 return new Promise((resolve) => {
17504 transition.ready.then(() => {
17505 var _a;
17506 const generatedViewAnimations = getViewAnimations();
17507 const animations = [];
17508 /**
17509 * Create animations for our definitions
17510 */
17511 targets.forEach((definition, target) => {
17512 // TODO: If target is not "root", resolve elements
17513 // and iterate over each
17514 for (const key of definitionNames) {
17515 if (!definition[key])
17516 continue;
17517 const { keyframes, options } = definition[key];
17518 for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {
17519 if (!valueKeyframes)
17520 continue;
17521 const valueOptions = {
17522 ...getValueTransition(defaultOptions, valueName),
17523 ...getValueTransition(options, valueName),
17524 };
17525 const type = chooseLayerType(key);
17526 /**
17527 * If this is an opacity animation, and keyframes are not an array,
17528 * we need to convert them into an array and set an initial value.
17529 */
17530 if (valueName === "opacity" &&
17531 !Array.isArray(valueKeyframes)) {
17532 const initialValue = type === "new" ? 0 : 1;
17533 valueKeyframes = [initialValue, valueKeyframes];
17534 }
17535 /**
17536 * Resolve stagger function if provided.
17537 */
17538 if (typeof valueOptions.delay === "function") {
17539 valueOptions.delay = valueOptions.delay(0, 1);
17540 }
17541 const animation = new PseudoAnimation(document.documentElement, `::view-transition-${type}(${target})`, valueName, valueKeyframes, valueOptions);
17542 animations.push(animation);
17543 }
17544 }
17545 });
17546 /**
17547 * Handle browser generated animations
17548 */
17549 for (const animation of generatedViewAnimations) {
17550 if (animation.playState === "finished")
17551 continue;
17552 const { effect } = animation;
17553 if (!effect || !(effect instanceof KeyframeEffect))
17554 continue;
17555 const { pseudoElement } = effect;
17556 if (!pseudoElement)
17557 continue;
17558 const name = getLayerName(pseudoElement);
17559 if (!name)
17560 continue;
17561 const targetDefinition = targets.get(name.layer);
17562 if (!targetDefinition) {
17563 /**
17564 * If transition name is group then update the timing of the animation
17565 * whereas if it's old or new then we could possibly replace it using
17566 * the above method.
17567 */
17568 const transitionName = name.type === "group" ? "layout" : "";
17569 const animationTransition = {
17570 ...getValueTransition(defaultOptions, transitionName),
17571 };
17572 applyGeneratorOptions(animationTransition);
17573 const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);
17574 effect.updateTiming({
17575 delay: secondsToMilliseconds((_a = animationTransition.delay) !== null && _a !== void 0 ? _a : 0),
17576 duration: animationTransition.duration,
17577 easing,
17578 });
17579 animations.push(new NativeAnimationControls(animation));
17580 }
17581 else if (hasOpacity(targetDefinition, "enter") &&
17582 hasOpacity(targetDefinition, "exit") &&
17583 effect
17584 .getKeyframes()
17585 .some((keyframe) => keyframe.mixBlendMode)) {
17586 animations.push(new NativeAnimationControls(animation));
17587 }
17588 else {
17589 animation.cancel();
17590 }
17591 }
17592 resolve(new BaseGroupPlaybackControls(animations));
17593 });
17594 });
17595}
17596function hasOpacity(target, key) {
17597 var _a;
17598 return (_a = target === null || target === void 0 ? void 0 : target[key]) === null || _a === void 0 ? void 0 : _a.keyframes.opacity;
17599}
17600
17601
17602
17603;// ./node_modules/motion-dom/dist/es/view/index.mjs
17604
17605
17606
17607/**
17608 * TODO:
17609 * - Create view transition on next tick
17610 * - Replace animations with Motion animations
17611 * - Return GroupAnimation on next tick
17612 */
17613class ViewTransitionBuilder {
17614 constructor(update, options = {}) {
17615 this.currentTarget = "root";
17616 this.targets = new Map();
17617 this.notifyReady = noop;
17618 this.readyPromise = new Promise((resolve) => {
17619 this.notifyReady = resolve;
17620 });
17621 queueMicrotask(() => {
17622 startViewAnimation(update, options, this.targets).then((animation) => this.notifyReady(animation));
17623 });
17624 }
17625 get(selector) {
17626 this.currentTarget = selector;
17627 return this;
17628 }
17629 layout(keyframes, options) {
17630 this.updateTarget("layout", keyframes, options);
17631 return this;
17632 }
17633 new(keyframes, options) {
17634 this.updateTarget("new", keyframes, options);
17635 return this;
17636 }
17637 old(keyframes, options) {
17638 this.updateTarget("old", keyframes, options);
17639 return this;
17640 }
17641 enter(keyframes, options) {
17642 this.updateTarget("enter", keyframes, options);
17643 return this;
17644 }
17645 exit(keyframes, options) {
17646 this.updateTarget("exit", keyframes, options);
17647 return this;
17648 }
17649 crossfade(options) {
17650 this.updateTarget("enter", { opacity: 1 }, options);
17651 this.updateTarget("exit", { opacity: 0 }, options);
17652 return this;
17653 }
17654 updateTarget(target, keyframes, options = {}) {
17655 const { currentTarget, targets } = this;
17656 if (!targets.has(currentTarget)) {
17657 targets.set(currentTarget, {});
17658 }
17659 const targetData = targets.get(currentTarget);
17660 targetData[target] = { keyframes, options };
17661 }
17662 then(resolve, reject) {
17663 return this.readyPromise.then(resolve, reject);
17664 }
17665}
17666function view(update, defaultOptions = {}) {
17667 return new ViewTransitionBuilder(update, defaultOptions);
17668}
17669
17670
17671
17672;// ./node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs
17673
17674
17675function setDragLock(axis) {
17676 if (axis === "x" || axis === "y") {
17677 if (isDragging[axis]) {
17678 return null;
17679 }
17680 else {
17681 isDragging[axis] = true;
17682 return () => {
17683 isDragging[axis] = false;
17684 };
17685 }
17686 }
17687 else {
17688 if (isDragging.x || isDragging.y) {
17689 return null;
17690 }
17691 else {
17692 isDragging.x = isDragging.y = true;
17693 return () => {
17694 isDragging.x = isDragging.y = false;
17695 };
17696 }
17697 }
17698}
17699
17700
17701
17702;// ./node_modules/motion-dom/dist/es/index.mjs
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725;// ./node_modules/framer-motion/dist/es/render/html/utils/keys-transform.mjs
17726/**
17727 * Generate a list of every possible transform key.
17728 */
17729const transformPropOrder = [
17730 "transformPerspective",
17731 "x",
17732 "y",
17733 "z",
17734 "translateX",
17735 "translateY",
17736 "translateZ",
17737 "scale",
17738 "scaleX",
17739 "scaleY",
17740 "rotate",
17741 "rotateX",
17742 "rotateY",
17743 "rotateZ",
17744 "skew",
17745 "skewX",
17746 "skewY",
17747];
17748/**
17749 * A quick lookup for transform props.
17750 */
17751const transformProps = new Set(transformPropOrder);
17752
17753
17754
17755;// ./node_modules/framer-motion/dist/es/render/html/utils/keys-position.mjs
17756
17757
17758const positionalKeys = new Set([
17759 "width",
17760 "height",
17761 "top",
17762 "left",
17763 "right",
17764 "bottom",
17765 ...transformPropOrder,
17766]);
17767
17768
17769
17770;// ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs
17771
17772
17773const isCustomValue = (v) => {
17774 return Boolean(v && typeof v === "object" && v.mix && v.toValue);
17775};
17776const resolveFinalValueInKeyframes = (v) => {
17777 // TODO maybe throw if v.length - 1 is placeholder token?
17778 return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
17779};
17780
17781
17782
17783;// ./node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs
17784const MotionGlobalConfig = {
17785 skipAnimations: false,
17786 useManualTiming: false,
17787};
17788
17789
17790
17791;// ./node_modules/framer-motion/dist/es/frameloop/render-step.mjs
17792function createRenderStep(runNextFrame) {
17793 /**
17794 * We create and reuse two queues, one to queue jobs for the current frame
17795 * and one for the next. We reuse to avoid triggering GC after x frames.
17796 */
17797 let thisFrame = new Set();
17798 let nextFrame = new Set();
17799 /**
17800 * Track whether we're currently processing jobs in this step. This way
17801 * we can decide whether to schedule new jobs for this frame or next.
17802 */
17803 let isProcessing = false;
17804 let flushNextFrame = false;
17805 /**
17806 * A set of processes which were marked keepAlive when scheduled.
17807 */
17808 const toKeepAlive = new WeakSet();
17809 let latestFrameData = {
17810 delta: 0.0,
17811 timestamp: 0.0,
17812 isProcessing: false,
17813 };
17814 function triggerCallback(callback) {
17815 if (toKeepAlive.has(callback)) {
17816 step.schedule(callback);
17817 runNextFrame();
17818 }
17819 callback(latestFrameData);
17820 }
17821 const step = {
17822 /**
17823 * Schedule a process to run on the next frame.
17824 */
17825 schedule: (callback, keepAlive = false, immediate = false) => {
17826 const addToCurrentFrame = immediate && isProcessing;
17827 const queue = addToCurrentFrame ? thisFrame : nextFrame;
17828 if (keepAlive)
17829 toKeepAlive.add(callback);
17830 if (!queue.has(callback))
17831 queue.add(callback);
17832 return callback;
17833 },
17834 /**
17835 * Cancel the provided callback from running on the next frame.
17836 */
17837 cancel: (callback) => {
17838 nextFrame.delete(callback);
17839 toKeepAlive.delete(callback);
17840 },
17841 /**
17842 * Execute all schedule callbacks.
17843 */
17844 process: (frameData) => {
17845 latestFrameData = frameData;
17846 /**
17847 * If we're already processing we've probably been triggered by a flushSync
17848 * inside an existing process. Instead of executing, mark flushNextFrame
17849 * as true and ensure we flush the following frame at the end of this one.
17850 */
17851 if (isProcessing) {
17852 flushNextFrame = true;
17853 return;
17854 }
17855 isProcessing = true;
17856 [thisFrame, nextFrame] = [nextFrame, thisFrame];
17857 // Execute this frame
17858 thisFrame.forEach(triggerCallback);
17859 // Clear the frame so no callbacks remain. This is to avoid
17860 // memory leaks should this render step not run for a while.
17861 thisFrame.clear();
17862 isProcessing = false;
17863 if (flushNextFrame) {
17864 flushNextFrame = false;
17865 step.process(frameData);
17866 }
17867 },
17868 };
17869 return step;
17870}
17871
17872
17873
17874;// ./node_modules/framer-motion/dist/es/frameloop/batcher.mjs
17875
17876
17877
17878const stepsOrder = [
17879 "read", // Read
17880 "resolveKeyframes", // Write/Read/Write/Read
17881 "update", // Compute
17882 "preRender", // Compute
17883 "render", // Write
17884 "postRender", // Compute
17885];
17886const maxElapsed = 40;
17887function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
17888 let runNextFrame = false;
17889 let useDefaultElapsed = true;
17890 const state = {
17891 delta: 0.0,
17892 timestamp: 0.0,
17893 isProcessing: false,
17894 };
17895 const flagRunNextFrame = () => (runNextFrame = true);
17896 const steps = stepsOrder.reduce((acc, key) => {
17897 acc[key] = createRenderStep(flagRunNextFrame);
17898 return acc;
17899 }, {});
17900 const { read, resolveKeyframes, update, preRender, render, postRender } = steps;
17901 const processBatch = () => {
17902 const timestamp = MotionGlobalConfig.useManualTiming
17903 ? state.timestamp
17904 : performance.now();
17905 runNextFrame = false;
17906 state.delta = useDefaultElapsed
17907 ? 1000 / 60
17908 : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);
17909 state.timestamp = timestamp;
17910 state.isProcessing = true;
17911 // Unrolled render loop for better per-frame performance
17912 read.process(state);
17913 resolveKeyframes.process(state);
17914 update.process(state);
17915 preRender.process(state);
17916 render.process(state);
17917 postRender.process(state);
17918 state.isProcessing = false;
17919 if (runNextFrame && allowKeepAlive) {
17920 useDefaultElapsed = false;
17921 scheduleNextBatch(processBatch);
17922 }
17923 };
17924 const wake = () => {
17925 runNextFrame = true;
17926 useDefaultElapsed = true;
17927 if (!state.isProcessing) {
17928 scheduleNextBatch(processBatch);
17929 }
17930 };
17931 const schedule = stepsOrder.reduce((acc, key) => {
17932 const step = steps[key];
17933 acc[key] = (process, keepAlive = false, immediate = false) => {
17934 if (!runNextFrame)
17935 wake();
17936 return step.schedule(process, keepAlive, immediate);
17937 };
17938 return acc;
17939 }, {});
17940 const cancel = (process) => {
17941 for (let i = 0; i < stepsOrder.length; i++) {
17942 steps[stepsOrder[i]].cancel(process);
17943 }
17944 };
17945 return { schedule, cancel, state, steps };
17946}
17947
17948
17949
17950;// ./node_modules/framer-motion/dist/es/frameloop/frame.mjs
17951
17952
17953
17954const { schedule: frame_frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop_noop, true);
17955
17956
17957
17958;// ./node_modules/framer-motion/dist/es/frameloop/sync-time.mjs
17959
17960
17961
17962let now;
17963function clearTime() {
17964 now = undefined;
17965}
17966/**
17967 * An eventloop-synchronous alternative to performance.now().
17968 *
17969 * Ensures that time measurements remain consistent within a synchronous context.
17970 * Usually calling performance.now() twice within the same synchronous context
17971 * will return different values which isn't useful for animations when we're usually
17972 * trying to sync animations to the same frame.
17973 */
17974const time = {
17975 now: () => {
17976 if (now === undefined) {
17977 time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming
17978 ? frameData.timestamp
17979 : performance.now());
17980 }
17981 return now;
17982 },
17983 set: (newTime) => {
17984 now = newTime;
17985 queueMicrotask(clearTime);
17986 },
17987};
17988
17989
17990
17991;// ./node_modules/framer-motion/dist/es/utils/array.mjs
17992function addUniqueItem(arr, item) {
17993 if (arr.indexOf(item) === -1)
17994 arr.push(item);
17995}
17996function removeItem(arr, item) {
17997 const index = arr.indexOf(item);
17998 if (index > -1)
17999 arr.splice(index, 1);
18000}
18001// Adapted from array-move
18002function moveItem([...arr], fromIndex, toIndex) {
18003 const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;
18004 if (startIndex >= 0 && startIndex < arr.length) {
18005 const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;
18006 const [item] = arr.splice(fromIndex, 1);
18007 arr.splice(endIndex, 0, item);
18008 }
18009 return arr;
18010}
18011
18012
18013
18014;// ./node_modules/framer-motion/dist/es/utils/subscription-manager.mjs
18015
18016
18017class SubscriptionManager {
18018 constructor() {
18019 this.subscriptions = [];
18020 }
18021 add(handler) {
18022 addUniqueItem(this.subscriptions, handler);
18023 return () => removeItem(this.subscriptions, handler);
18024 }
18025 notify(a, b, c) {
18026 const numSubscriptions = this.subscriptions.length;
18027 if (!numSubscriptions)
18028 return;
18029 if (numSubscriptions === 1) {
18030 /**
18031 * If there's only a single handler we can just call it without invoking a loop.
18032 */
18033 this.subscriptions[0](a, b, c);
18034 }
18035 else {
18036 for (let i = 0; i < numSubscriptions; i++) {
18037 /**
18038 * Check whether the handler exists before firing as it's possible
18039 * the subscriptions were modified during this loop running.
18040 */
18041 const handler = this.subscriptions[i];
18042 handler && handler(a, b, c);
18043 }
18044 }
18045 }
18046 getSize() {
18047 return this.subscriptions.length;
18048 }
18049 clear() {
18050 this.subscriptions.length = 0;
18051 }
18052}
18053
18054
18055
18056;// ./node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs
18057/*
18058 Convert velocity into velocity per second
18059
18060 @param [number]: Unit per frame
18061 @param [number]: Frame duration in ms
18062*/
18063function velocityPerSecond(velocity, frameDuration) {
18064 return frameDuration ? velocity * (1000 / frameDuration) : 0;
18065}
18066
18067
18068
18069;// ./node_modules/framer-motion/dist/es/value/index.mjs
18070
18071
18072
18073
18074
18075
18076/**
18077 * Maximum time between the value of two frames, beyond which we
18078 * assume the velocity has since been 0.
18079 */
18080const MAX_VELOCITY_DELTA = 30;
18081const isFloat = (value) => {
18082 return !isNaN(parseFloat(value));
18083};
18084const collectMotionValues = {
18085 current: undefined,
18086};
18087/**
18088 * `MotionValue` is used to track the state and velocity of motion values.
18089 *
18090 * @public
18091 */
18092class MotionValue {
18093 /**
18094 * @param init - The initiating value
18095 * @param config - Optional configuration options
18096 *
18097 * - `transformer`: A function to transform incoming values with.
18098 *
18099 * @internal
18100 */
18101 constructor(init, options = {}) {
18102 /**
18103 * This will be replaced by the build step with the latest version number.
18104 * When MotionValues are provided to motion components, warn if versions are mixed.
18105 */
18106 this.version = "11.18.2";
18107 /**
18108 * Tracks whether this value can output a velocity. Currently this is only true
18109 * if the value is numerical, but we might be able to widen the scope here and support
18110 * other value types.
18111 *
18112 * @internal
18113 */
18114 this.canTrackVelocity = null;
18115 /**
18116 * An object containing a SubscriptionManager for each active event.
18117 */
18118 this.events = {};
18119 this.updateAndNotify = (v, render = true) => {
18120 const currentTime = time.now();
18121 /**
18122 * If we're updating the value during another frame or eventloop
18123 * than the previous frame, then the we set the previous frame value
18124 * to current.
18125 */
18126 if (this.updatedAt !== currentTime) {
18127 this.setPrevFrameValue();
18128 }
18129 this.prev = this.current;
18130 this.setCurrent(v);
18131 // Update update subscribers
18132 if (this.current !== this.prev && this.events.change) {
18133 this.events.change.notify(this.current);
18134 }
18135 // Update render subscribers
18136 if (render && this.events.renderRequest) {
18137 this.events.renderRequest.notify(this.current);
18138 }
18139 };
18140 this.hasAnimated = false;
18141 this.setCurrent(init);
18142 this.owner = options.owner;
18143 }
18144 setCurrent(current) {
18145 this.current = current;
18146 this.updatedAt = time.now();
18147 if (this.canTrackVelocity === null && current !== undefined) {
18148 this.canTrackVelocity = isFloat(this.current);
18149 }
18150 }
18151 setPrevFrameValue(prevFrameValue = this.current) {
18152 this.prevFrameValue = prevFrameValue;
18153 this.prevUpdatedAt = this.updatedAt;
18154 }
18155 /**
18156 * Adds a function that will be notified when the `MotionValue` is updated.
18157 *
18158 * It returns a function that, when called, will cancel the subscription.
18159 *
18160 * When calling `onChange` inside a React component, it should be wrapped with the
18161 * `useEffect` hook. As it returns an unsubscribe function, this should be returned
18162 * from the `useEffect` function to ensure you don't add duplicate subscribers..
18163 *
18164 * ```jsx
18165 * export const MyComponent = () => {
18166 * const x = useMotionValue(0)
18167 * const y = useMotionValue(0)
18168 * const opacity = useMotionValue(1)
18169 *
18170 * useEffect(() => {
18171 * function updateOpacity() {
18172 * const maxXY = Math.max(x.get(), y.get())
18173 * const newOpacity = transform(maxXY, [0, 100], [1, 0])
18174 * opacity.set(newOpacity)
18175 * }
18176 *
18177 * const unsubscribeX = x.on("change", updateOpacity)
18178 * const unsubscribeY = y.on("change", updateOpacity)
18179 *
18180 * return () => {
18181 * unsubscribeX()
18182 * unsubscribeY()
18183 * }
18184 * }, [])
18185 *
18186 * return <motion.div style={{ x }} />
18187 * }
18188 * ```
18189 *
18190 * @param subscriber - A function that receives the latest value.
18191 * @returns A function that, when called, will cancel this subscription.
18192 *
18193 * @deprecated
18194 */
18195 onChange(subscription) {
18196 if (false) {}
18197 return this.on("change", subscription);
18198 }
18199 on(eventName, callback) {
18200 if (!this.events[eventName]) {
18201 this.events[eventName] = new SubscriptionManager();
18202 }
18203 const unsubscribe = this.events[eventName].add(callback);
18204 if (eventName === "change") {
18205 return () => {
18206 unsubscribe();
18207 /**
18208 * If we have no more change listeners by the start
18209 * of the next frame, stop active animations.
18210 */
18211 frame_frame.read(() => {
18212 if (!this.events.change.getSize()) {
18213 this.stop();
18214 }
18215 });
18216 };
18217 }
18218 return unsubscribe;
18219 }
18220 clearListeners() {
18221 for (const eventManagers in this.events) {
18222 this.events[eventManagers].clear();
18223 }
18224 }
18225 /**
18226 * Attaches a passive effect to the `MotionValue`.
18227 *
18228 * @internal
18229 */
18230 attach(passiveEffect, stopPassiveEffect) {
18231 this.passiveEffect = passiveEffect;
18232 this.stopPassiveEffect = stopPassiveEffect;
18233 }
18234 /**
18235 * Sets the state of the `MotionValue`.
18236 *
18237 * @remarks
18238 *
18239 * ```jsx
18240 * const x = useMotionValue(0)
18241 * x.set(10)
18242 * ```
18243 *
18244 * @param latest - Latest value to set.
18245 * @param render - Whether to notify render subscribers. Defaults to `true`
18246 *
18247 * @public
18248 */
18249 set(v, render = true) {
18250 if (!render || !this.passiveEffect) {
18251 this.updateAndNotify(v, render);
18252 }
18253 else {
18254 this.passiveEffect(v, this.updateAndNotify);
18255 }
18256 }
18257 setWithVelocity(prev, current, delta) {
18258 this.set(current);
18259 this.prev = undefined;
18260 this.prevFrameValue = prev;
18261 this.prevUpdatedAt = this.updatedAt - delta;
18262 }
18263 /**
18264 * Set the state of the `MotionValue`, stopping any active animations,
18265 * effects, and resets velocity to `0`.
18266 */
18267 jump(v, endAnimation = true) {
18268 this.updateAndNotify(v);
18269 this.prev = v;
18270 this.prevUpdatedAt = this.prevFrameValue = undefined;
18271 endAnimation && this.stop();
18272 if (this.stopPassiveEffect)
18273 this.stopPassiveEffect();
18274 }
18275 /**
18276 * Returns the latest state of `MotionValue`
18277 *
18278 * @returns - The latest state of `MotionValue`
18279 *
18280 * @public
18281 */
18282 get() {
18283 if (collectMotionValues.current) {
18284 collectMotionValues.current.push(this);
18285 }
18286 return this.current;
18287 }
18288 /**
18289 * @public
18290 */
18291 getPrevious() {
18292 return this.prev;
18293 }
18294 /**
18295 * Returns the latest velocity of `MotionValue`
18296 *
18297 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
18298 *
18299 * @public
18300 */
18301 getVelocity() {
18302 const currentTime = time.now();
18303 if (!this.canTrackVelocity ||
18304 this.prevFrameValue === undefined ||
18305 currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {
18306 return 0;
18307 }
18308 const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);
18309 // Casts because of parseFloat's poor typing
18310 return velocityPerSecond(parseFloat(this.current) -
18311 parseFloat(this.prevFrameValue), delta);
18312 }
18313 /**
18314 * Registers a new animation to control this `MotionValue`. Only one
18315 * animation can drive a `MotionValue` at one time.
18316 *
18317 * ```jsx
18318 * value.start()
18319 * ```
18320 *
18321 * @param animation - A function that starts the provided animation
18322 *
18323 * @internal
18324 */
18325 start(startAnimation) {
18326 this.stop();
18327 return new Promise((resolve) => {
18328 this.hasAnimated = true;
18329 this.animation = startAnimation(resolve);
18330 if (this.events.animationStart) {
18331 this.events.animationStart.notify();
18332 }
18333 }).then(() => {
18334 if (this.events.animationComplete) {
18335 this.events.animationComplete.notify();
18336 }
18337 this.clearAnimation();
18338 });
18339 }
18340 /**
18341 * Stop the currently active animation.
18342 *
18343 * @public
18344 */
18345 stop() {
18346 if (this.animation) {
18347 this.animation.stop();
18348 if (this.events.animationCancel) {
18349 this.events.animationCancel.notify();
18350 }
18351 }
18352 this.clearAnimation();
18353 }
18354 /**
18355 * Returns `true` if this value is currently animating.
18356 *
18357 * @public
18358 */
18359 isAnimating() {
18360 return !!this.animation;
18361 }
18362 clearAnimation() {
18363 delete this.animation;
18364 }
18365 /**
18366 * Destroy and clean up subscribers to this `MotionValue`.
18367 *
18368 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
18369 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
18370 * created a `MotionValue` via the `motionValue` function.
18371 *
18372 * @public
18373 */
18374 destroy() {
18375 this.clearListeners();
18376 this.stop();
18377 if (this.stopPassiveEffect) {
18378 this.stopPassiveEffect();
18379 }
18380 }
18381}
18382function motionValue(init, options) {
18383 return new MotionValue(init, options);
18384}
18385
18386
18387
18388;// ./node_modules/framer-motion/dist/es/render/utils/setters.mjs
18389
18390
18391
18392
18393/**
18394 * Set VisualElement's MotionValue, creating a new MotionValue for it if
18395 * it doesn't exist.
18396 */
18397function setMotionValue(visualElement, key, value) {
18398 if (visualElement.hasValue(key)) {
18399 visualElement.getValue(key).set(value);
18400 }
18401 else {
18402 visualElement.addValue(key, motionValue(value));
18403 }
18404}
18405function setTarget(visualElement, definition) {
18406 const resolved = resolveVariant(visualElement, definition);
18407 let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
18408 target = { ...target, ...transitionEnd };
18409 for (const key in target) {
18410 const value = resolveFinalValueInKeyframes(target[key]);
18411 setMotionValue(visualElement, key, value);
18412 }
18413}
18414
18415
18416
18417;// ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs
18418const isMotionValue = (value) => Boolean(value && value.getVelocity);
18419
18420
18421
18422;// ./node_modules/framer-motion/dist/es/value/use-will-change/is.mjs
18423
18424
18425function isWillChangeMotionValue(value) {
18426 return Boolean(isMotionValue(value) && value.add);
18427}
18428
18429
18430
18431;// ./node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs
18432
18433
18434function addValueToWillChange(visualElement, key) {
18435 const willChange = visualElement.getValue("willChange");
18436 /**
18437 * It could be that a user has set willChange to a regular MotionValue,
18438 * in which case we can't add the value to it.
18439 */
18440 if (isWillChangeMotionValue(willChange)) {
18441 return willChange.add(key);
18442 }
18443}
18444
18445
18446
18447;// ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs
18448/**
18449 * Convert camelCase to dash-case properties.
18450 */
18451const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase();
18452
18453
18454
18455;// ./node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs
18456
18457
18458const optimizedAppearDataId = "framerAppearId";
18459const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
18460
18461
18462
18463;// ./node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs
18464
18465
18466function getOptimisedAppearId(visualElement) {
18467 return visualElement.props[optimizedAppearDataAttribute];
18468}
18469
18470
18471
18472;// ./node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs
18473const instantAnimationState = {
18474 current: false,
18475};
18476
18477
18478
18479;// ./node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs
18480
18481
18482/*
18483 Bezier function generator
18484 This has been modified from Gaëtan Renaudeau's BezierEasing
18485 https://github.com/gre/bezier-easing/blob/master/src/index.js
18486 https://github.com/gre/bezier-easing/blob/master/LICENSE
18487
18488 I've removed the newtonRaphsonIterate algo because in benchmarking it
18489 wasn't noticiably faster than binarySubdivision, indeed removing it
18490 usually improved times, depending on the curve.
18491 I also removed the lookup table, as for the added bundle size and loop we're
18492 only cutting ~4 or so subdivision iterations. I bumped the max iterations up
18493 to 12 to compensate and this still tended to be faster for no perceivable
18494 loss in accuracy.
18495 Usage
18496 const easeOut = cubicBezier(.17,.67,.83,.67);
18497 const x = easeOut(0.5); // returns 0.627...
18498*/
18499// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
18500const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *
18501 t;
18502const subdivisionPrecision = 0.0000001;
18503const subdivisionMaxIterations = 12;
18504function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
18505 let currentX;
18506 let currentT;
18507 let i = 0;
18508 do {
18509 currentT = lowerBound + (upperBound - lowerBound) / 2.0;
18510 currentX = calcBezier(currentT, mX1, mX2) - x;
18511 if (currentX > 0.0) {
18512 upperBound = currentT;
18513 }
18514 else {
18515 lowerBound = currentT;
18516 }
18517 } while (Math.abs(currentX) > subdivisionPrecision &&
18518 ++i < subdivisionMaxIterations);
18519 return currentT;
18520}
18521function cubicBezier(mX1, mY1, mX2, mY2) {
18522 // If this is a linear gradient, return linear easing
18523 if (mX1 === mY1 && mX2 === mY2)
18524 return noop_noop;
18525 const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
18526 // If animation is at start/end, return t without easing
18527 return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
18528}
18529
18530
18531
18532;// ./node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs
18533// Accepts an easing function and returns a new one that outputs mirrored values for
18534// the second half of the animation. Turns easeIn into easeInOut.
18535const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
18536
18537
18538
18539;// ./node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs
18540// Accepts an easing function and returns a new one that outputs reversed values.
18541// Turns easeIn into easeOut.
18542const reverseEasing = (easing) => (p) => 1 - easing(1 - p);
18543
18544
18545
18546;// ./node_modules/framer-motion/dist/es/easing/back.mjs
18547
18548
18549
18550
18551const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);
18552const backIn = /*@__PURE__*/ reverseEasing(backOut);
18553const backInOut = /*@__PURE__*/ mirrorEasing(backIn);
18554
18555
18556
18557;// ./node_modules/framer-motion/dist/es/easing/anticipate.mjs
18558
18559
18560const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
18561
18562
18563
18564;// ./node_modules/framer-motion/dist/es/easing/circ.mjs
18565
18566
18567
18568const circIn = (p) => 1 - Math.sin(Math.acos(p));
18569const circOut = reverseEasing(circIn);
18570const circInOut = mirrorEasing(circIn);
18571
18572
18573
18574;// ./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs
18575/**
18576 * Check if the value is a zero value string like "0px" or "0%"
18577 */
18578const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
18579
18580
18581
18582;// ./node_modules/framer-motion/dist/es/animation/utils/is-none.mjs
18583
18584
18585function isNone(value) {
18586 if (typeof value === "number") {
18587 return value === 0;
18588 }
18589 else if (value !== null) {
18590 return value === "none" || value === "0" || isZeroValueString(value);
18591 }
18592 else {
18593 return true;
18594 }
18595}
18596
18597
18598
18599;// ./node_modules/framer-motion/dist/es/utils/clamp.mjs
18600const clamp_clamp = (min, max, v) => {
18601 if (v > max)
18602 return max;
18603 if (v < min)
18604 return min;
18605 return v;
18606};
18607
18608
18609
18610;// ./node_modules/framer-motion/dist/es/value/types/numbers/index.mjs
18611
18612
18613const number = {
18614 test: (v) => typeof v === "number",
18615 parse: parseFloat,
18616 transform: (v) => v,
18617};
18618const alpha = {
18619 ...number,
18620 transform: (v) => clamp_clamp(0, 1, v),
18621};
18622const scale = {
18623 ...number,
18624 default: 1,
18625};
18626
18627
18628
18629;// ./node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs
18630// If this number is a decimal, make it just five decimal places
18631// to avoid exponents
18632const sanitize = (v) => Math.round(v * 100000) / 100000;
18633
18634
18635
18636;// ./node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs
18637const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
18638
18639
18640
18641;// ./node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs
18642function isNullish(v) {
18643 return v == null;
18644}
18645
18646
18647
18648;// ./node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs
18649const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
18650
18651
18652
18653;// ./node_modules/framer-motion/dist/es/value/types/color/utils.mjs
18654
18655
18656
18657
18658/**
18659 * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,
18660 * but false if a number or multiple colors
18661 */
18662const isColorString = (type, testProp) => (v) => {
18663 return Boolean((typeof v === "string" &&
18664 singleColorRegex.test(v) &&
18665 v.startsWith(type)) ||
18666 (testProp &&
18667 !isNullish(v) &&
18668 Object.prototype.hasOwnProperty.call(v, testProp)));
18669};
18670const splitColor = (aName, bName, cName) => (v) => {
18671 if (typeof v !== "string")
18672 return v;
18673 const [a, b, c, alpha] = v.match(floatRegex);
18674 return {
18675 [aName]: parseFloat(a),
18676 [bName]: parseFloat(b),
18677 [cName]: parseFloat(c),
18678 alpha: alpha !== undefined ? parseFloat(alpha) : 1,
18679 };
18680};
18681
18682
18683
18684;// ./node_modules/framer-motion/dist/es/value/types/color/rgba.mjs
18685
18686
18687
18688
18689
18690const clampRgbUnit = (v) => clamp_clamp(0, 255, v);
18691const rgbUnit = {
18692 ...number,
18693 transform: (v) => Math.round(clampRgbUnit(v)),
18694};
18695const rgba = {
18696 test: /*@__PURE__*/ isColorString("rgb", "red"),
18697 parse: /*@__PURE__*/ splitColor("red", "green", "blue"),
18698 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" +
18699 rgbUnit.transform(red) +
18700 ", " +
18701 rgbUnit.transform(green) +
18702 ", " +
18703 rgbUnit.transform(blue) +
18704 ", " +
18705 sanitize(alpha.transform(alpha$1)) +
18706 ")",
18707};
18708
18709
18710
18711;// ./node_modules/framer-motion/dist/es/value/types/color/hex.mjs
18712
18713
18714
18715function parseHex(v) {
18716 let r = "";
18717 let g = "";
18718 let b = "";
18719 let a = "";
18720 // If we have 6 characters, ie #FF0000
18721 if (v.length > 5) {
18722 r = v.substring(1, 3);
18723 g = v.substring(3, 5);
18724 b = v.substring(5, 7);
18725 a = v.substring(7, 9);
18726 // Or we have 3 characters, ie #F00
18727 }
18728 else {
18729 r = v.substring(1, 2);
18730 g = v.substring(2, 3);
18731 b = v.substring(3, 4);
18732 a = v.substring(4, 5);
18733 r += r;
18734 g += g;
18735 b += b;
18736 a += a;
18737 }
18738 return {
18739 red: parseInt(r, 16),
18740 green: parseInt(g, 16),
18741 blue: parseInt(b, 16),
18742 alpha: a ? parseInt(a, 16) / 255 : 1,
18743 };
18744}
18745const hex = {
18746 test: /*@__PURE__*/ isColorString("#"),
18747 parse: parseHex,
18748 transform: rgba.transform,
18749};
18750
18751
18752
18753;// ./node_modules/framer-motion/dist/es/value/types/numbers/units.mjs
18754const createUnitType = (unit) => ({
18755 test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
18756 parse: parseFloat,
18757 transform: (v) => `${v}${unit}`,
18758});
18759const degrees = /*@__PURE__*/ createUnitType("deg");
18760const percent = /*@__PURE__*/ createUnitType("%");
18761const px = /*@__PURE__*/ createUnitType("px");
18762const vh = /*@__PURE__*/ createUnitType("vh");
18763const vw = /*@__PURE__*/ createUnitType("vw");
18764const progressPercentage = {
18765 ...percent,
18766 parse: (v) => percent.parse(v) / 100,
18767 transform: (v) => percent.transform(v * 100),
18768};
18769
18770
18771
18772;// ./node_modules/framer-motion/dist/es/value/types/color/hsla.mjs
18773
18774
18775
18776
18777
18778const hsla = {
18779 test: /*@__PURE__*/ isColorString("hsl", "hue"),
18780 parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"),
18781 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {
18782 return ("hsla(" +
18783 Math.round(hue) +
18784 ", " +
18785 percent.transform(sanitize(saturation)) +
18786 ", " +
18787 percent.transform(sanitize(lightness)) +
18788 ", " +
18789 sanitize(alpha.transform(alpha$1)) +
18790 ")");
18791 },
18792};
18793
18794
18795
18796;// ./node_modules/framer-motion/dist/es/value/types/color/index.mjs
18797
18798
18799
18800
18801const color = {
18802 test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
18803 parse: (v) => {
18804 if (rgba.test(v)) {
18805 return rgba.parse(v);
18806 }
18807 else if (hsla.test(v)) {
18808 return hsla.parse(v);
18809 }
18810 else {
18811 return hex.parse(v);
18812 }
18813 },
18814 transform: (v) => {
18815 return typeof v === "string"
18816 ? v
18817 : v.hasOwnProperty("red")
18818 ? rgba.transform(v)
18819 : hsla.transform(v);
18820 },
18821};
18822
18823
18824
18825;// ./node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs
18826const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
18827
18828
18829
18830;// ./node_modules/framer-motion/dist/es/value/types/complex/index.mjs
18831
18832
18833
18834
18835
18836function test(v) {
18837 var _a, _b;
18838 return (isNaN(v) &&
18839 typeof v === "string" &&
18840 (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +
18841 (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >
18842 0);
18843}
18844const NUMBER_TOKEN = "number";
18845const COLOR_TOKEN = "color";
18846const VAR_TOKEN = "var";
18847const VAR_FUNCTION_TOKEN = "var(";
18848const SPLIT_TOKEN = "${}";
18849// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`
18850const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
18851function analyseComplexValue(value) {
18852 const originalValue = value.toString();
18853 const values = [];
18854 const indexes = {
18855 color: [],
18856 number: [],
18857 var: [],
18858 };
18859 const types = [];
18860 let i = 0;
18861 const tokenised = originalValue.replace(complexRegex, (parsedValue) => {
18862 if (color.test(parsedValue)) {
18863 indexes.color.push(i);
18864 types.push(COLOR_TOKEN);
18865 values.push(color.parse(parsedValue));
18866 }
18867 else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {
18868 indexes.var.push(i);
18869 types.push(VAR_TOKEN);
18870 values.push(parsedValue);
18871 }
18872 else {
18873 indexes.number.push(i);
18874 types.push(NUMBER_TOKEN);
18875 values.push(parseFloat(parsedValue));
18876 }
18877 ++i;
18878 return SPLIT_TOKEN;
18879 });
18880 const split = tokenised.split(SPLIT_TOKEN);
18881 return { values, split, indexes, types };
18882}
18883function parseComplexValue(v) {
18884 return analyseComplexValue(v).values;
18885}
18886function createTransformer(source) {
18887 const { split, types } = analyseComplexValue(source);
18888 const numSections = split.length;
18889 return (v) => {
18890 let output = "";
18891 for (let i = 0; i < numSections; i++) {
18892 output += split[i];
18893 if (v[i] !== undefined) {
18894 const type = types[i];
18895 if (type === NUMBER_TOKEN) {
18896 output += sanitize(v[i]);
18897 }
18898 else if (type === COLOR_TOKEN) {
18899 output += color.transform(v[i]);
18900 }
18901 else {
18902 output += v[i];
18903 }
18904 }
18905 }
18906 return output;
18907 };
18908}
18909const convertNumbersToZero = (v) => typeof v === "number" ? 0 : v;
18910function getAnimatableNone(v) {
18911 const parsed = parseComplexValue(v);
18912 const transformer = createTransformer(v);
18913 return transformer(parsed.map(convertNumbersToZero));
18914}
18915const complex = {
18916 test,
18917 parse: parseComplexValue,
18918 createTransformer,
18919 getAnimatableNone,
18920};
18921
18922
18923
18924;// ./node_modules/framer-motion/dist/es/value/types/complex/filter.mjs
18925
18926
18927
18928/**
18929 * Properties that should default to 1 or 100%
18930 */
18931const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]);
18932function applyDefaultFilter(v) {
18933 const [name, value] = v.slice(0, -1).split("(");
18934 if (name === "drop-shadow")
18935 return v;
18936 const [number] = value.match(floatRegex) || [];
18937 if (!number)
18938 return v;
18939 const unit = value.replace(number, "");
18940 let defaultValue = maxDefaults.has(name) ? 1 : 0;
18941 if (number !== value)
18942 defaultValue *= 100;
18943 return name + "(" + defaultValue + unit + ")";
18944}
18945const functionRegex = /\b([a-z-]*)\(.*?\)/gu;
18946const filter = {
18947 ...complex,
18948 getAnimatableNone: (v) => {
18949 const functions = v.match(functionRegex);
18950 return functions ? functions.map(applyDefaultFilter).join(" ") : v;
18951 },
18952};
18953
18954
18955
18956;// ./node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs
18957
18958
18959const browserNumberValueTypes = {
18960 // Border props
18961 borderWidth: px,
18962 borderTopWidth: px,
18963 borderRightWidth: px,
18964 borderBottomWidth: px,
18965 borderLeftWidth: px,
18966 borderRadius: px,
18967 radius: px,
18968 borderTopLeftRadius: px,
18969 borderTopRightRadius: px,
18970 borderBottomRightRadius: px,
18971 borderBottomLeftRadius: px,
18972 // Positioning props
18973 width: px,
18974 maxWidth: px,
18975 height: px,
18976 maxHeight: px,
18977 top: px,
18978 right: px,
18979 bottom: px,
18980 left: px,
18981 // Spacing props
18982 padding: px,
18983 paddingTop: px,
18984 paddingRight: px,
18985 paddingBottom: px,
18986 paddingLeft: px,
18987 margin: px,
18988 marginTop: px,
18989 marginRight: px,
18990 marginBottom: px,
18991 marginLeft: px,
18992 // Misc
18993 backgroundPositionX: px,
18994 backgroundPositionY: px,
18995};
18996
18997
18998
18999;// ./node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs
19000
19001
19002
19003const transformValueTypes = {
19004 rotate: degrees,
19005 rotateX: degrees,
19006 rotateY: degrees,
19007 rotateZ: degrees,
19008 scale: scale,
19009 scaleX: scale,
19010 scaleY: scale,
19011 scaleZ: scale,
19012 skew: degrees,
19013 skewX: degrees,
19014 skewY: degrees,
19015 distance: px,
19016 translateX: px,
19017 translateY: px,
19018 translateZ: px,
19019 x: px,
19020 y: px,
19021 z: px,
19022 perspective: px,
19023 transformPerspective: px,
19024 opacity: alpha,
19025 originX: progressPercentage,
19026 originY: progressPercentage,
19027 originZ: px,
19028};
19029
19030
19031
19032;// ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs
19033
19034
19035const type_int_int = {
19036 ...number,
19037 transform: Math.round,
19038};
19039
19040
19041
19042;// ./node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs
19043
19044
19045
19046
19047
19048
19049const numberValueTypes = {
19050 ...browserNumberValueTypes,
19051 ...transformValueTypes,
19052 zIndex: type_int_int,
19053 size: px,
19054 // SVG
19055 fillOpacity: alpha,
19056 strokeOpacity: alpha,
19057 numOctaves: type_int_int,
19058};
19059
19060
19061
19062;// ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs
19063
19064
19065
19066
19067/**
19068 * A map of default value types for common values
19069 */
19070const defaultValueTypes = {
19071 ...numberValueTypes,
19072 // Color props
19073 color: color,
19074 backgroundColor: color,
19075 outlineColor: color,
19076 fill: color,
19077 stroke: color,
19078 // Border props
19079 borderColor: color,
19080 borderTopColor: color,
19081 borderRightColor: color,
19082 borderBottomColor: color,
19083 borderLeftColor: color,
19084 filter: filter,
19085 WebkitFilter: filter,
19086};
19087/**
19088 * Gets the default ValueType for the provided value key
19089 */
19090const getDefaultValueType = (key) => defaultValueTypes[key];
19091
19092
19093
19094;// ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs
19095
19096
19097
19098
19099function animatable_none_getAnimatableNone(key, value) {
19100 let defaultValueType = getDefaultValueType(key);
19101 if (defaultValueType !== filter)
19102 defaultValueType = complex;
19103 // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
19104 return defaultValueType.getAnimatableNone
19105 ? defaultValueType.getAnimatableNone(value)
19106 : undefined;
19107}
19108
19109
19110
19111;// ./node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs
19112
19113
19114
19115/**
19116 * If we encounter keyframes like "none" or "0" and we also have keyframes like
19117 * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for
19118 * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into
19119 * zero equivalents, i.e. "#fff0" or "0px 0px".
19120 */
19121const invalidTemplates = new Set(["auto", "none", "0"]);
19122function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {
19123 let i = 0;
19124 let animatableTemplate = undefined;
19125 while (i < unresolvedKeyframes.length && !animatableTemplate) {
19126 const keyframe = unresolvedKeyframes[i];
19127 if (typeof keyframe === "string" &&
19128 !invalidTemplates.has(keyframe) &&
19129 analyseComplexValue(keyframe).values.length) {
19130 animatableTemplate = unresolvedKeyframes[i];
19131 }
19132 i++;
19133 }
19134 if (animatableTemplate && name) {
19135 for (const noneIndex of noneKeyframeIndexes) {
19136 unresolvedKeyframes[noneIndex] = animatable_none_getAnimatableNone(name, animatableTemplate);
19137 }
19138 }
19139}
19140
19141
19142
19143;// ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs
19144
19145
19146
19147
19148const isNumOrPxType = (v) => v === number || v === px;
19149const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
19150const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
19151 if (transform === "none" || !transform)
19152 return 0;
19153 const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
19154 if (matrix3d) {
19155 return getPosFromMatrix(matrix3d[1], pos3);
19156 }
19157 else {
19158 const matrix = transform.match(/^matrix\((.+)\)$/u);
19159 if (matrix) {
19160 return getPosFromMatrix(matrix[1], pos2);
19161 }
19162 else {
19163 return 0;
19164 }
19165 }
19166};
19167const transformKeys = new Set(["x", "y", "z"]);
19168const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
19169function removeNonTranslationalTransform(visualElement) {
19170 const removedTransforms = [];
19171 nonTranslationalTransformKeys.forEach((key) => {
19172 const value = visualElement.getValue(key);
19173 if (value !== undefined) {
19174 removedTransforms.push([key, value.get()]);
19175 value.set(key.startsWith("scale") ? 1 : 0);
19176 }
19177 });
19178 return removedTransforms;
19179}
19180const positionalValues = {
19181 // Dimensions
19182 width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
19183 height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
19184 top: (_bbox, { top }) => parseFloat(top),
19185 left: (_bbox, { left }) => parseFloat(left),
19186 bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
19187 right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
19188 // Transform
19189 x: getTranslateFromMatrix(4, 13),
19190 y: getTranslateFromMatrix(5, 14),
19191};
19192// Alias translate longform names
19193positionalValues.translateX = positionalValues.x;
19194positionalValues.translateY = positionalValues.y;
19195
19196
19197
19198;// ./node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs
19199
19200
19201
19202const toResolve = new Set();
19203let isScheduled = false;
19204let anyNeedsMeasurement = false;
19205function measureAllKeyframes() {
19206 if (anyNeedsMeasurement) {
19207 const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);
19208 const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));
19209 const transformsToRestore = new Map();
19210 /**
19211 * Write pass
19212 * If we're measuring elements we want to remove bounding box-changing transforms.
19213 */
19214 elementsToMeasure.forEach((element) => {
19215 const removedTransforms = removeNonTranslationalTransform(element);
19216 if (!removedTransforms.length)
19217 return;
19218 transformsToRestore.set(element, removedTransforms);
19219 element.render();
19220 });
19221 // Read
19222 resolversToMeasure.forEach((resolver) => resolver.measureInitialState());
19223 // Write
19224 elementsToMeasure.forEach((element) => {
19225 element.render();
19226 const restore = transformsToRestore.get(element);
19227 if (restore) {
19228 restore.forEach(([key, value]) => {
19229 var _a;
19230 (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value);
19231 });
19232 }
19233 });
19234 // Read
19235 resolversToMeasure.forEach((resolver) => resolver.measureEndState());
19236 // Write
19237 resolversToMeasure.forEach((resolver) => {
19238 if (resolver.suspendedScrollY !== undefined) {
19239 window.scrollTo(0, resolver.suspendedScrollY);
19240 }
19241 });
19242 }
19243 anyNeedsMeasurement = false;
19244 isScheduled = false;
19245 toResolve.forEach((resolver) => resolver.complete());
19246 toResolve.clear();
19247}
19248function readAllKeyframes() {
19249 toResolve.forEach((resolver) => {
19250 resolver.readKeyframes();
19251 if (resolver.needsMeasurement) {
19252 anyNeedsMeasurement = true;
19253 }
19254 });
19255}
19256function flushKeyframeResolvers() {
19257 readAllKeyframes();
19258 measureAllKeyframes();
19259}
19260class KeyframeResolver {
19261 constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
19262 /**
19263 * Track whether this resolver has completed. Once complete, it never
19264 * needs to attempt keyframe resolution again.
19265 */
19266 this.isComplete = false;
19267 /**
19268 * Track whether this resolver is async. If it is, it'll be added to the
19269 * resolver queue and flushed in the next frame. Resolvers that aren't going
19270 * to trigger read/write thrashing don't need to be async.
19271 */
19272 this.isAsync = false;
19273 /**
19274 * Track whether this resolver needs to perform a measurement
19275 * to resolve its keyframes.
19276 */
19277 this.needsMeasurement = false;
19278 /**
19279 * Track whether this resolver is currently scheduled to resolve
19280 * to allow it to be cancelled and resumed externally.
19281 */
19282 this.isScheduled = false;
19283 this.unresolvedKeyframes = [...unresolvedKeyframes];
19284 this.onComplete = onComplete;
19285 this.name = name;
19286 this.motionValue = motionValue;
19287 this.element = element;
19288 this.isAsync = isAsync;
19289 }
19290 scheduleResolve() {
19291 this.isScheduled = true;
19292 if (this.isAsync) {
19293 toResolve.add(this);
19294 if (!isScheduled) {
19295 isScheduled = true;
19296 frame_frame.read(readAllKeyframes);
19297 frame_frame.resolveKeyframes(measureAllKeyframes);
19298 }
19299 }
19300 else {
19301 this.readKeyframes();
19302 this.complete();
19303 }
19304 }
19305 readKeyframes() {
19306 const { unresolvedKeyframes, name, element, motionValue } = this;
19307 /**
19308 * If a keyframe is null, we hydrate it either by reading it from
19309 * the instance, or propagating from previous keyframes.
19310 */
19311 for (let i = 0; i < unresolvedKeyframes.length; i++) {
19312 if (unresolvedKeyframes[i] === null) {
19313 /**
19314 * If the first keyframe is null, we need to find its value by sampling the element
19315 */
19316 if (i === 0) {
19317 const currentValue = motionValue === null || motionValue === void 0 ? void 0 : motionValue.get();
19318 const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
19319 if (currentValue !== undefined) {
19320 unresolvedKeyframes[0] = currentValue;
19321 }
19322 else if (element && name) {
19323 const valueAsRead = element.readValue(name, finalKeyframe);
19324 if (valueAsRead !== undefined && valueAsRead !== null) {
19325 unresolvedKeyframes[0] = valueAsRead;
19326 }
19327 }
19328 if (unresolvedKeyframes[0] === undefined) {
19329 unresolvedKeyframes[0] = finalKeyframe;
19330 }
19331 if (motionValue && currentValue === undefined) {
19332 motionValue.set(unresolvedKeyframes[0]);
19333 }
19334 }
19335 else {
19336 unresolvedKeyframes[i] = unresolvedKeyframes[i - 1];
19337 }
19338 }
19339 }
19340 }
19341 setFinalKeyframe() { }
19342 measureInitialState() { }
19343 renderEndStyles() { }
19344 measureEndState() { }
19345 complete() {
19346 this.isComplete = true;
19347 this.onComplete(this.unresolvedKeyframes, this.finalKeyframe);
19348 toResolve.delete(this);
19349 }
19350 cancel() {
19351 if (!this.isComplete) {
19352 this.isScheduled = false;
19353 toResolve.delete(this);
19354 }
19355 }
19356 resume() {
19357 if (!this.isComplete)
19358 this.scheduleResolve();
19359 }
19360}
19361
19362
19363
19364;// ./node_modules/motion-utils/dist/es/errors.mjs
19365
19366
19367let warning = noop_noop;
19368let errors_invariant = noop_noop;
19369if (false) {}
19370
19371
19372
19373;// ./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs
19374/**
19375 * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1"
19376 */
19377const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
19378
19379
19380
19381;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs
19382const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
19383const isCSSVariableName =
19384/*@__PURE__*/ checkStringStartsWith("--");
19385const startsAsVariableToken =
19386/*@__PURE__*/ checkStringStartsWith("var(--");
19387const isCSSVariableToken = (value) => {
19388 const startsWithToken = startsAsVariableToken(value);
19389 if (!startsWithToken)
19390 return false;
19391 // Ensure any comments are stripped from the value as this can harm performance of the regex.
19392 return singleCssVariableRegex.test(value.split("/*")[0].trim());
19393};
19394const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
19395
19396
19397
19398;// ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs
19399
19400
19401
19402
19403/**
19404 * Parse Framer's special CSS variable format into a CSS token and a fallback.
19405 *
19406 * ```
19407 * `var(--foo, #fff)` => [`--foo`, '#fff']
19408 * ```
19409 *
19410 * @param current
19411 */
19412const splitCSSVariableRegex =
19413// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
19414/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;
19415function parseCSSVariable(current) {
19416 const match = splitCSSVariableRegex.exec(current);
19417 if (!match)
19418 return [,];
19419 const [, token1, token2, fallback] = match;
19420 return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback];
19421}
19422const maxDepth = 4;
19423function getVariableValue(current, element, depth = 1) {
19424 errors_invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`);
19425 const [token, fallback] = parseCSSVariable(current);
19426 // No CSS variable detected
19427 if (!token)
19428 return;
19429 // Attempt to read this CSS variable off the element
19430 const resolved = window.getComputedStyle(element).getPropertyValue(token);
19431 if (resolved) {
19432 const trimmed = resolved.trim();
19433 return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
19434 }
19435 return isCSSVariableToken(fallback)
19436 ? getVariableValue(fallback, element, depth + 1)
19437 : fallback;
19438}
19439
19440
19441
19442;// ./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs
19443/**
19444 * Tests a provided value against a ValueType
19445 */
19446const testValueType = (v) => (type) => type.test(v);
19447
19448
19449
19450;// ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs
19451/**
19452 * ValueType for "auto"
19453 */
19454const auto = {
19455 test: (v) => v === "auto",
19456 parse: (v) => v,
19457};
19458
19459
19460
19461;// ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs
19462
19463
19464
19465
19466
19467/**
19468 * A list of value types commonly used for dimensions
19469 */
19470const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];
19471/**
19472 * Tests a dimensional value against the list of dimension ValueTypes
19473 */
19474const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));
19475
19476
19477
19478;// ./node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488class DOMKeyframesResolver extends KeyframeResolver {
19489 constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {
19490 super(unresolvedKeyframes, onComplete, name, motionValue, element, true);
19491 }
19492 readKeyframes() {
19493 const { unresolvedKeyframes, element, name } = this;
19494 if (!element || !element.current)
19495 return;
19496 super.readKeyframes();
19497 /**
19498 * If any keyframe is a CSS variable, we need to find its value by sampling the element
19499 */
19500 for (let i = 0; i < unresolvedKeyframes.length; i++) {
19501 let keyframe = unresolvedKeyframes[i];
19502 if (typeof keyframe === "string") {
19503 keyframe = keyframe.trim();
19504 if (isCSSVariableToken(keyframe)) {
19505 const resolved = getVariableValue(keyframe, element.current);
19506 if (resolved !== undefined) {
19507 unresolvedKeyframes[i] = resolved;
19508 }
19509 if (i === unresolvedKeyframes.length - 1) {
19510 this.finalKeyframe = keyframe;
19511 }
19512 }
19513 }
19514 }
19515 /**
19516 * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes.
19517 * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which
19518 * have a far bigger performance impact.
19519 */
19520 this.resolveNoneKeyframes();
19521 /**
19522 * Check to see if unit type has changed. If so schedule jobs that will
19523 * temporarily set styles to the destination keyframes.
19524 * Skip if we have more than two keyframes or this isn't a positional value.
19525 * TODO: We can throw if there are multiple keyframes and the value type changes.
19526 */
19527 if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {
19528 return;
19529 }
19530 const [origin, target] = unresolvedKeyframes;
19531 const originType = findDimensionValueType(origin);
19532 const targetType = findDimensionValueType(target);
19533 /**
19534 * Either we don't recognise these value types or we can animate between them.
19535 */
19536 if (originType === targetType)
19537 return;
19538 /**
19539 * If both values are numbers or pixels, we can animate between them by
19540 * converting them to numbers.
19541 */
19542 if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {
19543 for (let i = 0; i < unresolvedKeyframes.length; i++) {
19544 const value = unresolvedKeyframes[i];
19545 if (typeof value === "string") {
19546 unresolvedKeyframes[i] = parseFloat(value);
19547 }
19548 }
19549 }
19550 else {
19551 /**
19552 * Else, the only way to resolve this is by measuring the element.
19553 */
19554 this.needsMeasurement = true;
19555 }
19556 }
19557 resolveNoneKeyframes() {
19558 const { unresolvedKeyframes, name } = this;
19559 const noneKeyframeIndexes = [];
19560 for (let i = 0; i < unresolvedKeyframes.length; i++) {
19561 if (isNone(unresolvedKeyframes[i])) {
19562 noneKeyframeIndexes.push(i);
19563 }
19564 }
19565 if (noneKeyframeIndexes.length) {
19566 makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);
19567 }
19568 }
19569 measureInitialState() {
19570 const { element, unresolvedKeyframes, name } = this;
19571 if (!element || !element.current)
19572 return;
19573 if (name === "height") {
19574 this.suspendedScrollY = window.pageYOffset;
19575 }
19576 this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));
19577 unresolvedKeyframes[0] = this.measuredOrigin;
19578 // Set final key frame to measure after next render
19579 const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
19580 if (measureKeyframe !== undefined) {
19581 element.getValue(name, measureKeyframe).jump(measureKeyframe, false);
19582 }
19583 }
19584 measureEndState() {
19585 var _a;
19586 const { element, name, unresolvedKeyframes } = this;
19587 if (!element || !element.current)
19588 return;
19589 const value = element.getValue(name);
19590 value && value.jump(this.measuredOrigin, false);
19591 const finalKeyframeIndex = unresolvedKeyframes.length - 1;
19592 const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];
19593 unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));
19594 if (finalKeyframe !== null && this.finalKeyframe === undefined) {
19595 this.finalKeyframe = finalKeyframe;
19596 }
19597 // If we removed transform values, reapply them before the next render
19598 if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {
19599 this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {
19600 element
19601 .getValue(unsetTransformName)
19602 .set(unsetTransformValue);
19603 });
19604 }
19605 this.resolveNoneKeyframes();
19606 }
19607}
19608
19609
19610
19611;// ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs
19612
19613
19614/**
19615 * Check if a value is animatable. Examples:
19616 *
19617 * ✅: 100, "100px", "#fff"
19618 * ❌: "block", "url(2.jpg)"
19619 * @param value
19620 *
19621 * @internal
19622 */
19623const isAnimatable = (value, name) => {
19624 // If the list of keys tat might be non-animatable grows, replace with Set
19625 if (name === "zIndex")
19626 return false;
19627 // If it's a number or a keyframes array, we can animate it. We might at some point
19628 // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,
19629 // but for now lets leave it like this for performance reasons
19630 if (typeof value === "number" || Array.isArray(value))
19631 return true;
19632 if (typeof value === "string" && // It's animatable if we have a string
19633 (complex.test(value) || value === "0") && // And it contains numbers and/or colors
19634 !value.startsWith("url(") // Unless it starts with "url("
19635 ) {
19636 return true;
19637 }
19638 return false;
19639};
19640
19641
19642
19643;// ./node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs
19644
19645
19646
19647
19648function hasKeyframesChanged(keyframes) {
19649 const current = keyframes[0];
19650 if (keyframes.length === 1)
19651 return true;
19652 for (let i = 0; i < keyframes.length; i++) {
19653 if (keyframes[i] !== current)
19654 return true;
19655 }
19656}
19657function canAnimate(keyframes, name, type, velocity) {
19658 /**
19659 * Check if we're able to animate between the start and end keyframes,
19660 * and throw a warning if we're attempting to animate between one that's
19661 * animatable and another that isn't.
19662 */
19663 const originKeyframe = keyframes[0];
19664 if (originKeyframe === null)
19665 return false;
19666 /**
19667 * These aren't traditionally animatable but we do support them.
19668 * In future we could look into making this more generic or replacing
19669 * this function with mix() === mixImmediate
19670 */
19671 if (name === "display" || name === "visibility")
19672 return true;
19673 const targetKeyframe = keyframes[keyframes.length - 1];
19674 const isOriginAnimatable = isAnimatable(originKeyframe, name);
19675 const isTargetAnimatable = isAnimatable(targetKeyframe, name);
19676 warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`);
19677 // Always skip if any of these are true
19678 if (!isOriginAnimatable || !isTargetAnimatable) {
19679 return false;
19680 }
19681 return (hasKeyframesChanged(keyframes) ||
19682 ((type === "spring" || isGenerator(type)) && velocity));
19683}
19684
19685
19686
19687;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs
19688const isNotNull = (value) => value !== null;
19689function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) {
19690 const resolvedKeyframes = keyframes.filter(isNotNull);
19691 const index = repeat && repeatType !== "loop" && repeat % 2 === 1
19692 ? 0
19693 : resolvedKeyframes.length - 1;
19694 return !index || finalKeyframe === undefined
19695 ? resolvedKeyframes[index]
19696 : finalKeyframe;
19697}
19698
19699
19700
19701;// ./node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs
19702
19703
19704
19705
19706
19707
19708/**
19709 * Maximum time allowed between an animation being created and it being
19710 * resolved for us to use the latter as the start time.
19711 *
19712 * This is to ensure that while we prefer to "start" an animation as soon
19713 * as it's triggered, we also want to avoid a visual jump if there's a big delay
19714 * between these two moments.
19715 */
19716const MAX_RESOLVE_DELAY = 40;
19717class BaseAnimation {
19718 constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", ...options }) {
19719 // Track whether the animation has been stopped. Stopped animations won't restart.
19720 this.isStopped = false;
19721 this.hasAttemptedResolve = false;
19722 this.createdAt = time.now();
19723 this.options = {
19724 autoplay,
19725 delay,
19726 type,
19727 repeat,
19728 repeatDelay,
19729 repeatType,
19730 ...options,
19731 };
19732 this.updateFinishedPromise();
19733 }
19734 /**
19735 * This method uses the createdAt and resolvedAt to calculate the
19736 * animation startTime. *Ideally*, we would use the createdAt time as t=0
19737 * as the following frame would then be the first frame of the animation in
19738 * progress, which would feel snappier.
19739 *
19740 * However, if there's a delay (main thread work) between the creation of
19741 * the animation and the first commited frame, we prefer to use resolvedAt
19742 * to avoid a sudden jump into the animation.
19743 */
19744 calcStartTime() {
19745 if (!this.resolvedAt)
19746 return this.createdAt;
19747 return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY
19748 ? this.resolvedAt
19749 : this.createdAt;
19750 }
19751 /**
19752 * A getter for resolved data. If keyframes are not yet resolved, accessing
19753 * this.resolved will synchronously flush all pending keyframe resolvers.
19754 * This is a deoptimisation, but at its worst still batches read/writes.
19755 */
19756 get resolved() {
19757 if (!this._resolved && !this.hasAttemptedResolve) {
19758 flushKeyframeResolvers();
19759 }
19760 return this._resolved;
19761 }
19762 /**
19763 * A method to be called when the keyframes resolver completes. This method
19764 * will check if its possible to run the animation and, if not, skip it.
19765 * Otherwise, it will call initPlayback on the implementing class.
19766 */
19767 onKeyframesResolved(keyframes, finalKeyframe) {
19768 this.resolvedAt = time.now();
19769 this.hasAttemptedResolve = true;
19770 const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;
19771 /**
19772 * If we can't animate this value with the resolved keyframes
19773 * then we should complete it immediately.
19774 */
19775 if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {
19776 // Finish immediately
19777 if (instantAnimationState.current || !delay) {
19778 onUpdate &&
19779 onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));
19780 onComplete && onComplete();
19781 this.resolveFinishedPromise();
19782 return;
19783 }
19784 // Finish after a delay
19785 else {
19786 this.options.duration = 0;
19787 }
19788 }
19789 const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);
19790 if (resolvedAnimation === false)
19791 return;
19792 this._resolved = {
19793 keyframes,
19794 finalKeyframe,
19795 ...resolvedAnimation,
19796 };
19797 this.onPostResolved();
19798 }
19799 onPostResolved() { }
19800 /**
19801 * Allows the returned animation to be awaited or promise-chained. Currently
19802 * resolves when the animation finishes at all but in a future update could/should
19803 * reject if its cancels.
19804 */
19805 then(resolve, reject) {
19806 return this.currentFinishedPromise.then(resolve, reject);
19807 }
19808 flatten() {
19809 this.options.type = "keyframes";
19810 this.options.ease = "linear";
19811 }
19812 updateFinishedPromise() {
19813 this.currentFinishedPromise = new Promise((resolve) => {
19814 this.resolveFinishedPromise = resolve;
19815 });
19816 }
19817}
19818
19819
19820
19821;// ./node_modules/framer-motion/dist/es/utils/mix/number.mjs
19822/*
19823 Value in range from progress
19824
19825 Given a lower limit and an upper limit, we return the value within
19826 that range as expressed by progress (usually a number from 0 to 1)
19827
19828 So progress = 0.5 would change
19829
19830 from -------- to
19831
19832 to
19833
19834 from ---- to
19835
19836 E.g. from = 10, to = 20, progress = 0.5 => 15
19837
19838 @param [number]: Lower limit of range
19839 @param [number]: Upper limit of range
19840 @param [number]: The progress between lower and upper limits expressed 0-1
19841 @return [number]: Value as calculated from progress within range (not limited within range)
19842*/
19843const mixNumber = (from, to, progress) => {
19844 return from + (to - from) * progress;
19845};
19846
19847
19848
19849;// ./node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs
19850// Adapted from https://gist.github.com/mjackson/5311256
19851function hueToRgb(p, q, t) {
19852 if (t < 0)
19853 t += 1;
19854 if (t > 1)
19855 t -= 1;
19856 if (t < 1 / 6)
19857 return p + (q - p) * 6 * t;
19858 if (t < 1 / 2)
19859 return q;
19860 if (t < 2 / 3)
19861 return p + (q - p) * (2 / 3 - t) * 6;
19862 return p;
19863}
19864function hslaToRgba({ hue, saturation, lightness, alpha }) {
19865 hue /= 360;
19866 saturation /= 100;
19867 lightness /= 100;
19868 let red = 0;
19869 let green = 0;
19870 let blue = 0;
19871 if (!saturation) {
19872 red = green = blue = lightness;
19873 }
19874 else {
19875 const q = lightness < 0.5
19876 ? lightness * (1 + saturation)
19877 : lightness + saturation - lightness * saturation;
19878 const p = 2 * lightness - q;
19879 red = hueToRgb(p, q, hue + 1 / 3);
19880 green = hueToRgb(p, q, hue);
19881 blue = hueToRgb(p, q, hue - 1 / 3);
19882 }
19883 return {
19884 red: Math.round(red * 255),
19885 green: Math.round(green * 255),
19886 blue: Math.round(blue * 255),
19887 alpha,
19888 };
19889}
19890
19891
19892
19893;// ./node_modules/framer-motion/dist/es/utils/mix/immediate.mjs
19894function mixImmediate(a, b) {
19895 return (p) => (p > 0 ? b : a);
19896}
19897
19898
19899
19900;// ./node_modules/framer-motion/dist/es/utils/mix/color.mjs
19901
19902
19903
19904
19905
19906
19907
19908
19909// Linear color space blending
19910// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw
19911// Demonstrated http://codepen.io/osublake/pen/xGVVaN
19912const mixLinearColor = (from, to, v) => {
19913 const fromExpo = from * from;
19914 const expo = v * (to * to - fromExpo) + fromExpo;
19915 return expo < 0 ? 0 : Math.sqrt(expo);
19916};
19917const colorTypes = [hex, rgba, hsla];
19918const getColorType = (v) => colorTypes.find((type) => type.test(v));
19919function asRGBA(color) {
19920 const type = getColorType(color);
19921 warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);
19922 if (!Boolean(type))
19923 return false;
19924 let model = type.parse(color);
19925 if (type === hsla) {
19926 // TODO Remove this cast - needed since Motion's stricter typing
19927 model = hslaToRgba(model);
19928 }
19929 return model;
19930}
19931const mixColor = (from, to) => {
19932 const fromRGBA = asRGBA(from);
19933 const toRGBA = asRGBA(to);
19934 if (!fromRGBA || !toRGBA) {
19935 return mixImmediate(from, to);
19936 }
19937 const blended = { ...fromRGBA };
19938 return (v) => {
19939 blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
19940 blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
19941 blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
19942 blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);
19943 return rgba.transform(blended);
19944 };
19945};
19946
19947
19948
19949;// ./node_modules/framer-motion/dist/es/utils/pipe.mjs
19950/**
19951 * Pipe
19952 * Compose other transformers to run linearily
19953 * pipe(min(20), max(40))
19954 * @param {...functions} transformers
19955 * @return {function}
19956 */
19957const combineFunctions = (a, b) => (v) => b(a(v));
19958const pipe = (...transformers) => transformers.reduce(combineFunctions);
19959
19960
19961
19962;// ./node_modules/framer-motion/dist/es/utils/mix/visibility.mjs
19963const invisibleValues = new Set(["none", "hidden"]);
19964/**
19965 * Returns a function that, when provided a progress value between 0 and 1,
19966 * will return the "none" or "hidden" string only when the progress is that of
19967 * the origin or target.
19968 */
19969function mixVisibility(origin, target) {
19970 if (invisibleValues.has(origin)) {
19971 return (p) => (p <= 0 ? origin : target);
19972 }
19973 else {
19974 return (p) => (p >= 1 ? target : origin);
19975 }
19976}
19977
19978
19979
19980;// ./node_modules/framer-motion/dist/es/utils/mix/complex.mjs
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991function complex_mixNumber(a, b) {
19992 return (p) => mixNumber(a, b, p);
19993}
19994function getMixer(a) {
19995 if (typeof a === "number") {
19996 return complex_mixNumber;
19997 }
19998 else if (typeof a === "string") {
19999 return isCSSVariableToken(a)
20000 ? mixImmediate
20001 : color.test(a)
20002 ? mixColor
20003 : mixComplex;
20004 }
20005 else if (Array.isArray(a)) {
20006 return mixArray;
20007 }
20008 else if (typeof a === "object") {
20009 return color.test(a) ? mixColor : mixObject;
20010 }
20011 return mixImmediate;
20012}
20013function mixArray(a, b) {
20014 const output = [...a];
20015 const numValues = output.length;
20016 const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));
20017 return (p) => {
20018 for (let i = 0; i < numValues; i++) {
20019 output[i] = blendValue[i](p);
20020 }
20021 return output;
20022 };
20023}
20024function mixObject(a, b) {
20025 const output = { ...a, ...b };
20026 const blendValue = {};
20027 for (const key in output) {
20028 if (a[key] !== undefined && b[key] !== undefined) {
20029 blendValue[key] = getMixer(a[key])(a[key], b[key]);
20030 }
20031 }
20032 return (v) => {
20033 for (const key in blendValue) {
20034 output[key] = blendValue[key](v);
20035 }
20036 return output;
20037 };
20038}
20039function matchOrder(origin, target) {
20040 var _a;
20041 const orderedOrigin = [];
20042 const pointers = { color: 0, var: 0, number: 0 };
20043 for (let i = 0; i < target.values.length; i++) {
20044 const type = target.types[i];
20045 const originIndex = origin.indexes[type][pointers[type]];
20046 const originValue = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 0;
20047 orderedOrigin[i] = originValue;
20048 pointers[type]++;
20049 }
20050 return orderedOrigin;
20051}
20052const mixComplex = (origin, target) => {
20053 const template = complex.createTransformer(target);
20054 const originStats = analyseComplexValue(origin);
20055 const targetStats = analyseComplexValue(target);
20056 const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&
20057 originStats.indexes.color.length === targetStats.indexes.color.length &&
20058 originStats.indexes.number.length >= targetStats.indexes.number.length;
20059 if (canInterpolate) {
20060 if ((invisibleValues.has(origin) &&
20061 !targetStats.values.length) ||
20062 (invisibleValues.has(target) &&
20063 !originStats.values.length)) {
20064 return mixVisibility(origin, target);
20065 }
20066 return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
20067 }
20068 else {
20069 warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
20070 return mixImmediate(origin, target);
20071 }
20072};
20073
20074
20075
20076;// ./node_modules/framer-motion/dist/es/utils/mix/index.mjs
20077
20078
20079
20080function mix(from, to, p) {
20081 if (typeof from === "number" &&
20082 typeof to === "number" &&
20083 typeof p === "number") {
20084 return mixNumber(from, to, p);
20085 }
20086 const mixer = getMixer(from);
20087 return mixer(from, to);
20088}
20089
20090
20091
20092;// ./node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs
20093
20094
20095const velocitySampleDuration = 5; // ms
20096function calcGeneratorVelocity(resolveValue, t, current) {
20097 const prevT = Math.max(t - velocitySampleDuration, 0);
20098 return velocityPerSecond(current - resolveValue(prevT), t - prevT);
20099}
20100
20101
20102
20103;// ./node_modules/framer-motion/dist/es/animation/generators/spring/defaults.mjs
20104const springDefaults = {
20105 // Default spring physics
20106 stiffness: 100,
20107 damping: 10,
20108 mass: 1.0,
20109 velocity: 0.0,
20110 // Default duration/bounce-based options
20111 duration: 800, // in ms
20112 bounce: 0.3,
20113 visualDuration: 0.3, // in seconds
20114 // Rest thresholds
20115 restSpeed: {
20116 granular: 0.01,
20117 default: 2,
20118 },
20119 restDelta: {
20120 granular: 0.005,
20121 default: 0.5,
20122 },
20123 // Limits
20124 minDuration: 0.01, // in seconds
20125 maxDuration: 10.0, // in seconds
20126 minDamping: 0.05,
20127 maxDamping: 1,
20128};
20129
20130
20131
20132;// ./node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs
20133
20134
20135
20136
20137const safeMin = 0.001;
20138function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
20139 let envelope;
20140 let derivative;
20141 warning(duration <= time_conversion_secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
20142 let dampingRatio = 1 - bounce;
20143 /**
20144 * Restrict dampingRatio and duration to within acceptable ranges.
20145 */
20146 dampingRatio = clamp_clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
20147 duration = clamp_clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));
20148 if (dampingRatio < 1) {
20149 /**
20150 * Underdamped spring
20151 */
20152 envelope = (undampedFreq) => {
20153 const exponentialDecay = undampedFreq * dampingRatio;
20154 const delta = exponentialDecay * duration;
20155 const a = exponentialDecay - velocity;
20156 const b = calcAngularFreq(undampedFreq, dampingRatio);
20157 const c = Math.exp(-delta);
20158 return safeMin - (a / b) * c;
20159 };
20160 derivative = (undampedFreq) => {
20161 const exponentialDecay = undampedFreq * dampingRatio;
20162 const delta = exponentialDecay * duration;
20163 const d = delta * velocity + velocity;
20164 const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
20165 const f = Math.exp(-delta);
20166 const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
20167 const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
20168 return (factor * ((d - e) * f)) / g;
20169 };
20170 }
20171 else {
20172 /**
20173 * Critically-damped spring
20174 */
20175 envelope = (undampedFreq) => {
20176 const a = Math.exp(-undampedFreq * duration);
20177 const b = (undampedFreq - velocity) * duration + 1;
20178 return -safeMin + a * b;
20179 };
20180 derivative = (undampedFreq) => {
20181 const a = Math.exp(-undampedFreq * duration);
20182 const b = (velocity - undampedFreq) * (duration * duration);
20183 return a * b;
20184 };
20185 }
20186 const initialGuess = 5 / duration;
20187 const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
20188 duration = time_conversion_secondsToMilliseconds(duration);
20189 if (isNaN(undampedFreq)) {
20190 return {
20191 stiffness: springDefaults.stiffness,
20192 damping: springDefaults.damping,
20193 duration,
20194 };
20195 }
20196 else {
20197 const stiffness = Math.pow(undampedFreq, 2) * mass;
20198 return {
20199 stiffness,
20200 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
20201 duration,
20202 };
20203 }
20204}
20205const rootIterations = 12;
20206function approximateRoot(envelope, derivative, initialGuess) {
20207 let result = initialGuess;
20208 for (let i = 1; i < rootIterations; i++) {
20209 result = result - envelope(result) / derivative(result);
20210 }
20211 return result;
20212}
20213function calcAngularFreq(undampedFreq, dampingRatio) {
20214 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
20215}
20216
20217
20218
20219;// ./node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs
20220
20221
20222
20223
20224
20225
20226
20227const durationKeys = ["duration", "bounce"];
20228const physicsKeys = ["stiffness", "damping", "mass"];
20229function isSpringType(options, keys) {
20230 return keys.some((key) => options[key] !== undefined);
20231}
20232function getSpringOptions(options) {
20233 let springOptions = {
20234 velocity: springDefaults.velocity,
20235 stiffness: springDefaults.stiffness,
20236 damping: springDefaults.damping,
20237 mass: springDefaults.mass,
20238 isResolvedFromDuration: false,
20239 ...options,
20240 };
20241 // stiffness/damping/mass overrides duration/bounce
20242 if (!isSpringType(options, physicsKeys) &&
20243 isSpringType(options, durationKeys)) {
20244 if (options.visualDuration) {
20245 const visualDuration = options.visualDuration;
20246 const root = (2 * Math.PI) / (visualDuration * 1.2);
20247 const stiffness = root * root;
20248 const damping = 2 *
20249 clamp_clamp(0.05, 1, 1 - (options.bounce || 0)) *
20250 Math.sqrt(stiffness);
20251 springOptions = {
20252 ...springOptions,
20253 mass: springDefaults.mass,
20254 stiffness,
20255 damping,
20256 };
20257 }
20258 else {
20259 const derived = findSpring(options);
20260 springOptions = {
20261 ...springOptions,
20262 ...derived,
20263 mass: springDefaults.mass,
20264 };
20265 springOptions.isResolvedFromDuration = true;
20266 }
20267 }
20268 return springOptions;
20269}
20270function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {
20271 const options = typeof optionsOrVisualDuration !== "object"
20272 ? {
20273 visualDuration: optionsOrVisualDuration,
20274 keyframes: [0, 1],
20275 bounce,
20276 }
20277 : optionsOrVisualDuration;
20278 let { restSpeed, restDelta } = options;
20279 const origin = options.keyframes[0];
20280 const target = options.keyframes[options.keyframes.length - 1];
20281 /**
20282 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
20283 * to reduce GC during animation.
20284 */
20285 const state = { done: false, value: origin };
20286 const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({
20287 ...options,
20288 velocity: -millisecondsToSeconds(options.velocity || 0),
20289 });
20290 const initialVelocity = velocity || 0.0;
20291 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
20292 const initialDelta = target - origin;
20293 const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));
20294 /**
20295 * If we're working on a granular scale, use smaller defaults for determining
20296 * when the spring is finished.
20297 *
20298 * These defaults have been selected emprically based on what strikes a good
20299 * ratio between feeling good and finishing as soon as changes are imperceptible.
20300 */
20301 const isGranularScale = Math.abs(initialDelta) < 5;
20302 restSpeed || (restSpeed = isGranularScale
20303 ? springDefaults.restSpeed.granular
20304 : springDefaults.restSpeed.default);
20305 restDelta || (restDelta = isGranularScale
20306 ? springDefaults.restDelta.granular
20307 : springDefaults.restDelta.default);
20308 let resolveSpring;
20309 if (dampingRatio < 1) {
20310 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
20311 // Underdamped spring
20312 resolveSpring = (t) => {
20313 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
20314 return (target -
20315 envelope *
20316 (((initialVelocity +
20317 dampingRatio * undampedAngularFreq * initialDelta) /
20318 angularFreq) *
20319 Math.sin(angularFreq * t) +
20320 initialDelta * Math.cos(angularFreq * t)));
20321 };
20322 }
20323 else if (dampingRatio === 1) {
20324 // Critically damped spring
20325 resolveSpring = (t) => target -
20326 Math.exp(-undampedAngularFreq * t) *
20327 (initialDelta +
20328 (initialVelocity + undampedAngularFreq * initialDelta) * t);
20329 }
20330 else {
20331 // Overdamped spring
20332 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
20333 resolveSpring = (t) => {
20334 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
20335 // When performing sinh or cosh values can hit Infinity so we cap them here
20336 const freqForT = Math.min(dampedAngularFreq * t, 300);
20337 return (target -
20338 (envelope *
20339 ((initialVelocity +
20340 dampingRatio * undampedAngularFreq * initialDelta) *
20341 Math.sinh(freqForT) +
20342 dampedAngularFreq *
20343 initialDelta *
20344 Math.cosh(freqForT))) /
20345 dampedAngularFreq);
20346 };
20347 }
20348 const generator = {
20349 calculatedDuration: isResolvedFromDuration ? duration || null : null,
20350 next: (t) => {
20351 const current = resolveSpring(t);
20352 if (!isResolvedFromDuration) {
20353 let currentVelocity = 0.0;
20354 /**
20355 * We only need to calculate velocity for under-damped springs
20356 * as over- and critically-damped springs can't overshoot, so
20357 * checking only for displacement is enough.
20358 */
20359 if (dampingRatio < 1) {
20360 currentVelocity =
20361 t === 0
20362 ? time_conversion_secondsToMilliseconds(initialVelocity)
20363 : calcGeneratorVelocity(resolveSpring, t, current);
20364 }
20365 const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
20366 const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
20367 state.done =
20368 isBelowVelocityThreshold && isBelowDisplacementThreshold;
20369 }
20370 else {
20371 state.done = t >= duration;
20372 }
20373 state.value = state.done ? target : current;
20374 return state;
20375 },
20376 toString: () => {
20377 const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
20378 const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);
20379 return calculatedDuration + "ms " + easing;
20380 },
20381 };
20382 return generator;
20383}
20384
20385
20386
20387;// ./node_modules/framer-motion/dist/es/animation/generators/inertia.mjs
20388
20389
20390
20391function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {
20392 const origin = keyframes[0];
20393 const state = {
20394 done: false,
20395 value: origin,
20396 };
20397 const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);
20398 const nearestBoundary = (v) => {
20399 if (min === undefined)
20400 return max;
20401 if (max === undefined)
20402 return min;
20403 return Math.abs(min - v) < Math.abs(max - v) ? min : max;
20404 };
20405 let amplitude = power * velocity;
20406 const ideal = origin + amplitude;
20407 const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);
20408 /**
20409 * If the target has changed we need to re-calculate the amplitude, otherwise
20410 * the animation will start from the wrong position.
20411 */
20412 if (target !== ideal)
20413 amplitude = target - origin;
20414 const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);
20415 const calcLatest = (t) => target + calcDelta(t);
20416 const applyFriction = (t) => {
20417 const delta = calcDelta(t);
20418 const latest = calcLatest(t);
20419 state.done = Math.abs(delta) <= restDelta;
20420 state.value = state.done ? target : latest;
20421 };
20422 /**
20423 * Ideally this would resolve for t in a stateless way, we could
20424 * do that by always precalculating the animation but as we know
20425 * this will be done anyway we can assume that spring will
20426 * be discovered during that.
20427 */
20428 let timeReachedBoundary;
20429 let spring$1;
20430 const checkCatchBoundary = (t) => {
20431 if (!isOutOfBounds(state.value))
20432 return;
20433 timeReachedBoundary = t;
20434 spring$1 = spring({
20435 keyframes: [state.value, nearestBoundary(state.value)],
20436 velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000
20437 damping: bounceDamping,
20438 stiffness: bounceStiffness,
20439 restDelta,
20440 restSpeed,
20441 });
20442 };
20443 checkCatchBoundary(0);
20444 return {
20445 calculatedDuration: null,
20446 next: (t) => {
20447 /**
20448 * We need to resolve the friction to figure out if we need a
20449 * spring but we don't want to do this twice per frame. So here
20450 * we flag if we updated for this frame and later if we did
20451 * we can skip doing it again.
20452 */
20453 let hasUpdatedFrame = false;
20454 if (!spring$1 && timeReachedBoundary === undefined) {
20455 hasUpdatedFrame = true;
20456 applyFriction(t);
20457 checkCatchBoundary(t);
20458 }
20459 /**
20460 * If we have a spring and the provided t is beyond the moment the friction
20461 * animation crossed the min/max boundary, use the spring.
20462 */
20463 if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {
20464 return spring$1.next(t - timeReachedBoundary);
20465 }
20466 else {
20467 !hasUpdatedFrame && applyFriction(t);
20468 return state;
20469 }
20470 },
20471 };
20472}
20473
20474
20475
20476;// ./node_modules/framer-motion/dist/es/easing/ease.mjs
20477
20478
20479const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);
20480const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);
20481const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);
20482
20483
20484
20485;// ./node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs
20486const isEasingArray = (ease) => {
20487 return Array.isArray(ease) && typeof ease[0] !== "number";
20488};
20489
20490
20491
20492;// ./node_modules/framer-motion/dist/es/easing/utils/map.mjs
20493
20494
20495
20496
20497
20498
20499
20500
20501const easingLookup = {
20502 linear: noop_noop,
20503 easeIn: easeIn,
20504 easeInOut: easeInOut,
20505 easeOut: easeOut,
20506 circIn: circIn,
20507 circInOut: circInOut,
20508 circOut: circOut,
20509 backIn: backIn,
20510 backInOut: backInOut,
20511 backOut: backOut,
20512 anticipate: anticipate,
20513};
20514const easingDefinitionToFunction = (definition) => {
20515 if (isBezierDefinition(definition)) {
20516 // If cubic bezier definition, create bezier curve
20517 errors_invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
20518 const [x1, y1, x2, y2] = definition;
20519 return cubicBezier(x1, y1, x2, y2);
20520 }
20521 else if (typeof definition === "string") {
20522 // Else lookup from table
20523 errors_invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);
20524 return easingLookup[definition];
20525 }
20526 return definition;
20527};
20528
20529
20530
20531;// ./node_modules/framer-motion/dist/es/utils/interpolate.mjs
20532
20533
20534
20535
20536
20537function createMixers(output, ease, customMixer) {
20538 const mixers = [];
20539 const mixerFactory = customMixer || mix;
20540 const numMixers = output.length - 1;
20541 for (let i = 0; i < numMixers; i++) {
20542 let mixer = mixerFactory(output[i], output[i + 1]);
20543 if (ease) {
20544 const easingFunction = Array.isArray(ease) ? ease[i] || noop_noop : ease;
20545 mixer = pipe(easingFunction, mixer);
20546 }
20547 mixers.push(mixer);
20548 }
20549 return mixers;
20550}
20551/**
20552 * Create a function that maps from a numerical input array to a generic output array.
20553 *
20554 * Accepts:
20555 * - Numbers
20556 * - Colors (hex, hsl, hsla, rgb, rgba)
20557 * - Complex (combinations of one or more numbers or strings)
20558 *
20559 * ```jsx
20560 * const mixColor = interpolate([0, 1], ['#fff', '#000'])
20561 *
20562 * mixColor(0.5) // 'rgba(128, 128, 128, 1)'
20563 * ```
20564 *
20565 * TODO Revist this approach once we've moved to data models for values,
20566 * probably not needed to pregenerate mixer functions.
20567 *
20568 * @public
20569 */
20570function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
20571 const inputLength = input.length;
20572 errors_invariant(inputLength === output.length, "Both input and output ranges must be the same length");
20573 /**
20574 * If we're only provided a single input, we can just make a function
20575 * that returns the output.
20576 */
20577 if (inputLength === 1)
20578 return () => output[0];
20579 if (inputLength === 2 && output[0] === output[1])
20580 return () => output[1];
20581 const isZeroDeltaRange = input[0] === input[1];
20582 // If input runs highest -> lowest, reverse both arrays
20583 if (input[0] > input[inputLength - 1]) {
20584 input = [...input].reverse();
20585 output = [...output].reverse();
20586 }
20587 const mixers = createMixers(output, ease, mixer);
20588 const numMixers = mixers.length;
20589 const interpolator = (v) => {
20590 if (isZeroDeltaRange && v < input[0])
20591 return output[0];
20592 let i = 0;
20593 if (numMixers > 1) {
20594 for (; i < input.length - 2; i++) {
20595 if (v < input[i + 1])
20596 break;
20597 }
20598 }
20599 const progressInRange = progress(input[i], input[i + 1], v);
20600 return mixers[i](progressInRange);
20601 };
20602 return isClamp
20603 ? (v) => interpolator(clamp_clamp(input[0], input[inputLength - 1], v))
20604 : interpolator;
20605}
20606
20607
20608
20609;// ./node_modules/framer-motion/dist/es/utils/offsets/fill.mjs
20610
20611
20612
20613function fillOffset(offset, remaining) {
20614 const min = offset[offset.length - 1];
20615 for (let i = 1; i <= remaining; i++) {
20616 const offsetProgress = progress(0, remaining, i);
20617 offset.push(mixNumber(min, 1, offsetProgress));
20618 }
20619}
20620
20621
20622
20623;// ./node_modules/framer-motion/dist/es/utils/offsets/default.mjs
20624
20625
20626function defaultOffset(arr) {
20627 const offset = [0];
20628 fillOffset(offset, arr.length - 1);
20629 return offset;
20630}
20631
20632
20633
20634;// ./node_modules/framer-motion/dist/es/utils/offsets/time.mjs
20635function convertOffsetToTimes(offset, duration) {
20636 return offset.map((o) => o * duration);
20637}
20638
20639
20640
20641;// ./node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs
20642
20643
20644
20645
20646
20647
20648
20649function keyframes_defaultEasing(values, easing) {
20650 return values.map(() => easing || easeInOut).splice(0, values.length - 1);
20651}
20652function keyframes_keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) {
20653 /**
20654 * Easing functions can be externally defined as strings. Here we convert them
20655 * into actual functions.
20656 */
20657 const easingFunctions = isEasingArray(ease)
20658 ? ease.map(easingDefinitionToFunction)
20659 : easingDefinitionToFunction(ease);
20660 /**
20661 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
20662 * to reduce GC during animation.
20663 */
20664 const state = {
20665 done: false,
20666 value: keyframeValues[0],
20667 };
20668 /**
20669 * Create a times array based on the provided 0-1 offsets
20670 */
20671 const absoluteTimes = convertOffsetToTimes(
20672 // Only use the provided offsets if they're the correct length
20673 // TODO Maybe we should warn here if there's a length mismatch
20674 times && times.length === keyframeValues.length
20675 ? times
20676 : defaultOffset(keyframeValues), duration);
20677 const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {
20678 ease: Array.isArray(easingFunctions)
20679 ? easingFunctions
20680 : keyframes_defaultEasing(keyframeValues, easingFunctions),
20681 });
20682 return {
20683 calculatedDuration: duration,
20684 next: (t) => {
20685 state.value = mapTimeToKeyframe(t);
20686 state.done = t >= duration;
20687 return state;
20688 },
20689 };
20690}
20691
20692
20693
20694;// ./node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs
20695
20696
20697
20698const frameloopDriver = (update) => {
20699 const passTimestamp = ({ timestamp }) => update(timestamp);
20700 return {
20701 start: () => frame_frame.update(passTimestamp, true),
20702 stop: () => cancelFrame(passTimestamp),
20703 /**
20704 * If we're processing this frame we can use the
20705 * framelocked timestamp to keep things in sync.
20706 */
20707 now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
20708 };
20709};
20710
20711
20712
20713;// ./node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727const generators = {
20728 decay: inertia,
20729 inertia: inertia,
20730 tween: keyframes_keyframes,
20731 keyframes: keyframes_keyframes,
20732 spring: spring,
20733};
20734const percentToProgress = (percent) => percent / 100;
20735/**
20736 * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of
20737 * features we expose publically. Mostly the compatibility is to ensure visual identity
20738 * between both WAAPI and main thread animations.
20739 */
20740class MainThreadAnimation extends BaseAnimation {
20741 constructor(options) {
20742 super(options);
20743 /**
20744 * The time at which the animation was paused.
20745 */
20746 this.holdTime = null;
20747 /**
20748 * The time at which the animation was cancelled.
20749 */
20750 this.cancelTime = null;
20751 /**
20752 * The current time of the animation.
20753 */
20754 this.currentTime = 0;
20755 /**
20756 * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
20757 */
20758 this.playbackSpeed = 1;
20759 /**
20760 * The state of the animation to apply when the animation is resolved. This
20761 * allows calls to the public API to control the animation before it is resolved,
20762 * without us having to resolve it first.
20763 */
20764 this.pendingPlayState = "running";
20765 /**
20766 * The time at which the animation was started.
20767 */
20768 this.startTime = null;
20769 this.state = "idle";
20770 /**
20771 * This method is bound to the instance to fix a pattern where
20772 * animation.stop is returned as a reference from a useEffect.
20773 */
20774 this.stop = () => {
20775 this.resolver.cancel();
20776 this.isStopped = true;
20777 if (this.state === "idle")
20778 return;
20779 this.teardown();
20780 const { onStop } = this.options;
20781 onStop && onStop();
20782 };
20783 const { name, motionValue, element, keyframes } = this.options;
20784 const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver;
20785 const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
20786 this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);
20787 this.resolver.scheduleResolve();
20788 }
20789 flatten() {
20790 super.flatten();
20791 // If we've already resolved the animation, re-initialise it
20792 if (this._resolved) {
20793 Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
20794 }
20795 }
20796 initPlayback(keyframes$1) {
20797 const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;
20798 const generatorFactory = isGenerator(type)
20799 ? type
20800 : generators[type] || keyframes_keyframes;
20801 /**
20802 * If our generator doesn't support mixing numbers, we need to replace keyframes with
20803 * [0, 100] and then make a function that maps that to the actual keyframes.
20804 *
20805 * 100 is chosen instead of 1 as it works nicer with spring animations.
20806 */
20807 let mapPercentToKeyframes;
20808 let mirroredGenerator;
20809 if (generatorFactory !== keyframes_keyframes &&
20810 typeof keyframes$1[0] !== "number") {
20811 if (false) {}
20812 mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
20813 keyframes$1 = [0, 100];
20814 }
20815 const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });
20816 /**
20817 * If we have a mirror repeat type we need to create a second generator that outputs the
20818 * mirrored (not reversed) animation and later ping pong between the two generators.
20819 */
20820 if (repeatType === "mirror") {
20821 mirroredGenerator = generatorFactory({
20822 ...this.options,
20823 keyframes: [...keyframes$1].reverse(),
20824 velocity: -velocity,
20825 });
20826 }
20827 /**
20828 * If duration is undefined and we have repeat options,
20829 * we need to calculate a duration from the generator.
20830 *
20831 * We set it to the generator itself to cache the duration.
20832 * Any timeline resolver will need to have already precalculated
20833 * the duration by this step.
20834 */
20835 if (generator.calculatedDuration === null) {
20836 generator.calculatedDuration = calcGeneratorDuration(generator);
20837 }
20838 const { calculatedDuration } = generator;
20839 const resolvedDuration = calculatedDuration + repeatDelay;
20840 const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;
20841 return {
20842 generator,
20843 mirroredGenerator,
20844 mapPercentToKeyframes,
20845 calculatedDuration,
20846 resolvedDuration,
20847 totalDuration,
20848 };
20849 }
20850 onPostResolved() {
20851 const { autoplay = true } = this.options;
20852 this.play();
20853 if (this.pendingPlayState === "paused" || !autoplay) {
20854 this.pause();
20855 }
20856 else {
20857 this.state = this.pendingPlayState;
20858 }
20859 }
20860 tick(timestamp, sample = false) {
20861 const { resolved } = this;
20862 // If the animations has failed to resolve, return the final keyframe.
20863 if (!resolved) {
20864 const { keyframes } = this.options;
20865 return { done: true, value: keyframes[keyframes.length - 1] };
20866 }
20867 const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;
20868 if (this.startTime === null)
20869 return generator.next(0);
20870 const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;
20871 /**
20872 * requestAnimationFrame timestamps can come through as lower than
20873 * the startTime as set by performance.now(). Here we prevent this,
20874 * though in the future it could be possible to make setting startTime
20875 * a pending operation that gets resolved here.
20876 */
20877 if (this.speed > 0) {
20878 this.startTime = Math.min(this.startTime, timestamp);
20879 }
20880 else if (this.speed < 0) {
20881 this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);
20882 }
20883 // Update currentTime
20884 if (sample) {
20885 this.currentTime = timestamp;
20886 }
20887 else if (this.holdTime !== null) {
20888 this.currentTime = this.holdTime;
20889 }
20890 else {
20891 // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =
20892 // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for
20893 // example.
20894 this.currentTime =
20895 Math.round(timestamp - this.startTime) * this.speed;
20896 }
20897 // Rebase on delay
20898 const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);
20899 const isInDelayPhase = this.speed >= 0
20900 ? timeWithoutDelay < 0
20901 : timeWithoutDelay > totalDuration;
20902 this.currentTime = Math.max(timeWithoutDelay, 0);
20903 // If this animation has finished, set the current time to the total duration.
20904 if (this.state === "finished" && this.holdTime === null) {
20905 this.currentTime = totalDuration;
20906 }
20907 let elapsed = this.currentTime;
20908 let frameGenerator = generator;
20909 if (repeat) {
20910 /**
20911 * Get the current progress (0-1) of the animation. If t is >
20912 * than duration we'll get values like 2.5 (midway through the
20913 * third iteration)
20914 */
20915 const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;
20916 /**
20917 * Get the current iteration (0 indexed). For instance the floor of
20918 * 2.5 is 2.
20919 */
20920 let currentIteration = Math.floor(progress);
20921 /**
20922 * Get the current progress of the iteration by taking the remainder
20923 * so 2.5 is 0.5 through iteration 2
20924 */
20925 let iterationProgress = progress % 1.0;
20926 /**
20927 * If iteration progress is 1 we count that as the end
20928 * of the previous iteration.
20929 */
20930 if (!iterationProgress && progress >= 1) {
20931 iterationProgress = 1;
20932 }
20933 iterationProgress === 1 && currentIteration--;
20934 currentIteration = Math.min(currentIteration, repeat + 1);
20935 /**
20936 * Reverse progress if we're not running in "normal" direction
20937 */
20938 const isOddIteration = Boolean(currentIteration % 2);
20939 if (isOddIteration) {
20940 if (repeatType === "reverse") {
20941 iterationProgress = 1 - iterationProgress;
20942 if (repeatDelay) {
20943 iterationProgress -= repeatDelay / resolvedDuration;
20944 }
20945 }
20946 else if (repeatType === "mirror") {
20947 frameGenerator = mirroredGenerator;
20948 }
20949 }
20950 elapsed = clamp_clamp(0, 1, iterationProgress) * resolvedDuration;
20951 }
20952 /**
20953 * If we're in negative time, set state as the initial keyframe.
20954 * This prevents delay: x, duration: 0 animations from finishing
20955 * instantly.
20956 */
20957 const state = isInDelayPhase
20958 ? { done: false, value: keyframes[0] }
20959 : frameGenerator.next(elapsed);
20960 if (mapPercentToKeyframes) {
20961 state.value = mapPercentToKeyframes(state.value);
20962 }
20963 let { done } = state;
20964 if (!isInDelayPhase && calculatedDuration !== null) {
20965 done =
20966 this.speed >= 0
20967 ? this.currentTime >= totalDuration
20968 : this.currentTime <= 0;
20969 }
20970 const isAnimationFinished = this.holdTime === null &&
20971 (this.state === "finished" || (this.state === "running" && done));
20972 if (isAnimationFinished && finalKeyframe !== undefined) {
20973 state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);
20974 }
20975 if (onUpdate) {
20976 onUpdate(state.value);
20977 }
20978 if (isAnimationFinished) {
20979 this.finish();
20980 }
20981 return state;
20982 }
20983 get duration() {
20984 const { resolved } = this;
20985 return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
20986 }
20987 get time() {
20988 return millisecondsToSeconds(this.currentTime);
20989 }
20990 set time(newTime) {
20991 newTime = time_conversion_secondsToMilliseconds(newTime);
20992 this.currentTime = newTime;
20993 if (this.holdTime !== null || this.speed === 0) {
20994 this.holdTime = newTime;
20995 }
20996 else if (this.driver) {
20997 this.startTime = this.driver.now() - newTime / this.speed;
20998 }
20999 }
21000 get speed() {
21001 return this.playbackSpeed;
21002 }
21003 set speed(newSpeed) {
21004 const hasChanged = this.playbackSpeed !== newSpeed;
21005 this.playbackSpeed = newSpeed;
21006 if (hasChanged) {
21007 this.time = millisecondsToSeconds(this.currentTime);
21008 }
21009 }
21010 play() {
21011 if (!this.resolver.isScheduled) {
21012 this.resolver.resume();
21013 }
21014 if (!this._resolved) {
21015 this.pendingPlayState = "running";
21016 return;
21017 }
21018 if (this.isStopped)
21019 return;
21020 const { driver = frameloopDriver, onPlay, startTime } = this.options;
21021 if (!this.driver) {
21022 this.driver = driver((timestamp) => this.tick(timestamp));
21023 }
21024 onPlay && onPlay();
21025 const now = this.driver.now();
21026 if (this.holdTime !== null) {
21027 this.startTime = now - this.holdTime;
21028 }
21029 else if (!this.startTime) {
21030 this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();
21031 }
21032 else if (this.state === "finished") {
21033 this.startTime = now;
21034 }
21035 if (this.state === "finished") {
21036 this.updateFinishedPromise();
21037 }
21038 this.cancelTime = this.startTime;
21039 this.holdTime = null;
21040 /**
21041 * Set playState to running only after we've used it in
21042 * the previous logic.
21043 */
21044 this.state = "running";
21045 this.driver.start();
21046 }
21047 pause() {
21048 var _a;
21049 if (!this._resolved) {
21050 this.pendingPlayState = "paused";
21051 return;
21052 }
21053 this.state = "paused";
21054 this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;
21055 }
21056 complete() {
21057 if (this.state !== "running") {
21058 this.play();
21059 }
21060 this.pendingPlayState = this.state = "finished";
21061 this.holdTime = null;
21062 }
21063 finish() {
21064 this.teardown();
21065 this.state = "finished";
21066 const { onComplete } = this.options;
21067 onComplete && onComplete();
21068 }
21069 cancel() {
21070 if (this.cancelTime !== null) {
21071 this.tick(this.cancelTime);
21072 }
21073 this.teardown();
21074 this.updateFinishedPromise();
21075 }
21076 teardown() {
21077 this.state = "idle";
21078 this.stopDriver();
21079 this.resolveFinishedPromise();
21080 this.updateFinishedPromise();
21081 this.startTime = this.cancelTime = null;
21082 this.resolver.cancel();
21083 }
21084 stopDriver() {
21085 if (!this.driver)
21086 return;
21087 this.driver.stop();
21088 this.driver = undefined;
21089 }
21090 sample(time) {
21091 this.startTime = 0;
21092 return this.tick(time, true);
21093 }
21094}
21095// Legacy interface
21096function animateValue(options) {
21097 return new MainThreadAnimation(options);
21098}
21099
21100
21101
21102;// ./node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs
21103/**
21104 * A list of values that can be hardware-accelerated.
21105 */
21106const acceleratedValues = new Set([
21107 "opacity",
21108 "clipPath",
21109 "filter",
21110 "transform",
21111 // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
21112 // or until we implement support for linear() easing.
21113 // "background-color"
21114]);
21115
21116
21117
21118;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs
21119
21120
21121function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times, } = {}) {
21122 const keyframeOptions = { [valueName]: keyframes };
21123 if (times)
21124 keyframeOptions.offset = times;
21125 const easing = easing_mapEasingToNativeEasing(ease, duration);
21126 /**
21127 * If this is an easing array, apply to keyframes, not animation as a whole
21128 */
21129 if (Array.isArray(easing))
21130 keyframeOptions.easing = easing;
21131 return element.animate(keyframeOptions, {
21132 delay,
21133 duration,
21134 easing: !Array.isArray(easing) ? easing : "linear",
21135 fill: "both",
21136 iterations: repeat + 1,
21137 direction: repeatType === "reverse" ? "alternate" : "normal",
21138 });
21139}
21140
21141
21142
21143;// ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs
21144
21145
21146const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
21147
21148
21149
21150;// ./node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164/**
21165 * 10ms is chosen here as it strikes a balance between smooth
21166 * results (more than one keyframe per frame at 60fps) and
21167 * keyframe quantity.
21168 */
21169const sampleDelta = 10; //ms
21170/**
21171 * Implement a practical max duration for keyframe generation
21172 * to prevent infinite loops
21173 */
21174const maxDuration = 20000;
21175/**
21176 * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.
21177 * WAAPI doesn't support spring or function easings so we run these as JS animation before
21178 * handing off.
21179 */
21180function requiresPregeneratedKeyframes(options) {
21181 return (isGenerator(options.type) ||
21182 options.type === "spring" ||
21183 !isWaapiSupportedEasing(options.ease));
21184}
21185function pregenerateKeyframes(keyframes, options) {
21186 /**
21187 * Create a main-thread animation to pregenerate keyframes.
21188 * We sample this at regular intervals to generate keyframes that we then
21189 * linearly interpolate between.
21190 */
21191 const sampleAnimation = new MainThreadAnimation({
21192 ...options,
21193 keyframes,
21194 repeat: 0,
21195 delay: 0,
21196 isGenerator: true,
21197 });
21198 let state = { done: false, value: keyframes[0] };
21199 const pregeneratedKeyframes = [];
21200 /**
21201 * Bail after 20 seconds of pre-generated keyframes as it's likely
21202 * we're heading for an infinite loop.
21203 */
21204 let t = 0;
21205 while (!state.done && t < maxDuration) {
21206 state = sampleAnimation.sample(t);
21207 pregeneratedKeyframes.push(state.value);
21208 t += sampleDelta;
21209 }
21210 return {
21211 times: undefined,
21212 keyframes: pregeneratedKeyframes,
21213 duration: t - sampleDelta,
21214 ease: "linear",
21215 };
21216}
21217const unsupportedEasingFunctions = {
21218 anticipate: anticipate,
21219 backInOut: backInOut,
21220 circInOut: circInOut,
21221};
21222function isUnsupportedEase(key) {
21223 return key in unsupportedEasingFunctions;
21224}
21225class AcceleratedAnimation extends BaseAnimation {
21226 constructor(options) {
21227 super(options);
21228 const { name, motionValue, element, keyframes } = this.options;
21229 this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element);
21230 this.resolver.scheduleResolve();
21231 }
21232 initPlayback(keyframes, finalKeyframe) {
21233 let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options;
21234 /**
21235 * If element has since been unmounted, return false to indicate
21236 * the animation failed to initialised.
21237 */
21238 if (!motionValue.owner || !motionValue.owner.current) {
21239 return false;
21240 }
21241 /**
21242 * If the user has provided an easing function name that isn't supported
21243 * by WAAPI (like "anticipate"), we need to provide the corressponding
21244 * function. This will later get converted to a linear() easing function.
21245 */
21246 if (typeof ease === "string" &&
21247 supportsLinearEasing() &&
21248 isUnsupportedEase(ease)) {
21249 ease = unsupportedEasingFunctions[ease];
21250 }
21251 /**
21252 * If this animation needs pre-generated keyframes then generate.
21253 */
21254 if (requiresPregeneratedKeyframes(this.options)) {
21255 const { onComplete, onUpdate, motionValue, element, ...options } = this.options;
21256 const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);
21257 keyframes = pregeneratedAnimation.keyframes;
21258 // If this is a very short animation, ensure we have
21259 // at least two keyframes to animate between as older browsers
21260 // can't animate between a single keyframe.
21261 if (keyframes.length === 1) {
21262 keyframes[1] = keyframes[0];
21263 }
21264 duration = pregeneratedAnimation.duration;
21265 times = pregeneratedAnimation.times;
21266 ease = pregeneratedAnimation.ease;
21267 type = "keyframes";
21268 }
21269 const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });
21270 // Override the browser calculated startTime with one synchronised to other JS
21271 // and WAAPI animations starting this event loop.
21272 animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();
21273 if (this.pendingTimeline) {
21274 attachTimeline(animation, this.pendingTimeline);
21275 this.pendingTimeline = undefined;
21276 }
21277 else {
21278 /**
21279 * Prefer the `onfinish` prop as it's more widely supported than
21280 * the `finished` promise.
21281 *
21282 * Here, we synchronously set the provided MotionValue to the end
21283 * keyframe. If we didn't, when the WAAPI animation is finished it would
21284 * be removed from the element which would then revert to its old styles.
21285 */
21286 animation.onfinish = () => {
21287 const { onComplete } = this.options;
21288 motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));
21289 onComplete && onComplete();
21290 this.cancel();
21291 this.resolveFinishedPromise();
21292 };
21293 }
21294 return {
21295 animation,
21296 duration,
21297 times,
21298 type,
21299 ease,
21300 keyframes: keyframes,
21301 };
21302 }
21303 get duration() {
21304 const { resolved } = this;
21305 if (!resolved)
21306 return 0;
21307 const { duration } = resolved;
21308 return millisecondsToSeconds(duration);
21309 }
21310 get time() {
21311 const { resolved } = this;
21312 if (!resolved)
21313 return 0;
21314 const { animation } = resolved;
21315 return millisecondsToSeconds(animation.currentTime || 0);
21316 }
21317 set time(newTime) {
21318 const { resolved } = this;
21319 if (!resolved)
21320 return;
21321 const { animation } = resolved;
21322 animation.currentTime = time_conversion_secondsToMilliseconds(newTime);
21323 }
21324 get speed() {
21325 const { resolved } = this;
21326 if (!resolved)
21327 return 1;
21328 const { animation } = resolved;
21329 return animation.playbackRate;
21330 }
21331 set speed(newSpeed) {
21332 const { resolved } = this;
21333 if (!resolved)
21334 return;
21335 const { animation } = resolved;
21336 animation.playbackRate = newSpeed;
21337 }
21338 get state() {
21339 const { resolved } = this;
21340 if (!resolved)
21341 return "idle";
21342 const { animation } = resolved;
21343 return animation.playState;
21344 }
21345 get startTime() {
21346 const { resolved } = this;
21347 if (!resolved)
21348 return null;
21349 const { animation } = resolved;
21350 // Coerce to number as TypeScript incorrectly types this
21351 // as CSSNumberish
21352 return animation.startTime;
21353 }
21354 /**
21355 * Replace the default DocumentTimeline with another AnimationTimeline.
21356 * Currently used for scroll animations.
21357 */
21358 attachTimeline(timeline) {
21359 if (!this._resolved) {
21360 this.pendingTimeline = timeline;
21361 }
21362 else {
21363 const { resolved } = this;
21364 if (!resolved)
21365 return noop_noop;
21366 const { animation } = resolved;
21367 attachTimeline(animation, timeline);
21368 }
21369 return noop_noop;
21370 }
21371 play() {
21372 if (this.isStopped)
21373 return;
21374 const { resolved } = this;
21375 if (!resolved)
21376 return;
21377 const { animation } = resolved;
21378 if (animation.playState === "finished") {
21379 this.updateFinishedPromise();
21380 }
21381 animation.play();
21382 }
21383 pause() {
21384 const { resolved } = this;
21385 if (!resolved)
21386 return;
21387 const { animation } = resolved;
21388 animation.pause();
21389 }
21390 stop() {
21391 this.resolver.cancel();
21392 this.isStopped = true;
21393 if (this.state === "idle")
21394 return;
21395 this.resolveFinishedPromise();
21396 this.updateFinishedPromise();
21397 const { resolved } = this;
21398 if (!resolved)
21399 return;
21400 const { animation, keyframes, duration, type, ease, times } = resolved;
21401 if (animation.playState === "idle" ||
21402 animation.playState === "finished") {
21403 return;
21404 }
21405 /**
21406 * WAAPI doesn't natively have any interruption capabilities.
21407 *
21408 * Rather than read commited styles back out of the DOM, we can
21409 * create a renderless JS animation and sample it twice to calculate
21410 * its current value, "previous" value, and therefore allow
21411 * Motion to calculate velocity for any subsequent animation.
21412 */
21413 if (this.time) {
21414 const { motionValue, onUpdate, onComplete, element, ...options } = this.options;
21415 const sampleAnimation = new MainThreadAnimation({
21416 ...options,
21417 keyframes,
21418 duration,
21419 type,
21420 ease,
21421 times,
21422 isGenerator: true,
21423 });
21424 const sampleTime = time_conversion_secondsToMilliseconds(this.time);
21425 motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
21426 }
21427 const { onStop } = this.options;
21428 onStop && onStop();
21429 this.cancel();
21430 }
21431 complete() {
21432 const { resolved } = this;
21433 if (!resolved)
21434 return;
21435 resolved.animation.finish();
21436 }
21437 cancel() {
21438 const { resolved } = this;
21439 if (!resolved)
21440 return;
21441 resolved.animation.cancel();
21442 }
21443 static supports(options) {
21444 const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
21445 if (!motionValue ||
21446 !motionValue.owner ||
21447 !(motionValue.owner.current instanceof HTMLElement)) {
21448 return false;
21449 }
21450 const { onUpdate, transformTemplate } = motionValue.owner.getProps();
21451 return (supportsWaapi() &&
21452 name &&
21453 acceleratedValues.has(name) &&
21454 /**
21455 * If we're outputting values to onUpdate then we can't use WAAPI as there's
21456 * no way to read the value from WAAPI every frame.
21457 */
21458 !onUpdate &&
21459 !transformTemplate &&
21460 !repeatDelay &&
21461 repeatType !== "mirror" &&
21462 damping !== 0 &&
21463 type !== "inertia");
21464 }
21465}
21466
21467
21468
21469;// ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs
21470
21471
21472const underDampedSpring = {
21473 type: "spring",
21474 stiffness: 500,
21475 damping: 25,
21476 restSpeed: 10,
21477};
21478const criticallyDampedSpring = (target) => ({
21479 type: "spring",
21480 stiffness: 550,
21481 damping: target === 0 ? 2 * Math.sqrt(550) : 30,
21482 restSpeed: 10,
21483});
21484const keyframesTransition = {
21485 type: "keyframes",
21486 duration: 0.8,
21487};
21488/**
21489 * Default easing curve is a slightly shallower version of
21490 * the default browser easing curve.
21491 */
21492const ease = {
21493 type: "keyframes",
21494 ease: [0.25, 0.1, 0.35, 1],
21495 duration: 0.3,
21496};
21497const getDefaultTransition = (valueKey, { keyframes }) => {
21498 if (keyframes.length > 2) {
21499 return keyframesTransition;
21500 }
21501 else if (transformProps.has(valueKey)) {
21502 return valueKey.startsWith("scale")
21503 ? criticallyDampedSpring(keyframes[1])
21504 : underDampedSpring;
21505 }
21506 return ease;
21507};
21508
21509
21510
21511;// ./node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs
21512/**
21513 * Decide whether a transition is defined on a given Transition.
21514 * This filters out orchestration options and returns true
21515 * if any options are left.
21516 */
21517function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
21518 return !!Object.keys(transition).length;
21519}
21520
21521
21522
21523;// ./node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
21536 const valueTransition = get_value_transition_getValueTransition(transition, name) || {};
21537 /**
21538 * Most transition values are currently completely overwritten by value-specific
21539 * transitions. In the future it'd be nicer to blend these transitions. But for now
21540 * delay actually does inherit from the root transition if not value-specific.
21541 */
21542 const delay = valueTransition.delay || transition.delay || 0;
21543 /**
21544 * Elapsed isn't a public transition option but can be passed through from
21545 * optimized appear effects in milliseconds.
21546 */
21547 let { elapsed = 0 } = transition;
21548 elapsed = elapsed - time_conversion_secondsToMilliseconds(delay);
21549 let options = {
21550 keyframes: Array.isArray(target) ? target : [null, target],
21551 ease: "easeOut",
21552 velocity: value.getVelocity(),
21553 ...valueTransition,
21554 delay: -elapsed,
21555 onUpdate: (v) => {
21556 value.set(v);
21557 valueTransition.onUpdate && valueTransition.onUpdate(v);
21558 },
21559 onComplete: () => {
21560 onComplete();
21561 valueTransition.onComplete && valueTransition.onComplete();
21562 },
21563 name,
21564 motionValue: value,
21565 element: isHandoff ? undefined : element,
21566 };
21567 /**
21568 * If there's no transition defined for this value, we can generate
21569 * unqiue transition settings for this value.
21570 */
21571 if (!isTransitionDefined(valueTransition)) {
21572 options = {
21573 ...options,
21574 ...getDefaultTransition(name, options),
21575 };
21576 }
21577 /**
21578 * Both WAAPI and our internal animation functions use durations
21579 * as defined by milliseconds, while our external API defines them
21580 * as seconds.
21581 */
21582 if (options.duration) {
21583 options.duration = time_conversion_secondsToMilliseconds(options.duration);
21584 }
21585 if (options.repeatDelay) {
21586 options.repeatDelay = time_conversion_secondsToMilliseconds(options.repeatDelay);
21587 }
21588 if (options.from !== undefined) {
21589 options.keyframes[0] = options.from;
21590 }
21591 let shouldSkip = false;
21592 if (options.type === false ||
21593 (options.duration === 0 && !options.repeatDelay)) {
21594 options.duration = 0;
21595 if (options.delay === 0) {
21596 shouldSkip = true;
21597 }
21598 }
21599 if (instantAnimationState.current ||
21600 MotionGlobalConfig.skipAnimations) {
21601 shouldSkip = true;
21602 options.duration = 0;
21603 options.delay = 0;
21604 }
21605 /**
21606 * If we can or must skip creating the animation, and apply only
21607 * the final keyframe, do so. We also check once keyframes are resolved but
21608 * this early check prevents the need to create an animation at all.
21609 */
21610 if (shouldSkip && !isHandoff && value.get() !== undefined) {
21611 const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);
21612 if (finalKeyframe !== undefined) {
21613 frame_frame.update(() => {
21614 options.onUpdate(finalKeyframe);
21615 options.onComplete();
21616 });
21617 // We still want to return some animation controls here rather
21618 // than returning undefined
21619 return new GroupPlaybackControls([]);
21620 }
21621 }
21622 /**
21623 * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via
21624 * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the
21625 * optimised animation.
21626 */
21627 if (!isHandoff && AcceleratedAnimation.supports(options)) {
21628 return new AcceleratedAnimation(options);
21629 }
21630 else {
21631 return new MainThreadAnimation(options);
21632 }
21633};
21634
21635
21636
21637;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs
21638
21639
21640
21641
21642
21643
21644
21645
21646/**
21647 * Decide whether we should block this animation. Previously, we achieved this
21648 * just by checking whether the key was listed in protectedKeys, but this
21649 * posed problems if an animation was triggered by afterChildren and protectedKeys
21650 * had been set to true in the meantime.
21651 */
21652function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
21653 const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
21654 needsAnimating[key] = false;
21655 return shouldBlock;
21656}
21657function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
21658 var _a;
21659 let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
21660 if (transitionOverride)
21661 transition = transitionOverride;
21662 const animations = [];
21663 const animationTypeState = type &&
21664 visualElement.animationState &&
21665 visualElement.animationState.getState()[type];
21666 for (const key in target) {
21667 const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);
21668 const valueTarget = target[key];
21669 if (valueTarget === undefined ||
21670 (animationTypeState &&
21671 shouldBlockAnimation(animationTypeState, key))) {
21672 continue;
21673 }
21674 const valueTransition = {
21675 delay,
21676 ...get_value_transition_getValueTransition(transition || {}, key),
21677 };
21678 /**
21679 * If this is the first time a value is being animated, check
21680 * to see if we're handling off from an existing animation.
21681 */
21682 let isHandoff = false;
21683 if (window.MotionHandoffAnimation) {
21684 const appearId = getOptimisedAppearId(visualElement);
21685 if (appearId) {
21686 const startTime = window.MotionHandoffAnimation(appearId, key, frame_frame);
21687 if (startTime !== null) {
21688 valueTransition.startTime = startTime;
21689 isHandoff = true;
21690 }
21691 }
21692 }
21693 addValueToWillChange(visualElement, key);
21694 value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)
21695 ? { type: false }
21696 : valueTransition, visualElement, isHandoff));
21697 const animation = value.animation;
21698 if (animation) {
21699 animations.push(animation);
21700 }
21701 }
21702 if (transitionEnd) {
21703 Promise.all(animations).then(() => {
21704 frame_frame.update(() => {
21705 transitionEnd && setTarget(visualElement, transitionEnd);
21706 });
21707 });
21708 }
21709 return animations;
21710}
21711
21712
21713
21714;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs
21715
21716
21717
21718function animateVariant(visualElement, variant, options = {}) {
21719 var _a;
21720 const resolved = resolveVariant(visualElement, variant, options.type === "exit"
21721 ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
21722 : undefined);
21723 let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};
21724 if (options.transitionOverride) {
21725 transition = options.transitionOverride;
21726 }
21727 /**
21728 * If we have a variant, create a callback that runs it as an animation.
21729 * Otherwise, we resolve a Promise immediately for a composable no-op.
21730 */
21731 const getAnimation = resolved
21732 ? () => Promise.all(animateTarget(visualElement, resolved, options))
21733 : () => Promise.resolve();
21734 /**
21735 * If we have children, create a callback that runs all their animations.
21736 * Otherwise, we resolve a Promise immediately for a composable no-op.
21737 */
21738 const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size
21739 ? (forwardDelay = 0) => {
21740 const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;
21741 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
21742 }
21743 : () => Promise.resolve();
21744 /**
21745 * If the transition explicitly defines a "when" option, we need to resolve either
21746 * this animation or all children animations before playing the other.
21747 */
21748 const { when } = transition;
21749 if (when) {
21750 const [first, last] = when === "beforeChildren"
21751 ? [getAnimation, getChildAnimations]
21752 : [getChildAnimations, getAnimation];
21753 return first().then(() => last());
21754 }
21755 else {
21756 return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
21757 }
21758}
21759function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
21760 const animations = [];
21761 const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
21762 const generateStaggerDuration = staggerDirection === 1
21763 ? (i = 0) => i * staggerChildren
21764 : (i = 0) => maxStaggerDuration - i * staggerChildren;
21765 Array.from(visualElement.variantChildren)
21766 .sort(sortByTreeOrder)
21767 .forEach((child, i) => {
21768 child.notify("AnimationStart", variant);
21769 animations.push(animateVariant(child, variant, {
21770 ...options,
21771 delay: delayChildren + generateStaggerDuration(i),
21772 }).then(() => child.notify("AnimationComplete", variant)));
21773 });
21774 return Promise.all(animations);
21775}
21776function sortByTreeOrder(a, b) {
21777 return a.sortNodePosition(b);
21778}
21779
21780
21781
21782;// ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs
21783
21784
21785
21786
21787function animateVisualElement(visualElement, definition, options = {}) {
21788 visualElement.notify("AnimationStart", definition);
21789 let animation;
21790 if (Array.isArray(definition)) {
21791 const animations = definition.map((variant) => animateVariant(visualElement, variant, options));
21792 animation = Promise.all(animations);
21793 }
21794 else if (typeof definition === "string") {
21795 animation = animateVariant(visualElement, definition, options);
21796 }
21797 else {
21798 const resolvedDefinition = typeof definition === "function"
21799 ? resolveVariant(visualElement, definition, options.custom)
21800 : definition;
21801 animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
21802 }
21803 return animation.then(() => {
21804 visualElement.notify("AnimationComplete", definition);
21805 });
21806}
21807
21808
21809
21810;// ./node_modules/framer-motion/dist/es/render/utils/get-variant-context.mjs
21811
21812
21813
21814const numVariantProps = variantProps.length;
21815function getVariantContext(visualElement) {
21816 if (!visualElement)
21817 return undefined;
21818 if (!visualElement.isControllingVariants) {
21819 const context = visualElement.parent
21820 ? getVariantContext(visualElement.parent) || {}
21821 : {};
21822 if (visualElement.props.initial !== undefined) {
21823 context.initial = visualElement.props.initial;
21824 }
21825 return context;
21826 }
21827 const context = {};
21828 for (let i = 0; i < numVariantProps; i++) {
21829 const name = variantProps[i];
21830 const prop = visualElement.props[name];
21831 if (isVariantLabel(prop) || prop === false) {
21832 context[name] = prop;
21833 }
21834 }
21835 return context;
21836}
21837
21838
21839
21840;// ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850const reversePriorityOrder = [...variantPriorityOrder].reverse();
21851const numAnimationTypes = variantPriorityOrder.length;
21852function animateList(visualElement) {
21853 return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
21854}
21855function createAnimationState(visualElement) {
21856 let animate = animateList(visualElement);
21857 let state = createState();
21858 let isInitialRender = true;
21859 /**
21860 * This function will be used to reduce the animation definitions for
21861 * each active animation type into an object of resolved values for it.
21862 */
21863 const buildResolvedTypeValues = (type) => (acc, definition) => {
21864 var _a;
21865 const resolved = resolveVariant(visualElement, definition, type === "exit"
21866 ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom
21867 : undefined);
21868 if (resolved) {
21869 const { transition, transitionEnd, ...target } = resolved;
21870 acc = { ...acc, ...target, ...transitionEnd };
21871 }
21872 return acc;
21873 };
21874 /**
21875 * This just allows us to inject mocked animation functions
21876 * @internal
21877 */
21878 function setAnimateFunction(makeAnimator) {
21879 animate = makeAnimator(visualElement);
21880 }
21881 /**
21882 * When we receive new props, we need to:
21883 * 1. Create a list of protected keys for each type. This is a directory of
21884 * value keys that are currently being "handled" by types of a higher priority
21885 * so that whenever an animation is played of a given type, these values are
21886 * protected from being animated.
21887 * 2. Determine if an animation type needs animating.
21888 * 3. Determine if any values have been removed from a type and figure out
21889 * what to animate those to.
21890 */
21891 function animateChanges(changedActiveType) {
21892 const { props } = visualElement;
21893 const context = getVariantContext(visualElement.parent) || {};
21894 /**
21895 * A list of animations that we'll build into as we iterate through the animation
21896 * types. This will get executed at the end of the function.
21897 */
21898 const animations = [];
21899 /**
21900 * Keep track of which values have been removed. Then, as we hit lower priority
21901 * animation types, we can check if they contain removed values and animate to that.
21902 */
21903 const removedKeys = new Set();
21904 /**
21905 * A dictionary of all encountered keys. This is an object to let us build into and
21906 * copy it without iteration. Each time we hit an animation type we set its protected
21907 * keys - the keys its not allowed to animate - to the latest version of this object.
21908 */
21909 let encounteredKeys = {};
21910 /**
21911 * If a variant has been removed at a given index, and this component is controlling
21912 * variant animations, we want to ensure lower-priority variants are forced to animate.
21913 */
21914 let removedVariantIndex = Infinity;
21915 /**
21916 * Iterate through all animation types in reverse priority order. For each, we want to
21917 * detect which values it's handling and whether or not they've changed (and therefore
21918 * need to be animated). If any values have been removed, we want to detect those in
21919 * lower priority props and flag for animation.
21920 */
21921 for (let i = 0; i < numAnimationTypes; i++) {
21922 const type = reversePriorityOrder[i];
21923 const typeState = state[type];
21924 const prop = props[type] !== undefined
21925 ? props[type]
21926 : context[type];
21927 const propIsVariant = isVariantLabel(prop);
21928 /**
21929 * If this type has *just* changed isActive status, set activeDelta
21930 * to that status. Otherwise set to null.
21931 */
21932 const activeDelta = type === changedActiveType ? typeState.isActive : null;
21933 if (activeDelta === false)
21934 removedVariantIndex = i;
21935 /**
21936 * If this prop is an inherited variant, rather than been set directly on the
21937 * component itself, we want to make sure we allow the parent to trigger animations.
21938 *
21939 * TODO: Can probably change this to a !isControllingVariants check
21940 */
21941 let isInherited = prop === context[type] &&
21942 prop !== props[type] &&
21943 propIsVariant;
21944 /**
21945 *
21946 */
21947 if (isInherited &&
21948 isInitialRender &&
21949 visualElement.manuallyAnimateOnMount) {
21950 isInherited = false;
21951 }
21952 /**
21953 * Set all encountered keys so far as the protected keys for this type. This will
21954 * be any key that has been animated or otherwise handled by active, higher-priortiy types.
21955 */
21956 typeState.protectedKeys = { ...encounteredKeys };
21957 // Check if we can skip analysing this prop early
21958 if (
21959 // If it isn't active and hasn't *just* been set as inactive
21960 (!typeState.isActive && activeDelta === null) ||
21961 // If we didn't and don't have any defined prop for this animation type
21962 (!prop && !typeState.prevProp) ||
21963 // Or if the prop doesn't define an animation
21964 isAnimationControls(prop) ||
21965 typeof prop === "boolean") {
21966 continue;
21967 }
21968 /**
21969 * As we go look through the values defined on this type, if we detect
21970 * a changed value or a value that was removed in a higher priority, we set
21971 * this to true and add this prop to the animation list.
21972 */
21973 const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
21974 let shouldAnimateType = variantDidChange ||
21975 // If we're making this variant active, we want to always make it active
21976 (type === changedActiveType &&
21977 typeState.isActive &&
21978 !isInherited &&
21979 propIsVariant) ||
21980 // If we removed a higher-priority variant (i is in reverse order)
21981 (i > removedVariantIndex && propIsVariant);
21982 let handledRemovedValues = false;
21983 /**
21984 * As animations can be set as variant lists, variants or target objects, we
21985 * coerce everything to an array if it isn't one already
21986 */
21987 const definitionList = Array.isArray(prop) ? prop : [prop];
21988 /**
21989 * Build an object of all the resolved values. We'll use this in the subsequent
21990 * animateChanges calls to determine whether a value has changed.
21991 */
21992 let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});
21993 if (activeDelta === false)
21994 resolvedValues = {};
21995 /**
21996 * Now we need to loop through all the keys in the prev prop and this prop,
21997 * and decide:
21998 * 1. If the value has changed, and needs animating
21999 * 2. If it has been removed, and needs adding to the removedKeys set
22000 * 3. If it has been removed in a higher priority type and needs animating
22001 * 4. If it hasn't been removed in a higher priority but hasn't changed, and
22002 * needs adding to the type's protectedKeys list.
22003 */
22004 const { prevResolvedValues = {} } = typeState;
22005 const allKeys = {
22006 ...prevResolvedValues,
22007 ...resolvedValues,
22008 };
22009 const markToAnimate = (key) => {
22010 shouldAnimateType = true;
22011 if (removedKeys.has(key)) {
22012 handledRemovedValues = true;
22013 removedKeys.delete(key);
22014 }
22015 typeState.needsAnimating[key] = true;
22016 const motionValue = visualElement.getValue(key);
22017 if (motionValue)
22018 motionValue.liveStyle = false;
22019 };
22020 for (const key in allKeys) {
22021 const next = resolvedValues[key];
22022 const prev = prevResolvedValues[key];
22023 // If we've already handled this we can just skip ahead
22024 if (encounteredKeys.hasOwnProperty(key))
22025 continue;
22026 /**
22027 * If the value has changed, we probably want to animate it.
22028 */
22029 let valueHasChanged = false;
22030 if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
22031 valueHasChanged = !shallowCompare(next, prev);
22032 }
22033 else {
22034 valueHasChanged = next !== prev;
22035 }
22036 if (valueHasChanged) {
22037 if (next !== undefined && next !== null) {
22038 // If next is defined and doesn't equal prev, it needs animating
22039 markToAnimate(key);
22040 }
22041 else {
22042 // If it's undefined, it's been removed.
22043 removedKeys.add(key);
22044 }
22045 }
22046 else if (next !== undefined && removedKeys.has(key)) {
22047 /**
22048 * If next hasn't changed and it isn't undefined, we want to check if it's
22049 * been removed by a higher priority
22050 */
22051 markToAnimate(key);
22052 }
22053 else {
22054 /**
22055 * If it hasn't changed, we add it to the list of protected values
22056 * to ensure it doesn't get animated.
22057 */
22058 typeState.protectedKeys[key] = true;
22059 }
22060 }
22061 /**
22062 * Update the typeState so next time animateChanges is called we can compare the
22063 * latest prop and resolvedValues to these.
22064 */
22065 typeState.prevProp = prop;
22066 typeState.prevResolvedValues = resolvedValues;
22067 /**
22068 *
22069 */
22070 if (typeState.isActive) {
22071 encounteredKeys = { ...encounteredKeys, ...resolvedValues };
22072 }
22073 if (isInitialRender && visualElement.blockInitialAnimation) {
22074 shouldAnimateType = false;
22075 }
22076 /**
22077 * If this is an inherited prop we want to skip this animation
22078 * unless the inherited variants haven't changed on this render.
22079 */
22080 const willAnimateViaParent = isInherited && variantDidChange;
22081 const needsAnimating = !willAnimateViaParent || handledRemovedValues;
22082 if (shouldAnimateType && needsAnimating) {
22083 animations.push(...definitionList.map((animation) => ({
22084 animation: animation,
22085 options: { type },
22086 })));
22087 }
22088 }
22089 /**
22090 * If there are some removed value that haven't been dealt with,
22091 * we need to create a new animation that falls back either to the value
22092 * defined in the style prop, or the last read value.
22093 */
22094 if (removedKeys.size) {
22095 const fallbackAnimation = {};
22096 removedKeys.forEach((key) => {
22097 const fallbackTarget = visualElement.getBaseTarget(key);
22098 const motionValue = visualElement.getValue(key);
22099 if (motionValue)
22100 motionValue.liveStyle = true;
22101 // @ts-expect-error - @mattgperry to figure if we should do something here
22102 fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;
22103 });
22104 animations.push({ animation: fallbackAnimation });
22105 }
22106 let shouldAnimate = Boolean(animations.length);
22107 if (isInitialRender &&
22108 (props.initial === false || props.initial === props.animate) &&
22109 !visualElement.manuallyAnimateOnMount) {
22110 shouldAnimate = false;
22111 }
22112 isInitialRender = false;
22113 return shouldAnimate ? animate(animations) : Promise.resolve();
22114 }
22115 /**
22116 * Change whether a certain animation type is active.
22117 */
22118 function setActive(type, isActive) {
22119 var _a;
22120 // If the active state hasn't changed, we can safely do nothing here
22121 if (state[type].isActive === isActive)
22122 return Promise.resolve();
22123 // Propagate active change to children
22124 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
22125 state[type].isActive = isActive;
22126 const animations = animateChanges(type);
22127 for (const key in state) {
22128 state[key].protectedKeys = {};
22129 }
22130 return animations;
22131 }
22132 return {
22133 animateChanges,
22134 setActive,
22135 setAnimateFunction,
22136 getState: () => state,
22137 reset: () => {
22138 state = createState();
22139 isInitialRender = true;
22140 },
22141 };
22142}
22143function checkVariantsDidChange(prev, next) {
22144 if (typeof next === "string") {
22145 return next !== prev;
22146 }
22147 else if (Array.isArray(next)) {
22148 return !shallowCompare(next, prev);
22149 }
22150 return false;
22151}
22152function createTypeState(isActive = false) {
22153 return {
22154 isActive,
22155 protectedKeys: {},
22156 needsAnimating: {},
22157 prevResolvedValues: {},
22158 };
22159}
22160function createState() {
22161 return {
22162 animate: createTypeState(true),
22163 whileInView: createTypeState(),
22164 whileHover: createTypeState(),
22165 whileTap: createTypeState(),
22166 whileDrag: createTypeState(),
22167 whileFocus: createTypeState(),
22168 exit: createTypeState(),
22169 };
22170}
22171
22172
22173
22174;// ./node_modules/framer-motion/dist/es/motion/features/Feature.mjs
22175class Feature {
22176 constructor(node) {
22177 this.isMounted = false;
22178 this.node = node;
22179 }
22180 update() { }
22181}
22182
22183
22184
22185;// ./node_modules/framer-motion/dist/es/motion/features/animation/index.mjs
22186
22187
22188
22189
22190class AnimationFeature extends Feature {
22191 /**
22192 * We dynamically generate the AnimationState manager as it contains a reference
22193 * to the underlying animation library. We only want to load that if we load this,
22194 * so people can optionally code split it out using the `m` component.
22195 */
22196 constructor(node) {
22197 super(node);
22198 node.animationState || (node.animationState = createAnimationState(node));
22199 }
22200 updateAnimationControlsSubscription() {
22201 const { animate } = this.node.getProps();
22202 if (isAnimationControls(animate)) {
22203 this.unmountControls = animate.subscribe(this.node);
22204 }
22205 }
22206 /**
22207 * Subscribe any provided AnimationControls to the component's VisualElement
22208 */
22209 mount() {
22210 this.updateAnimationControlsSubscription();
22211 }
22212 update() {
22213 const { animate } = this.node.getProps();
22214 const { animate: prevAnimate } = this.node.prevProps || {};
22215 if (animate !== prevAnimate) {
22216 this.updateAnimationControlsSubscription();
22217 }
22218 }
22219 unmount() {
22220 var _a;
22221 this.node.animationState.reset();
22222 (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this);
22223 }
22224}
22225
22226
22227
22228;// ./node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs
22229
22230
22231let id = 0;
22232class ExitAnimationFeature extends Feature {
22233 constructor() {
22234 super(...arguments);
22235 this.id = id++;
22236 }
22237 update() {
22238 if (!this.node.presenceContext)
22239 return;
22240 const { isPresent, onExitComplete } = this.node.presenceContext;
22241 const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
22242 if (!this.node.animationState || isPresent === prevIsPresent) {
22243 return;
22244 }
22245 const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
22246 if (onExitComplete && !isPresent) {
22247 exitAnimation.then(() => onExitComplete(this.id));
22248 }
22249 }
22250 mount() {
22251 const { register } = this.node.presenceContext || {};
22252 if (register) {
22253 this.unmount = register(this.id);
22254 }
22255 }
22256 unmount() { }
22257}
22258
22259
22260
22261;// ./node_modules/framer-motion/dist/es/motion/features/animations.mjs
22262
22263
22264
22265const animations = {
22266 animation: {
22267 Feature: AnimationFeature,
22268 },
22269 exit: {
22270 Feature: ExitAnimationFeature,
22271 },
22272};
22273
22274
22275
22276;// ./node_modules/framer-motion/dist/es/events/add-dom-event.mjs
22277function addDomEvent(target, eventName, handler, options = { passive: true }) {
22278 target.addEventListener(eventName, handler, options);
22279 return () => target.removeEventListener(eventName, handler);
22280}
22281
22282
22283
22284;// ./node_modules/framer-motion/dist/es/events/event-info.mjs
22285
22286
22287function extractEventInfo(event) {
22288 return {
22289 point: {
22290 x: event.pageX,
22291 y: event.pageY,
22292 },
22293 };
22294}
22295const addPointerInfo = (handler) => {
22296 return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
22297};
22298
22299
22300
22301;// ./node_modules/framer-motion/dist/es/events/add-pointer-event.mjs
22302
22303
22304
22305function addPointerEvent(target, eventName, handler, options) {
22306 return addDomEvent(target, eventName, addPointerInfo(handler), options);
22307}
22308
22309
22310
22311;// ./node_modules/framer-motion/dist/es/utils/distance.mjs
22312const distance = (a, b) => Math.abs(a - b);
22313function distance2D(a, b) {
22314 // Multi-dimensional
22315 const xDelta = distance(a.x, b.x);
22316 const yDelta = distance(a.y, b.y);
22317 return Math.sqrt(xDelta ** 2 + yDelta ** 2);
22318}
22319
22320
22321
22322;// ./node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs
22323
22324
22325
22326
22327
22328
22329
22330
22331/**
22332 * @internal
22333 */
22334class PanSession {
22335 constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
22336 /**
22337 * @internal
22338 */
22339 this.startEvent = null;
22340 /**
22341 * @internal
22342 */
22343 this.lastMoveEvent = null;
22344 /**
22345 * @internal
22346 */
22347 this.lastMoveEventInfo = null;
22348 /**
22349 * @internal
22350 */
22351 this.handlers = {};
22352 /**
22353 * @internal
22354 */
22355 this.contextWindow = window;
22356 this.updatePoint = () => {
22357 if (!(this.lastMoveEvent && this.lastMoveEventInfo))
22358 return;
22359 const info = getPanInfo(this.lastMoveEventInfo, this.history);
22360 const isPanStarted = this.startEvent !== null;
22361 // Only start panning if the offset is larger than 3 pixels. If we make it
22362 // any larger than this we'll want to reset the pointer history
22363 // on the first update to avoid visual snapping to the cursoe.
22364 const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;
22365 if (!isPanStarted && !isDistancePastThreshold)
22366 return;
22367 const { point } = info;
22368 const { timestamp } = frameData;
22369 this.history.push({ ...point, timestamp });
22370 const { onStart, onMove } = this.handlers;
22371 if (!isPanStarted) {
22372 onStart && onStart(this.lastMoveEvent, info);
22373 this.startEvent = this.lastMoveEvent;
22374 }
22375 onMove && onMove(this.lastMoveEvent, info);
22376 };
22377 this.handlePointerMove = (event, info) => {
22378 this.lastMoveEvent = event;
22379 this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
22380 // Throttle mouse move event to once per frame
22381 frame_frame.update(this.updatePoint, true);
22382 };
22383 this.handlePointerUp = (event, info) => {
22384 this.end();
22385 const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
22386 if (this.dragSnapToOrigin)
22387 resumeAnimation && resumeAnimation();
22388 if (!(this.lastMoveEvent && this.lastMoveEventInfo))
22389 return;
22390 const panInfo = getPanInfo(event.type === "pointercancel"
22391 ? this.lastMoveEventInfo
22392 : transformPoint(info, this.transformPagePoint), this.history);
22393 if (this.startEvent && onEnd) {
22394 onEnd(event, panInfo);
22395 }
22396 onSessionEnd && onSessionEnd(event, panInfo);
22397 };
22398 // If we have more than one touch, don't start detecting this gesture
22399 if (!isPrimaryPointer(event))
22400 return;
22401 this.dragSnapToOrigin = dragSnapToOrigin;
22402 this.handlers = handlers;
22403 this.transformPagePoint = transformPagePoint;
22404 this.contextWindow = contextWindow || window;
22405 const info = extractEventInfo(event);
22406 const initialInfo = transformPoint(info, this.transformPagePoint);
22407 const { point } = initialInfo;
22408 const { timestamp } = frameData;
22409 this.history = [{ ...point, timestamp }];
22410 const { onSessionStart } = handlers;
22411 onSessionStart &&
22412 onSessionStart(event, getPanInfo(initialInfo, this.history));
22413 this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
22414 }
22415 updateHandlers(handlers) {
22416 this.handlers = handlers;
22417 }
22418 end() {
22419 this.removeListeners && this.removeListeners();
22420 cancelFrame(this.updatePoint);
22421 }
22422}
22423function transformPoint(info, transformPagePoint) {
22424 return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
22425}
22426function subtractPoint(a, b) {
22427 return { x: a.x - b.x, y: a.y - b.y };
22428}
22429function getPanInfo({ point }, history) {
22430 return {
22431 point,
22432 delta: subtractPoint(point, lastDevicePoint(history)),
22433 offset: subtractPoint(point, startDevicePoint(history)),
22434 velocity: getVelocity(history, 0.1),
22435 };
22436}
22437function startDevicePoint(history) {
22438 return history[0];
22439}
22440function lastDevicePoint(history) {
22441 return history[history.length - 1];
22442}
22443function getVelocity(history, timeDelta) {
22444 if (history.length < 2) {
22445 return { x: 0, y: 0 };
22446 }
22447 let i = history.length - 1;
22448 let timestampedPoint = null;
22449 const lastPoint = lastDevicePoint(history);
22450 while (i >= 0) {
22451 timestampedPoint = history[i];
22452 if (lastPoint.timestamp - timestampedPoint.timestamp >
22453 time_conversion_secondsToMilliseconds(timeDelta)) {
22454 break;
22455 }
22456 i--;
22457 }
22458 if (!timestampedPoint) {
22459 return { x: 0, y: 0 };
22460 }
22461 const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
22462 if (time === 0) {
22463 return { x: 0, y: 0 };
22464 }
22465 const currentVelocity = {
22466 x: (lastPoint.x - timestampedPoint.x) / time,
22467 y: (lastPoint.y - timestampedPoint.y) / time,
22468 };
22469 if (currentVelocity.x === Infinity) {
22470 currentVelocity.x = 0;
22471 }
22472 if (currentVelocity.y === Infinity) {
22473 currentVelocity.y = 0;
22474 }
22475 return currentVelocity;
22476}
22477
22478
22479
22480;// ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs
22481function isRefObject(ref) {
22482 return (ref &&
22483 typeof ref === "object" &&
22484 Object.prototype.hasOwnProperty.call(ref, "current"));
22485}
22486
22487
22488
22489;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs
22490
22491
22492const SCALE_PRECISION = 0.0001;
22493const SCALE_MIN = 1 - SCALE_PRECISION;
22494const SCALE_MAX = 1 + SCALE_PRECISION;
22495const TRANSLATE_PRECISION = 0.01;
22496const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;
22497const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;
22498function calcLength(axis) {
22499 return axis.max - axis.min;
22500}
22501function isNear(value, target, maxDistance) {
22502 return Math.abs(value - target) <= maxDistance;
22503}
22504function calcAxisDelta(delta, source, target, origin = 0.5) {
22505 delta.origin = origin;
22506 delta.originPoint = mixNumber(source.min, source.max, delta.origin);
22507 delta.scale = calcLength(target) / calcLength(source);
22508 delta.translate =
22509 mixNumber(target.min, target.max, delta.origin) - delta.originPoint;
22510 if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||
22511 isNaN(delta.scale)) {
22512 delta.scale = 1.0;
22513 }
22514 if ((delta.translate >= TRANSLATE_MIN &&
22515 delta.translate <= TRANSLATE_MAX) ||
22516 isNaN(delta.translate)) {
22517 delta.translate = 0.0;
22518 }
22519}
22520function calcBoxDelta(delta, source, target, origin) {
22521 calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);
22522 calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);
22523}
22524function calcRelativeAxis(target, relative, parent) {
22525 target.min = parent.min + relative.min;
22526 target.max = target.min + calcLength(relative);
22527}
22528function calcRelativeBox(target, relative, parent) {
22529 calcRelativeAxis(target.x, relative.x, parent.x);
22530 calcRelativeAxis(target.y, relative.y, parent.y);
22531}
22532function calcRelativeAxisPosition(target, layout, parent) {
22533 target.min = layout.min - parent.min;
22534 target.max = target.min + calcLength(layout);
22535}
22536function calcRelativePosition(target, layout, parent) {
22537 calcRelativeAxisPosition(target.x, layout.x, parent.x);
22538 calcRelativeAxisPosition(target.y, layout.y, parent.y);
22539}
22540
22541
22542
22543;// ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs
22544
22545
22546
22547
22548
22549/**
22550 * Apply constraints to a point. These constraints are both physical along an
22551 * axis, and an elastic factor that determines how much to constrain the point
22552 * by if it does lie outside the defined parameters.
22553 */
22554function applyConstraints(point, { min, max }, elastic) {
22555 if (min !== undefined && point < min) {
22556 // If we have a min point defined, and this is outside of that, constrain
22557 point = elastic
22558 ? mixNumber(min, point, elastic.min)
22559 : Math.max(point, min);
22560 }
22561 else if (max !== undefined && point > max) {
22562 // If we have a max point defined, and this is outside of that, constrain
22563 point = elastic
22564 ? mixNumber(max, point, elastic.max)
22565 : Math.min(point, max);
22566 }
22567 return point;
22568}
22569/**
22570 * Calculate constraints in terms of the viewport when defined relatively to the
22571 * measured axis. This is measured from the nearest edge, so a max constraint of 200
22572 * on an axis with a max value of 300 would return a constraint of 500 - axis length
22573 */
22574function calcRelativeAxisConstraints(axis, min, max) {
22575 return {
22576 min: min !== undefined ? axis.min + min : undefined,
22577 max: max !== undefined
22578 ? axis.max + max - (axis.max - axis.min)
22579 : undefined,
22580 };
22581}
22582/**
22583 * Calculate constraints in terms of the viewport when
22584 * defined relatively to the measured bounding box.
22585 */
22586function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
22587 return {
22588 x: calcRelativeAxisConstraints(layoutBox.x, left, right),
22589 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
22590 };
22591}
22592/**
22593 * Calculate viewport constraints when defined as another viewport-relative axis
22594 */
22595function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
22596 let min = constraintsAxis.min - layoutAxis.min;
22597 let max = constraintsAxis.max - layoutAxis.max;
22598 // If the constraints axis is actually smaller than the layout axis then we can
22599 // flip the constraints
22600 if (constraintsAxis.max - constraintsAxis.min <
22601 layoutAxis.max - layoutAxis.min) {
22602 [min, max] = [max, min];
22603 }
22604 return { min, max };
22605}
22606/**
22607 * Calculate viewport constraints when defined as another viewport-relative box
22608 */
22609function calcViewportConstraints(layoutBox, constraintsBox) {
22610 return {
22611 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
22612 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
22613 };
22614}
22615/**
22616 * Calculate a transform origin relative to the source axis, between 0-1, that results
22617 * in an asthetically pleasing scale/transform needed to project from source to target.
22618 */
22619function calcOrigin(source, target) {
22620 let origin = 0.5;
22621 const sourceLength = calcLength(source);
22622 const targetLength = calcLength(target);
22623 if (targetLength > sourceLength) {
22624 origin = progress(target.min, target.max - sourceLength, source.min);
22625 }
22626 else if (sourceLength > targetLength) {
22627 origin = progress(source.min, source.max - targetLength, target.min);
22628 }
22629 return clamp_clamp(0, 1, origin);
22630}
22631/**
22632 * Rebase the calculated viewport constraints relative to the layout.min point.
22633 */
22634function rebaseAxisConstraints(layout, constraints) {
22635 const relativeConstraints = {};
22636 if (constraints.min !== undefined) {
22637 relativeConstraints.min = constraints.min - layout.min;
22638 }
22639 if (constraints.max !== undefined) {
22640 relativeConstraints.max = constraints.max - layout.min;
22641 }
22642 return relativeConstraints;
22643}
22644const defaultElastic = 0.35;
22645/**
22646 * Accepts a dragElastic prop and returns resolved elastic values for each axis.
22647 */
22648function resolveDragElastic(dragElastic = defaultElastic) {
22649 if (dragElastic === false) {
22650 dragElastic = 0;
22651 }
22652 else if (dragElastic === true) {
22653 dragElastic = defaultElastic;
22654 }
22655 return {
22656 x: resolveAxisElastic(dragElastic, "left", "right"),
22657 y: resolveAxisElastic(dragElastic, "top", "bottom"),
22658 };
22659}
22660function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
22661 return {
22662 min: resolvePointElastic(dragElastic, minLabel),
22663 max: resolvePointElastic(dragElastic, maxLabel),
22664 };
22665}
22666function resolvePointElastic(dragElastic, label) {
22667 return typeof dragElastic === "number"
22668 ? dragElastic
22669 : dragElastic[label] || 0;
22670}
22671
22672
22673
22674;// ./node_modules/framer-motion/dist/es/projection/geometry/models.mjs
22675const createAxisDelta = () => ({
22676 translate: 0,
22677 scale: 1,
22678 origin: 0,
22679 originPoint: 0,
22680});
22681const createDelta = () => ({
22682 x: createAxisDelta(),
22683 y: createAxisDelta(),
22684});
22685const createAxis = () => ({ min: 0, max: 0 });
22686const createBox = () => ({
22687 x: createAxis(),
22688 y: createAxis(),
22689});
22690
22691
22692
22693;// ./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs
22694function eachAxis(callback) {
22695 return [callback("x"), callback("y")];
22696}
22697
22698
22699
22700;// ./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs
22701/**
22702 * Bounding boxes tend to be defined as top, left, right, bottom. For various operations
22703 * it's easier to consider each axis individually. This function returns a bounding box
22704 * as a map of single-axis min/max values.
22705 */
22706function convertBoundingBoxToBox({ top, left, right, bottom, }) {
22707 return {
22708 x: { min: left, max: right },
22709 y: { min: top, max: bottom },
22710 };
22711}
22712function convertBoxToBoundingBox({ x, y }) {
22713 return { top: y.min, right: x.max, bottom: y.max, left: x.min };
22714}
22715/**
22716 * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function
22717 * provided by Framer to allow measured points to be corrected for device scaling. This is used
22718 * when measuring DOM elements and DOM event points.
22719 */
22720function transformBoxPoints(point, transformPoint) {
22721 if (!transformPoint)
22722 return point;
22723 const topLeft = transformPoint({ x: point.left, y: point.top });
22724 const bottomRight = transformPoint({ x: point.right, y: point.bottom });
22725 return {
22726 top: topLeft.y,
22727 left: topLeft.x,
22728 bottom: bottomRight.y,
22729 right: bottomRight.x,
22730 };
22731}
22732
22733
22734
22735;// ./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs
22736function isIdentityScale(scale) {
22737 return scale === undefined || scale === 1;
22738}
22739function hasScale({ scale, scaleX, scaleY }) {
22740 return (!isIdentityScale(scale) ||
22741 !isIdentityScale(scaleX) ||
22742 !isIdentityScale(scaleY));
22743}
22744function hasTransform(values) {
22745 return (hasScale(values) ||
22746 has2DTranslate(values) ||
22747 values.z ||
22748 values.rotate ||
22749 values.rotateX ||
22750 values.rotateY ||
22751 values.skewX ||
22752 values.skewY);
22753}
22754function has2DTranslate(values) {
22755 return is2DTranslate(values.x) || is2DTranslate(values.y);
22756}
22757function is2DTranslate(value) {
22758 return value && value !== "0%";
22759}
22760
22761
22762
22763;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs
22764
22765
22766
22767/**
22768 * Scales a point based on a factor and an originPoint
22769 */
22770function scalePoint(point, scale, originPoint) {
22771 const distanceFromOrigin = point - originPoint;
22772 const scaled = scale * distanceFromOrigin;
22773 return originPoint + scaled;
22774}
22775/**
22776 * Applies a translate/scale delta to a point
22777 */
22778function applyPointDelta(point, translate, scale, originPoint, boxScale) {
22779 if (boxScale !== undefined) {
22780 point = scalePoint(point, boxScale, originPoint);
22781 }
22782 return scalePoint(point, scale, originPoint) + translate;
22783}
22784/**
22785 * Applies a translate/scale delta to an axis
22786 */
22787function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {
22788 axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);
22789 axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);
22790}
22791/**
22792 * Applies a translate/scale delta to a box
22793 */
22794function applyBoxDelta(box, { x, y }) {
22795 applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);
22796 applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);
22797}
22798const TREE_SCALE_SNAP_MIN = 0.999999999999;
22799const TREE_SCALE_SNAP_MAX = 1.0000000000001;
22800/**
22801 * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms
22802 * in a tree upon our box before then calculating how to project it into our desired viewport-relative box
22803 *
22804 * This is the final nested loop within updateLayoutDelta for future refactoring
22805 */
22806function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {
22807 const treeLength = treePath.length;
22808 if (!treeLength)
22809 return;
22810 // Reset the treeScale
22811 treeScale.x = treeScale.y = 1;
22812 let node;
22813 let delta;
22814 for (let i = 0; i < treeLength; i++) {
22815 node = treePath[i];
22816 delta = node.projectionDelta;
22817 /**
22818 * TODO: Prefer to remove this, but currently we have motion components with
22819 * display: contents in Framer.
22820 */
22821 const { visualElement } = node.options;
22822 if (visualElement &&
22823 visualElement.props.style &&
22824 visualElement.props.style.display === "contents") {
22825 continue;
22826 }
22827 if (isSharedTransition &&
22828 node.options.layoutScroll &&
22829 node.scroll &&
22830 node !== node.root) {
22831 transformBox(box, {
22832 x: -node.scroll.offset.x,
22833 y: -node.scroll.offset.y,
22834 });
22835 }
22836 if (delta) {
22837 // Incoporate each ancestor's scale into a culmulative treeScale for this component
22838 treeScale.x *= delta.x.scale;
22839 treeScale.y *= delta.y.scale;
22840 // Apply each ancestor's calculated delta into this component's recorded layout box
22841 applyBoxDelta(box, delta);
22842 }
22843 if (isSharedTransition && hasTransform(node.latestValues)) {
22844 transformBox(box, node.latestValues);
22845 }
22846 }
22847 /**
22848 * Snap tree scale back to 1 if it's within a non-perceivable threshold.
22849 * This will help reduce useless scales getting rendered.
22850 */
22851 if (treeScale.x < TREE_SCALE_SNAP_MAX &&
22852 treeScale.x > TREE_SCALE_SNAP_MIN) {
22853 treeScale.x = 1.0;
22854 }
22855 if (treeScale.y < TREE_SCALE_SNAP_MAX &&
22856 treeScale.y > TREE_SCALE_SNAP_MIN) {
22857 treeScale.y = 1.0;
22858 }
22859}
22860function translateAxis(axis, distance) {
22861 axis.min = axis.min + distance;
22862 axis.max = axis.max + distance;
22863}
22864/**
22865 * Apply a transform to an axis from the latest resolved motion values.
22866 * This function basically acts as a bridge between a flat motion value map
22867 * and applyAxisDelta
22868 */
22869function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {
22870 const originPoint = mixNumber(axis.min, axis.max, axisOrigin);
22871 // Apply the axis delta to the final axis
22872 applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);
22873}
22874/**
22875 * Apply a transform to a box from the latest resolved motion values.
22876 */
22877function transformBox(box, transform) {
22878 transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);
22879 transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);
22880}
22881
22882
22883
22884;// ./node_modules/framer-motion/dist/es/projection/utils/measure.mjs
22885
22886
22887
22888function measureViewportBox(instance, transformPoint) {
22889 return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));
22890}
22891function measurePageBox(element, rootProjectionNode, transformPagePoint) {
22892 const viewportBox = measureViewportBox(element, transformPagePoint);
22893 const { scroll } = rootProjectionNode;
22894 if (scroll) {
22895 translateAxis(viewportBox.x, scroll.offset.x);
22896 translateAxis(viewportBox.y, scroll.offset.y);
22897 }
22898 return viewportBox;
22899}
22900
22901
22902
22903;// ./node_modules/framer-motion/dist/es/utils/get-context-window.mjs
22904// Fixes https://github.com/motiondivision/motion/issues/2270
22905const getContextWindow = ({ current }) => {
22906 return current ? current.ownerDocument.defaultView : null;
22907};
22908
22909
22910
22911;// ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932const elementDragControls = new WeakMap();
22933/**
22934 *
22935 */
22936// let latestPointerEvent: PointerEvent
22937class VisualElementDragControls {
22938 constructor(visualElement) {
22939 this.openDragLock = null;
22940 this.isDragging = false;
22941 this.currentDirection = null;
22942 this.originPoint = { x: 0, y: 0 };
22943 /**
22944 * The permitted boundaries of travel, in pixels.
22945 */
22946 this.constraints = false;
22947 this.hasMutatedConstraints = false;
22948 /**
22949 * The per-axis resolved elastic values.
22950 */
22951 this.elastic = createBox();
22952 this.visualElement = visualElement;
22953 }
22954 start(originEvent, { snapToCursor = false } = {}) {
22955 /**
22956 * Don't start dragging if this component is exiting
22957 */
22958 const { presenceContext } = this.visualElement;
22959 if (presenceContext && presenceContext.isPresent === false)
22960 return;
22961 const onSessionStart = (event) => {
22962 const { dragSnapToOrigin } = this.getProps();
22963 // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch
22964 // the component.
22965 dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();
22966 if (snapToCursor) {
22967 this.snapToCursor(extractEventInfo(event).point);
22968 }
22969 };
22970 const onStart = (event, info) => {
22971 // Attempt to grab the global drag gesture lock - maybe make this part of PanSession
22972 const { drag, dragPropagation, onDragStart } = this.getProps();
22973 if (drag && !dragPropagation) {
22974 if (this.openDragLock)
22975 this.openDragLock();
22976 this.openDragLock = setDragLock(drag);
22977 // If we don 't have the lock, don't start dragging
22978 if (!this.openDragLock)
22979 return;
22980 }
22981 this.isDragging = true;
22982 this.currentDirection = null;
22983 this.resolveConstraints();
22984 if (this.visualElement.projection) {
22985 this.visualElement.projection.isAnimationBlocked = true;
22986 this.visualElement.projection.target = undefined;
22987 }
22988 /**
22989 * Record gesture origin
22990 */
22991 eachAxis((axis) => {
22992 let current = this.getAxisMotionValue(axis).get() || 0;
22993 /**
22994 * If the MotionValue is a percentage value convert to px
22995 */
22996 if (percent.test(current)) {
22997 const { projection } = this.visualElement;
22998 if (projection && projection.layout) {
22999 const measuredAxis = projection.layout.layoutBox[axis];
23000 if (measuredAxis) {
23001 const length = calcLength(measuredAxis);
23002 current = length * (parseFloat(current) / 100);
23003 }
23004 }
23005 }
23006 this.originPoint[axis] = current;
23007 });
23008 // Fire onDragStart event
23009 if (onDragStart) {
23010 frame_frame.postRender(() => onDragStart(event, info));
23011 }
23012 addValueToWillChange(this.visualElement, "transform");
23013 const { animationState } = this.visualElement;
23014 animationState && animationState.setActive("whileDrag", true);
23015 };
23016 const onMove = (event, info) => {
23017 // latestPointerEvent = event
23018 const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();
23019 // If we didn't successfully receive the gesture lock, early return.
23020 if (!dragPropagation && !this.openDragLock)
23021 return;
23022 const { offset } = info;
23023 // Attempt to detect drag direction if directionLock is true
23024 if (dragDirectionLock && this.currentDirection === null) {
23025 this.currentDirection = getCurrentDirection(offset);
23026 // If we've successfully set a direction, notify listener
23027 if (this.currentDirection !== null) {
23028 onDirectionLock && onDirectionLock(this.currentDirection);
23029 }
23030 return;
23031 }
23032 // Update each point with the latest position
23033 this.updateAxis("x", info.point, offset);
23034 this.updateAxis("y", info.point, offset);
23035 /**
23036 * Ideally we would leave the renderer to fire naturally at the end of
23037 * this frame but if the element is about to change layout as the result
23038 * of a re-render we want to ensure the browser can read the latest
23039 * bounding box to ensure the pointer and element don't fall out of sync.
23040 */
23041 this.visualElement.render();
23042 /**
23043 * This must fire after the render call as it might trigger a state
23044 * change which itself might trigger a layout update.
23045 */
23046 onDrag && onDrag(event, info);
23047 };
23048 const onSessionEnd = (event, info) => this.stop(event, info);
23049 const resumeAnimation = () => eachAxis((axis) => {
23050 var _a;
23051 return this.getAnimationState(axis) === "paused" &&
23052 ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());
23053 });
23054 const { dragSnapToOrigin } = this.getProps();
23055 this.panSession = new PanSession(originEvent, {
23056 onSessionStart,
23057 onStart,
23058 onMove,
23059 onSessionEnd,
23060 resumeAnimation,
23061 }, {
23062 transformPagePoint: this.visualElement.getTransformPagePoint(),
23063 dragSnapToOrigin,
23064 contextWindow: getContextWindow(this.visualElement),
23065 });
23066 }
23067 stop(event, info) {
23068 const isDragging = this.isDragging;
23069 this.cancel();
23070 if (!isDragging)
23071 return;
23072 const { velocity } = info;
23073 this.startAnimation(velocity);
23074 const { onDragEnd } = this.getProps();
23075 if (onDragEnd) {
23076 frame_frame.postRender(() => onDragEnd(event, info));
23077 }
23078 }
23079 cancel() {
23080 this.isDragging = false;
23081 const { projection, animationState } = this.visualElement;
23082 if (projection) {
23083 projection.isAnimationBlocked = false;
23084 }
23085 this.panSession && this.panSession.end();
23086 this.panSession = undefined;
23087 const { dragPropagation } = this.getProps();
23088 if (!dragPropagation && this.openDragLock) {
23089 this.openDragLock();
23090 this.openDragLock = null;
23091 }
23092 animationState && animationState.setActive("whileDrag", false);
23093 }
23094 updateAxis(axis, _point, offset) {
23095 const { drag } = this.getProps();
23096 // If we're not dragging this axis, do an early return.
23097 if (!offset || !shouldDrag(axis, drag, this.currentDirection))
23098 return;
23099 const axisValue = this.getAxisMotionValue(axis);
23100 let next = this.originPoint[axis] + offset[axis];
23101 // Apply constraints
23102 if (this.constraints && this.constraints[axis]) {
23103 next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
23104 }
23105 axisValue.set(next);
23106 }
23107 resolveConstraints() {
23108 var _a;
23109 const { dragConstraints, dragElastic } = this.getProps();
23110 const layout = this.visualElement.projection &&
23111 !this.visualElement.projection.layout
23112 ? this.visualElement.projection.measure(false)
23113 : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;
23114 const prevConstraints = this.constraints;
23115 if (dragConstraints && isRefObject(dragConstraints)) {
23116 if (!this.constraints) {
23117 this.constraints = this.resolveRefConstraints();
23118 }
23119 }
23120 else {
23121 if (dragConstraints && layout) {
23122 this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);
23123 }
23124 else {
23125 this.constraints = false;
23126 }
23127 }
23128 this.elastic = resolveDragElastic(dragElastic);
23129 /**
23130 * If we're outputting to external MotionValues, we want to rebase the measured constraints
23131 * from viewport-relative to component-relative.
23132 */
23133 if (prevConstraints !== this.constraints &&
23134 layout &&
23135 this.constraints &&
23136 !this.hasMutatedConstraints) {
23137 eachAxis((axis) => {
23138 if (this.constraints !== false &&
23139 this.getAxisMotionValue(axis)) {
23140 this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);
23141 }
23142 });
23143 }
23144 }
23145 resolveRefConstraints() {
23146 const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
23147 if (!constraints || !isRefObject(constraints))
23148 return false;
23149 const constraintsElement = constraints.current;
23150 errors_invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
23151 const { projection } = this.visualElement;
23152 // TODO
23153 if (!projection || !projection.layout)
23154 return false;
23155 const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
23156 let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
23157 /**
23158 * If there's an onMeasureDragConstraints listener we call it and
23159 * if different constraints are returned, set constraints to that
23160 */
23161 if (onMeasureDragConstraints) {
23162 const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));
23163 this.hasMutatedConstraints = !!userConstraints;
23164 if (userConstraints) {
23165 measuredConstraints = convertBoundingBoxToBox(userConstraints);
23166 }
23167 }
23168 return measuredConstraints;
23169 }
23170 startAnimation(velocity) {
23171 const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();
23172 const constraints = this.constraints || {};
23173 const momentumAnimations = eachAxis((axis) => {
23174 if (!shouldDrag(axis, drag, this.currentDirection)) {
23175 return;
23176 }
23177 let transition = (constraints && constraints[axis]) || {};
23178 if (dragSnapToOrigin)
23179 transition = { min: 0, max: 0 };
23180 /**
23181 * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
23182 * of spring animations so we should look into adding a disable spring option to `inertia`.
23183 * We could do something here where we affect the `bounceStiffness` and `bounceDamping`
23184 * using the value of `dragElastic`.
23185 */
23186 const bounceStiffness = dragElastic ? 200 : 1000000;
23187 const bounceDamping = dragElastic ? 40 : 10000000;
23188 const inertia = {
23189 type: "inertia",
23190 velocity: dragMomentum ? velocity[axis] : 0,
23191 bounceStiffness,
23192 bounceDamping,
23193 timeConstant: 750,
23194 restDelta: 1,
23195 restSpeed: 10,
23196 ...dragTransition,
23197 ...transition,
23198 };
23199 // If we're not animating on an externally-provided `MotionValue` we can use the
23200 // component's animation controls which will handle interactions with whileHover (etc),
23201 // otherwise we just have to animate the `MotionValue` itself.
23202 return this.startAxisValueAnimation(axis, inertia);
23203 });
23204 // Run all animations and then resolve the new drag constraints.
23205 return Promise.all(momentumAnimations).then(onDragTransitionEnd);
23206 }
23207 startAxisValueAnimation(axis, transition) {
23208 const axisValue = this.getAxisMotionValue(axis);
23209 addValueToWillChange(this.visualElement, axis);
23210 return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));
23211 }
23212 stopAnimation() {
23213 eachAxis((axis) => this.getAxisMotionValue(axis).stop());
23214 }
23215 pauseAnimation() {
23216 eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });
23217 }
23218 getAnimationState(axis) {
23219 var _a;
23220 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;
23221 }
23222 /**
23223 * Drag works differently depending on which props are provided.
23224 *
23225 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
23226 * - Otherwise, we apply the delta to the x/y motion values.
23227 */
23228 getAxisMotionValue(axis) {
23229 const dragKey = `_drag${axis.toUpperCase()}`;
23230 const props = this.visualElement.getProps();
23231 const externalMotionValue = props[dragKey];
23232 return externalMotionValue
23233 ? externalMotionValue
23234 : this.visualElement.getValue(axis, (props.initial
23235 ? props.initial[axis]
23236 : undefined) || 0);
23237 }
23238 snapToCursor(point) {
23239 eachAxis((axis) => {
23240 const { drag } = this.getProps();
23241 // If we're not dragging this axis, do an early return.
23242 if (!shouldDrag(axis, drag, this.currentDirection))
23243 return;
23244 const { projection } = this.visualElement;
23245 const axisValue = this.getAxisMotionValue(axis);
23246 if (projection && projection.layout) {
23247 const { min, max } = projection.layout.layoutBox[axis];
23248 axisValue.set(point[axis] - mixNumber(min, max, 0.5));
23249 }
23250 });
23251 }
23252 /**
23253 * When the viewport resizes we want to check if the measured constraints
23254 * have changed and, if so, reposition the element within those new constraints
23255 * relative to where it was before the resize.
23256 */
23257 scalePositionWithinConstraints() {
23258 if (!this.visualElement.current)
23259 return;
23260 const { drag, dragConstraints } = this.getProps();
23261 const { projection } = this.visualElement;
23262 if (!isRefObject(dragConstraints) || !projection || !this.constraints)
23263 return;
23264 /**
23265 * Stop current animations as there can be visual glitching if we try to do
23266 * this mid-animation
23267 */
23268 this.stopAnimation();
23269 /**
23270 * Record the relative position of the dragged element relative to the
23271 * constraints box and save as a progress value.
23272 */
23273 const boxProgress = { x: 0, y: 0 };
23274 eachAxis((axis) => {
23275 const axisValue = this.getAxisMotionValue(axis);
23276 if (axisValue && this.constraints !== false) {
23277 const latest = axisValue.get();
23278 boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
23279 }
23280 });
23281 /**
23282 * Update the layout of this element and resolve the latest drag constraints
23283 */
23284 const { transformTemplate } = this.visualElement.getProps();
23285 this.visualElement.current.style.transform = transformTemplate
23286 ? transformTemplate({}, "")
23287 : "none";
23288 projection.root && projection.root.updateScroll();
23289 projection.updateLayout();
23290 this.resolveConstraints();
23291 /**
23292 * For each axis, calculate the current progress of the layout axis
23293 * within the new constraints.
23294 */
23295 eachAxis((axis) => {
23296 if (!shouldDrag(axis, drag, null))
23297 return;
23298 /**
23299 * Calculate a new transform based on the previous box progress
23300 */
23301 const axisValue = this.getAxisMotionValue(axis);
23302 const { min, max } = this.constraints[axis];
23303 axisValue.set(mixNumber(min, max, boxProgress[axis]));
23304 });
23305 }
23306 addListeners() {
23307 if (!this.visualElement.current)
23308 return;
23309 elementDragControls.set(this.visualElement, this);
23310 const element = this.visualElement.current;
23311 /**
23312 * Attach a pointerdown event listener on this DOM element to initiate drag tracking.
23313 */
23314 const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
23315 const { drag, dragListener = true } = this.getProps();
23316 drag && dragListener && this.start(event);
23317 });
23318 const measureDragConstraints = () => {
23319 const { dragConstraints } = this.getProps();
23320 if (isRefObject(dragConstraints) && dragConstraints.current) {
23321 this.constraints = this.resolveRefConstraints();
23322 }
23323 };
23324 const { projection } = this.visualElement;
23325 const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
23326 if (projection && !projection.layout) {
23327 projection.root && projection.root.updateScroll();
23328 projection.updateLayout();
23329 }
23330 frame_frame.read(measureDragConstraints);
23331 /**
23332 * Attach a window resize listener to scale the draggable target within its defined
23333 * constraints as the window resizes.
23334 */
23335 const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
23336 /**
23337 * If the element's layout changes, calculate the delta and apply that to
23338 * the drag gesture's origin point.
23339 */
23340 const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
23341 if (this.isDragging && hasLayoutChanged) {
23342 eachAxis((axis) => {
23343 const motionValue = this.getAxisMotionValue(axis);
23344 if (!motionValue)
23345 return;
23346 this.originPoint[axis] += delta[axis].translate;
23347 motionValue.set(motionValue.get() + delta[axis].translate);
23348 });
23349 this.visualElement.render();
23350 }
23351 }));
23352 return () => {
23353 stopResizeListener();
23354 stopPointerListener();
23355 stopMeasureLayoutListener();
23356 stopLayoutUpdateListener && stopLayoutUpdateListener();
23357 };
23358 }
23359 getProps() {
23360 const props = this.visualElement.getProps();
23361 const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
23362 return {
23363 ...props,
23364 drag,
23365 dragDirectionLock,
23366 dragPropagation,
23367 dragConstraints,
23368 dragElastic,
23369 dragMomentum,
23370 };
23371 }
23372}
23373function shouldDrag(direction, drag, currentDirection) {
23374 return ((drag === true || drag === direction) &&
23375 (currentDirection === null || currentDirection === direction));
23376}
23377/**
23378 * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
23379 * than the provided threshold, return `null`.
23380 *
23381 * @param offset - The x/y offset from origin.
23382 * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
23383 */
23384function getCurrentDirection(offset, lockThreshold = 10) {
23385 let direction = null;
23386 if (Math.abs(offset.y) > lockThreshold) {
23387 direction = "y";
23388 }
23389 else if (Math.abs(offset.x) > lockThreshold) {
23390 direction = "x";
23391 }
23392 return direction;
23393}
23394
23395
23396
23397;// ./node_modules/framer-motion/dist/es/gestures/drag/index.mjs
23398
23399
23400
23401
23402class DragGesture extends Feature {
23403 constructor(node) {
23404 super(node);
23405 this.removeGroupControls = noop_noop;
23406 this.removeListeners = noop_noop;
23407 this.controls = new VisualElementDragControls(node);
23408 }
23409 mount() {
23410 // If we've been provided a DragControls for manual control over the drag gesture,
23411 // subscribe this component to it on mount.
23412 const { dragControls } = this.node.getProps();
23413 if (dragControls) {
23414 this.removeGroupControls = dragControls.subscribe(this.controls);
23415 }
23416 this.removeListeners = this.controls.addListeners() || noop_noop;
23417 }
23418 unmount() {
23419 this.removeGroupControls();
23420 this.removeListeners();
23421 }
23422}
23423
23424
23425
23426;// ./node_modules/framer-motion/dist/es/gestures/pan/index.mjs
23427
23428
23429
23430
23431
23432
23433
23434const asyncHandler = (handler) => (event, info) => {
23435 if (handler) {
23436 frame_frame.postRender(() => handler(event, info));
23437 }
23438};
23439class PanGesture extends Feature {
23440 constructor() {
23441 super(...arguments);
23442 this.removePointerDownListener = noop_noop;
23443 }
23444 onPointerDown(pointerDownEvent) {
23445 this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
23446 transformPagePoint: this.node.getTransformPagePoint(),
23447 contextWindow: getContextWindow(this.node),
23448 });
23449 }
23450 createPanHandlers() {
23451 const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
23452 return {
23453 onSessionStart: asyncHandler(onPanSessionStart),
23454 onStart: asyncHandler(onPanStart),
23455 onMove: onPan,
23456 onEnd: (event, info) => {
23457 delete this.session;
23458 if (onPanEnd) {
23459 frame_frame.postRender(() => onPanEnd(event, info));
23460 }
23461 },
23462 };
23463 }
23464 mount() {
23465 this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
23466 }
23467 update() {
23468 this.session && this.session.updateHandlers(this.createPanHandlers());
23469 }
23470 unmount() {
23471 this.removePointerDownListener();
23472 this.session && this.session.end();
23473 }
23474}
23475
23476
23477
23478;// ./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs
23479"use client";
23480
23481
23482/**
23483 * Internal, exported only for usage in Framer
23484 */
23485const SwitchLayoutGroupContext = (0,external_React_.createContext)({});
23486
23487
23488
23489;// ./node_modules/framer-motion/dist/es/projection/node/state.mjs
23490/**
23491 * This should only ever be modified on the client otherwise it'll
23492 * persist through server requests. If we need instanced states we
23493 * could lazy-init via root.
23494 */
23495const globalProjectionState = {
23496 /**
23497 * Global flag as to whether the tree has animated since the last time
23498 * we resized the window
23499 */
23500 hasAnimatedSinceResize: true,
23501 /**
23502 * We set this to true once, on the first update. Any nodes added to the tree beyond that
23503 * update will be given a `data-projection-id` attribute.
23504 */
23505 hasEverUpdated: false,
23506};
23507
23508
23509
23510;// ./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs
23511
23512
23513function pixelsToPercent(pixels, axis) {
23514 if (axis.max === axis.min)
23515 return 0;
23516 return (pixels / (axis.max - axis.min)) * 100;
23517}
23518/**
23519 * We always correct borderRadius as a percentage rather than pixels to reduce paints.
23520 * For example, if you are projecting a box that is 100px wide with a 10px borderRadius
23521 * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
23522 * borderRadius in both states. If we animate between the two in pixels that will trigger
23523 * a paint each time. If we animate between the two in percentage we'll avoid a paint.
23524 */
23525const correctBorderRadius = {
23526 correct: (latest, node) => {
23527 if (!node.target)
23528 return latest;
23529 /**
23530 * If latest is a string, if it's a percentage we can return immediately as it's
23531 * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.
23532 */
23533 if (typeof latest === "string") {
23534 if (px.test(latest)) {
23535 latest = parseFloat(latest);
23536 }
23537 else {
23538 return latest;
23539 }
23540 }
23541 /**
23542 * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
23543 * pixel value as a percentage of each axis
23544 */
23545 const x = pixelsToPercent(latest, node.target.x);
23546 const y = pixelsToPercent(latest, node.target.y);
23547 return `${x}% ${y}%`;
23548 },
23549};
23550
23551
23552
23553;// ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs
23554
23555
23556
23557const correctBoxShadow = {
23558 correct: (latest, { treeScale, projectionDelta }) => {
23559 const original = latest;
23560 const shadow = complex.parse(latest);
23561 // TODO: Doesn't support multiple shadows
23562 if (shadow.length > 5)
23563 return original;
23564 const template = complex.createTransformer(latest);
23565 const offset = typeof shadow[0] !== "number" ? 1 : 0;
23566 // Calculate the overall context scale
23567 const xScale = projectionDelta.x.scale * treeScale.x;
23568 const yScale = projectionDelta.y.scale * treeScale.y;
23569 shadow[0 + offset] /= xScale;
23570 shadow[1 + offset] /= yScale;
23571 /**
23572 * Ideally we'd correct x and y scales individually, but because blur and
23573 * spread apply to both we have to take a scale average and apply that instead.
23574 * We could potentially improve the outcome of this by incorporating the ratio between
23575 * the two scales.
23576 */
23577 const averageScale = mixNumber(xScale, yScale, 0.5);
23578 // Blur
23579 if (typeof shadow[2 + offset] === "number")
23580 shadow[2 + offset] /= averageScale;
23581 // Spread
23582 if (typeof shadow[3 + offset] === "number")
23583 shadow[3 + offset] /= averageScale;
23584 return template(shadow);
23585 },
23586};
23587
23588
23589
23590;// ./node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs
23591const scaleCorrectors = {};
23592function addScaleCorrector(correctors) {
23593 Object.assign(scaleCorrectors, correctors);
23594}
23595
23596
23597
23598;// ./node_modules/framer-motion/dist/es/frameloop/microtask.mjs
23599
23600
23601const { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);
23602
23603
23604
23605;// ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
23606"use client";
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619class MeasureLayoutWithContext extends external_React_.Component {
23620 /**
23621 * This only mounts projection nodes for components that
23622 * need measuring, we might want to do it for all components
23623 * in order to incorporate transforms
23624 */
23625 componentDidMount() {
23626 const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
23627 const { projection } = visualElement;
23628 addScaleCorrector(defaultScaleCorrectors);
23629 if (projection) {
23630 if (layoutGroup.group)
23631 layoutGroup.group.add(projection);
23632 if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
23633 switchLayoutGroup.register(projection);
23634 }
23635 projection.root.didUpdate();
23636 projection.addEventListener("animationComplete", () => {
23637 this.safeToRemove();
23638 });
23639 projection.setOptions({
23640 ...projection.options,
23641 onExitComplete: () => this.safeToRemove(),
23642 });
23643 }
23644 globalProjectionState.hasEverUpdated = true;
23645 }
23646 getSnapshotBeforeUpdate(prevProps) {
23647 const { layoutDependency, visualElement, drag, isPresent } = this.props;
23648 const projection = visualElement.projection;
23649 if (!projection)
23650 return null;
23651 /**
23652 * TODO: We use this data in relegate to determine whether to
23653 * promote a previous element. There's no guarantee its presence data
23654 * will have updated by this point - if a bug like this arises it will
23655 * have to be that we markForRelegation and then find a new lead some other way,
23656 * perhaps in didUpdate
23657 */
23658 projection.isPresent = isPresent;
23659 if (drag ||
23660 prevProps.layoutDependency !== layoutDependency ||
23661 layoutDependency === undefined) {
23662 projection.willUpdate();
23663 }
23664 else {
23665 this.safeToRemove();
23666 }
23667 if (prevProps.isPresent !== isPresent) {
23668 if (isPresent) {
23669 projection.promote();
23670 }
23671 else if (!projection.relegate()) {
23672 /**
23673 * If there's another stack member taking over from this one,
23674 * it's in charge of the exit animation and therefore should
23675 * be in charge of the safe to remove. Otherwise we call it here.
23676 */
23677 frame_frame.postRender(() => {
23678 const stack = projection.getStack();
23679 if (!stack || !stack.members.length) {
23680 this.safeToRemove();
23681 }
23682 });
23683 }
23684 }
23685 return null;
23686 }
23687 componentDidUpdate() {
23688 const { projection } = this.props.visualElement;
23689 if (projection) {
23690 projection.root.didUpdate();
23691 microtask.postRender(() => {
23692 if (!projection.currentAnimation && projection.isLead()) {
23693 this.safeToRemove();
23694 }
23695 });
23696 }
23697 }
23698 componentWillUnmount() {
23699 const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;
23700 const { projection } = visualElement;
23701 if (projection) {
23702 projection.scheduleCheckAfterUnmount();
23703 if (layoutGroup && layoutGroup.group)
23704 layoutGroup.group.remove(projection);
23705 if (promoteContext && promoteContext.deregister)
23706 promoteContext.deregister(projection);
23707 }
23708 }
23709 safeToRemove() {
23710 const { safeToRemove } = this.props;
23711 safeToRemove && safeToRemove();
23712 }
23713 render() {
23714 return null;
23715 }
23716}
23717function MeasureLayout(props) {
23718 const [isPresent, safeToRemove] = usePresence();
23719 const layoutGroup = (0,external_React_.useContext)(LayoutGroupContext);
23720 return ((0,external_ReactJSXRuntime_namespaceObject.jsx)(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: (0,external_React_.useContext)(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));
23721}
23722const defaultScaleCorrectors = {
23723 borderRadius: {
23724 ...correctBorderRadius,
23725 applyTo: [
23726 "borderTopLeftRadius",
23727 "borderTopRightRadius",
23728 "borderBottomLeftRadius",
23729 "borderBottomRightRadius",
23730 ],
23731 },
23732 borderTopLeftRadius: correctBorderRadius,
23733 borderTopRightRadius: correctBorderRadius,
23734 borderBottomLeftRadius: correctBorderRadius,
23735 borderBottomRightRadius: correctBorderRadius,
23736 boxShadow: correctBoxShadow,
23737};
23738
23739
23740
23741;// ./node_modules/framer-motion/dist/es/animation/animate/single-value.mjs
23742
23743
23744
23745
23746function animateSingleValue(value, keyframes, options) {
23747 const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
23748 motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options));
23749 return motionValue$1.animation;
23750}
23751
23752
23753
23754;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs
23755function isSVGElement(element) {
23756 return element instanceof SVGElement && element.tagName !== "svg";
23757}
23758
23759
23760
23761;// ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs
23762const compareByDepth = (a, b) => a.depth - b.depth;
23763
23764
23765
23766;// ./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs
23767
23768
23769
23770class FlatTree {
23771 constructor() {
23772 this.children = [];
23773 this.isDirty = false;
23774 }
23775 add(child) {
23776 addUniqueItem(this.children, child);
23777 this.isDirty = true;
23778 }
23779 remove(child) {
23780 removeItem(this.children, child);
23781 this.isDirty = true;
23782 }
23783 forEach(callback) {
23784 this.isDirty && this.children.sort(compareByDepth);
23785 this.isDirty = false;
23786 this.children.forEach(callback);
23787 }
23788}
23789
23790
23791
23792;// ./node_modules/framer-motion/dist/es/utils/delay.mjs
23793
23794
23795
23796
23797/**
23798 * Timeout defined in ms
23799 */
23800function delay(callback, timeout) {
23801 const start = time.now();
23802 const checkElapsed = ({ timestamp }) => {
23803 const elapsed = timestamp - start;
23804 if (elapsed >= timeout) {
23805 cancelFrame(checkElapsed);
23806 callback(elapsed - timeout);
23807 }
23808 };
23809 frame_frame.read(checkElapsed, true);
23810 return () => cancelFrame(checkElapsed);
23811}
23812function delayInSeconds(callback, timeout) {
23813 return delay(callback, secondsToMilliseconds(timeout));
23814}
23815
23816
23817
23818;// ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs
23819
23820
23821
23822/**
23823 * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
23824 *
23825 * TODO: Remove and move to library
23826 */
23827function resolveMotionValue(value) {
23828 const unwrappedValue = isMotionValue(value) ? value.get() : value;
23829 return isCustomValue(unwrappedValue)
23830 ? unwrappedValue.toValue()
23831 : unwrappedValue;
23832}
23833
23834
23835
23836;// ./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs
23837
23838
23839
23840
23841
23842const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"];
23843const numBorders = borders.length;
23844const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value;
23845const isPx = (value) => typeof value === "number" || px.test(value);
23846function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {
23847 if (shouldCrossfadeOpacity) {
23848 target.opacity = mixNumber(0,
23849 // TODO Reinstate this if only child
23850 lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));
23851 target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));
23852 }
23853 else if (isOnlyMember) {
23854 target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);
23855 }
23856 /**
23857 * Mix border radius
23858 */
23859 for (let i = 0; i < numBorders; i++) {
23860 const borderLabel = `border${borders[i]}Radius`;
23861 let followRadius = getRadius(follow, borderLabel);
23862 let leadRadius = getRadius(lead, borderLabel);
23863 if (followRadius === undefined && leadRadius === undefined)
23864 continue;
23865 followRadius || (followRadius = 0);
23866 leadRadius || (leadRadius = 0);
23867 const canMix = followRadius === 0 ||
23868 leadRadius === 0 ||
23869 isPx(followRadius) === isPx(leadRadius);
23870 if (canMix) {
23871 target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);
23872 if (percent.test(leadRadius) || percent.test(followRadius)) {
23873 target[borderLabel] += "%";
23874 }
23875 }
23876 else {
23877 target[borderLabel] = leadRadius;
23878 }
23879 }
23880 /**
23881 * Mix rotation
23882 */
23883 if (follow.rotate || lead.rotate) {
23884 target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);
23885 }
23886}
23887function getRadius(values, radiusName) {
23888 return values[radiusName] !== undefined
23889 ? values[radiusName]
23890 : values.borderRadius;
23891}
23892// /**
23893// * We only want to mix the background color if there's a follow element
23894// * that we're not crossfading opacity between. For instance with switch
23895// * AnimateSharedLayout animations, this helps the illusion of a continuous
23896// * element being animated but also cuts down on the number of paints triggered
23897// * for elements where opacity is doing that work for us.
23898// */
23899// if (
23900// !hasFollowElement &&
23901// latestLeadValues.backgroundColor &&
23902// latestFollowValues.backgroundColor
23903// ) {
23904// /**
23905// * This isn't ideal performance-wise as mixColor is creating a new function every frame.
23906// * We could probably create a mixer that runs at the start of the animation but
23907// * the idea behind the crossfader is that it runs dynamically between two potentially
23908// * changing targets (ie opacity or borderRadius may be animating independently via variants)
23909// */
23910// leadState.backgroundColor = followState.backgroundColor = mixColor(
23911// latestFollowValues.backgroundColor as string,
23912// latestLeadValues.backgroundColor as string
23913// )(p)
23914// }
23915const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);
23916const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop_noop);
23917function compress(min, max, easing) {
23918 return (p) => {
23919 // Could replace ifs with clamp
23920 if (p < min)
23921 return 0;
23922 if (p > max)
23923 return 1;
23924 return easing(progress(min, max, p));
23925 };
23926}
23927
23928
23929
23930;// ./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs
23931/**
23932 * Reset an axis to the provided origin box.
23933 *
23934 * This is a mutative operation.
23935 */
23936function copyAxisInto(axis, originAxis) {
23937 axis.min = originAxis.min;
23938 axis.max = originAxis.max;
23939}
23940/**
23941 * Reset a box to the provided origin box.
23942 *
23943 * This is a mutative operation.
23944 */
23945function copyBoxInto(box, originBox) {
23946 copyAxisInto(box.x, originBox.x);
23947 copyAxisInto(box.y, originBox.y);
23948}
23949/**
23950 * Reset a delta to the provided origin box.
23951 *
23952 * This is a mutative operation.
23953 */
23954function copyAxisDeltaInto(delta, originDelta) {
23955 delta.translate = originDelta.translate;
23956 delta.scale = originDelta.scale;
23957 delta.originPoint = originDelta.originPoint;
23958 delta.origin = originDelta.origin;
23959}
23960
23961
23962
23963;// ./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs
23964
23965
23966
23967
23968/**
23969 * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse
23970 */
23971function removePointDelta(point, translate, scale, originPoint, boxScale) {
23972 point -= translate;
23973 point = scalePoint(point, 1 / scale, originPoint);
23974 if (boxScale !== undefined) {
23975 point = scalePoint(point, 1 / boxScale, originPoint);
23976 }
23977 return point;
23978}
23979/**
23980 * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse
23981 */
23982function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {
23983 if (percent.test(translate)) {
23984 translate = parseFloat(translate);
23985 const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);
23986 translate = relativeProgress - sourceAxis.min;
23987 }
23988 if (typeof translate !== "number")
23989 return;
23990 let originPoint = mixNumber(originAxis.min, originAxis.max, origin);
23991 if (axis === originAxis)
23992 originPoint -= translate;
23993 axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);
23994 axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);
23995}
23996/**
23997 * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
23998 * and acts as a bridge between motion values and removeAxisDelta
23999 */
24000function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {
24001 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);
24002}
24003/**
24004 * The names of the motion values we want to apply as translation, scale and origin.
24005 */
24006const xKeys = ["x", "scaleX", "originX"];
24007const yKeys = ["y", "scaleY", "originY"];
24008/**
24009 * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
24010 * and acts as a bridge between motion values and removeAxisDelta
24011 */
24012function removeBoxTransforms(box, transforms, originBox, sourceBox) {
24013 removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);
24014 removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);
24015}
24016
24017
24018
24019;// ./node_modules/framer-motion/dist/es/projection/geometry/utils.mjs
24020
24021
24022function isAxisDeltaZero(delta) {
24023 return delta.translate === 0 && delta.scale === 1;
24024}
24025function isDeltaZero(delta) {
24026 return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
24027}
24028function axisEquals(a, b) {
24029 return a.min === b.min && a.max === b.max;
24030}
24031function boxEquals(a, b) {
24032 return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);
24033}
24034function axisEqualsRounded(a, b) {
24035 return (Math.round(a.min) === Math.round(b.min) &&
24036 Math.round(a.max) === Math.round(b.max));
24037}
24038function boxEqualsRounded(a, b) {
24039 return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);
24040}
24041function aspectRatio(box) {
24042 return calcLength(box.x) / calcLength(box.y);
24043}
24044function axisDeltaEquals(a, b) {
24045 return (a.translate === b.translate &&
24046 a.scale === b.scale &&
24047 a.originPoint === b.originPoint);
24048}
24049
24050
24051
24052;// ./node_modules/framer-motion/dist/es/projection/shared/stack.mjs
24053
24054
24055class NodeStack {
24056 constructor() {
24057 this.members = [];
24058 }
24059 add(node) {
24060 addUniqueItem(this.members, node);
24061 node.scheduleRender();
24062 }
24063 remove(node) {
24064 removeItem(this.members, node);
24065 if (node === this.prevLead) {
24066 this.prevLead = undefined;
24067 }
24068 if (node === this.lead) {
24069 const prevLead = this.members[this.members.length - 1];
24070 if (prevLead) {
24071 this.promote(prevLead);
24072 }
24073 }
24074 }
24075 relegate(node) {
24076 const indexOfNode = this.members.findIndex((member) => node === member);
24077 if (indexOfNode === 0)
24078 return false;
24079 /**
24080 * Find the next projection node that is present
24081 */
24082 let prevLead;
24083 for (let i = indexOfNode; i >= 0; i--) {
24084 const member = this.members[i];
24085 if (member.isPresent !== false) {
24086 prevLead = member;
24087 break;
24088 }
24089 }
24090 if (prevLead) {
24091 this.promote(prevLead);
24092 return true;
24093 }
24094 else {
24095 return false;
24096 }
24097 }
24098 promote(node, preserveFollowOpacity) {
24099 const prevLead = this.lead;
24100 if (node === prevLead)
24101 return;
24102 this.prevLead = prevLead;
24103 this.lead = node;
24104 node.show();
24105 if (prevLead) {
24106 prevLead.instance && prevLead.scheduleRender();
24107 node.scheduleRender();
24108 node.resumeFrom = prevLead;
24109 if (preserveFollowOpacity) {
24110 node.resumeFrom.preserveOpacity = true;
24111 }
24112 if (prevLead.snapshot) {
24113 node.snapshot = prevLead.snapshot;
24114 node.snapshot.latestValues =
24115 prevLead.animationValues || prevLead.latestValues;
24116 }
24117 if (node.root && node.root.isUpdating) {
24118 node.isLayoutDirty = true;
24119 }
24120 const { crossfade } = node.options;
24121 if (crossfade === false) {
24122 prevLead.hide();
24123 }
24124 /**
24125 * TODO:
24126 * - Test border radius when previous node was deleted
24127 * - boxShadow mixing
24128 * - Shared between element A in scrolled container and element B (scroll stays the same or changes)
24129 * - Shared between element A in transformed container and element B (transform stays the same or changes)
24130 * - Shared between element A in scrolled page and element B (scroll stays the same or changes)
24131 * ---
24132 * - Crossfade opacity of root nodes
24133 * - layoutId changes after animation
24134 * - layoutId changes mid animation
24135 */
24136 }
24137 }
24138 exitAnimationComplete() {
24139 this.members.forEach((node) => {
24140 const { options, resumingFrom } = node;
24141 options.onExitComplete && options.onExitComplete();
24142 if (resumingFrom) {
24143 resumingFrom.options.onExitComplete &&
24144 resumingFrom.options.onExitComplete();
24145 }
24146 });
24147 }
24148 scheduleRender() {
24149 this.members.forEach((node) => {
24150 node.instance && node.scheduleRender(false);
24151 });
24152 }
24153 /**
24154 * Clear any leads that have been removed this render to prevent them from being
24155 * used in future animations and to prevent memory leaks
24156 */
24157 removeLeadSnapshot() {
24158 if (this.lead && this.lead.snapshot) {
24159 this.lead.snapshot = undefined;
24160 }
24161 }
24162}
24163
24164
24165
24166;// ./node_modules/framer-motion/dist/es/projection/styles/transform.mjs
24167function buildProjectionTransform(delta, treeScale, latestTransform) {
24168 let transform = "";
24169 /**
24170 * The translations we use to calculate are always relative to the viewport coordinate space.
24171 * But when we apply scales, we also scale the coordinate space of an element and its children.
24172 * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need
24173 * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.
24174 */
24175 const xTranslate = delta.x.translate / treeScale.x;
24176 const yTranslate = delta.y.translate / treeScale.y;
24177 const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0;
24178 if (xTranslate || yTranslate || zTranslate) {
24179 transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;
24180 }
24181 /**
24182 * Apply scale correction for the tree transform.
24183 * This will apply scale to the screen-orientated axes.
24184 */
24185 if (treeScale.x !== 1 || treeScale.y !== 1) {
24186 transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;
24187 }
24188 if (latestTransform) {
24189 const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;
24190 if (transformPerspective)
24191 transform = `perspective(${transformPerspective}px) ${transform}`;
24192 if (rotate)
24193 transform += `rotate(${rotate}deg) `;
24194 if (rotateX)
24195 transform += `rotateX(${rotateX}deg) `;
24196 if (rotateY)
24197 transform += `rotateY(${rotateY}deg) `;
24198 if (skewX)
24199 transform += `skewX(${skewX}deg) `;
24200 if (skewY)
24201 transform += `skewY(${skewY}deg) `;
24202 }
24203 /**
24204 * Apply scale to match the size of the element to the size we want it.
24205 * This will apply scale to the element-orientated axes.
24206 */
24207 const elementScaleX = delta.x.scale * treeScale.x;
24208 const elementScaleY = delta.y.scale * treeScale.y;
24209 if (elementScaleX !== 1 || elementScaleY !== 1) {
24210 transform += `scale(${elementScaleX}, ${elementScaleY})`;
24211 }
24212 return transform || "none";
24213}
24214
24215
24216
24217;// ./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246const metrics = {
24247 type: "projectionFrame",
24248 totalNodes: 0,
24249 resolvedTargetDeltas: 0,
24250 recalculatedProjection: 0,
24251};
24252const isDebug = typeof window !== "undefined" && window.MotionDebug !== undefined;
24253const transformAxes = ["", "X", "Y", "Z"];
24254const hiddenVisibility = { visibility: "hidden" };
24255/**
24256 * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1
24257 * which has a noticeable difference in spring animations
24258 */
24259const animationTarget = 1000;
24260let create_projection_node_id = 0;
24261function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {
24262 const { latestValues } = visualElement;
24263 // Record the distorting transform and then temporarily set it to 0
24264 if (latestValues[key]) {
24265 values[key] = latestValues[key];
24266 visualElement.setStaticValue(key, 0);
24267 if (sharedAnimationValues) {
24268 sharedAnimationValues[key] = 0;
24269 }
24270 }
24271}
24272function cancelTreeOptimisedTransformAnimations(projectionNode) {
24273 projectionNode.hasCheckedOptimisedAppear = true;
24274 if (projectionNode.root === projectionNode)
24275 return;
24276 const { visualElement } = projectionNode.options;
24277 if (!visualElement)
24278 return;
24279 const appearId = getOptimisedAppearId(visualElement);
24280 if (window.MotionHasOptimisedAnimation(appearId, "transform")) {
24281 const { layout, layoutId } = projectionNode.options;
24282 window.MotionCancelOptimisedAnimation(appearId, "transform", frame_frame, !(layout || layoutId));
24283 }
24284 const { parent } = projectionNode;
24285 if (parent && !parent.hasCheckedOptimisedAppear) {
24286 cancelTreeOptimisedTransformAnimations(parent);
24287 }
24288}
24289function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
24290 return class ProjectionNode {
24291 constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
24292 /**
24293 * A unique ID generated for every projection node.
24294 */
24295 this.id = create_projection_node_id++;
24296 /**
24297 * An id that represents a unique session instigated by startUpdate.
24298 */
24299 this.animationId = 0;
24300 /**
24301 * A Set containing all this component's children. This is used to iterate
24302 * through the children.
24303 *
24304 * TODO: This could be faster to iterate as a flat array stored on the root node.
24305 */
24306 this.children = new Set();
24307 /**
24308 * Options for the node. We use this to configure what kind of layout animations
24309 * we should perform (if any).
24310 */
24311 this.options = {};
24312 /**
24313 * We use this to detect when its safe to shut down part of a projection tree.
24314 * We have to keep projecting children for scale correction and relative projection
24315 * until all their parents stop performing layout animations.
24316 */
24317 this.isTreeAnimating = false;
24318 this.isAnimationBlocked = false;
24319 /**
24320 * Flag to true if we think this layout has been changed. We can't always know this,
24321 * currently we set it to true every time a component renders, or if it has a layoutDependency
24322 * if that has changed between renders. Additionally, components can be grouped by LayoutGroup
24323 * and if one node is dirtied, they all are.
24324 */
24325 this.isLayoutDirty = false;
24326 /**
24327 * Flag to true if we think the projection calculations for this node needs
24328 * recalculating as a result of an updated transform or layout animation.
24329 */
24330 this.isProjectionDirty = false;
24331 /**
24332 * Flag to true if the layout *or* transform has changed. This then gets propagated
24333 * throughout the projection tree, forcing any element below to recalculate on the next frame.
24334 */
24335 this.isSharedProjectionDirty = false;
24336 /**
24337 * Flag transform dirty. This gets propagated throughout the whole tree but is only
24338 * respected by shared nodes.
24339 */
24340 this.isTransformDirty = false;
24341 /**
24342 * Block layout updates for instant layout transitions throughout the tree.
24343 */
24344 this.updateManuallyBlocked = false;
24345 this.updateBlockedByResize = false;
24346 /**
24347 * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`
24348 * call.
24349 */
24350 this.isUpdating = false;
24351 /**
24352 * If this is an SVG element we currently disable projection transforms
24353 */
24354 this.isSVG = false;
24355 /**
24356 * Flag to true (during promotion) if a node doing an instant layout transition needs to reset
24357 * its projection styles.
24358 */
24359 this.needsReset = false;
24360 /**
24361 * Flags whether this node should have its transform reset prior to measuring.
24362 */
24363 this.shouldResetTransform = false;
24364 /**
24365 * Store whether this node has been checked for optimised appear animations. As
24366 * effects fire bottom-up, and we want to look up the tree for appear animations,
24367 * this makes sure we only check each path once, stopping at nodes that
24368 * have already been checked.
24369 */
24370 this.hasCheckedOptimisedAppear = false;
24371 /**
24372 * An object representing the calculated contextual/accumulated/tree scale.
24373 * This will be used to scale calculcated projection transforms, as these are
24374 * calculated in screen-space but need to be scaled for elements to layoutly
24375 * make it to their calculated destinations.
24376 *
24377 * TODO: Lazy-init
24378 */
24379 this.treeScale = { x: 1, y: 1 };
24380 /**
24381 *
24382 */
24383 this.eventHandlers = new Map();
24384 this.hasTreeAnimated = false;
24385 // Note: Currently only running on root node
24386 this.updateScheduled = false;
24387 this.scheduleUpdate = () => this.update();
24388 this.projectionUpdateScheduled = false;
24389 this.checkUpdateFailed = () => {
24390 if (this.isUpdating) {
24391 this.isUpdating = false;
24392 this.clearAllSnapshots();
24393 }
24394 };
24395 /**
24396 * This is a multi-step process as shared nodes might be of different depths. Nodes
24397 * are sorted by depth order, so we need to resolve the entire tree before moving to
24398 * the next step.
24399 */
24400 this.updateProjection = () => {
24401 this.projectionUpdateScheduled = false;
24402 /**
24403 * Reset debug counts. Manually resetting rather than creating a new
24404 * object each frame.
24405 */
24406 if (isDebug) {
24407 metrics.totalNodes =
24408 metrics.resolvedTargetDeltas =
24409 metrics.recalculatedProjection =
24410 0;
24411 }
24412 this.nodes.forEach(propagateDirtyNodes);
24413 this.nodes.forEach(resolveTargetDelta);
24414 this.nodes.forEach(calcProjection);
24415 this.nodes.forEach(cleanDirtyNodes);
24416 if (isDebug) {
24417 window.MotionDebug.record(metrics);
24418 }
24419 };
24420 /**
24421 * Frame calculations
24422 */
24423 this.resolvedRelativeTargetAt = 0.0;
24424 this.hasProjected = false;
24425 this.isVisible = true;
24426 this.animationProgress = 0;
24427 /**
24428 * Shared layout
24429 */
24430 // TODO Only running on root node
24431 this.sharedNodes = new Map();
24432 this.latestValues = latestValues;
24433 this.root = parent ? parent.root || parent : this;
24434 this.path = parent ? [...parent.path, parent] : [];
24435 this.parent = parent;
24436 this.depth = parent ? parent.depth + 1 : 0;
24437 for (let i = 0; i < this.path.length; i++) {
24438 this.path[i].shouldResetTransform = true;
24439 }
24440 if (this.root === this)
24441 this.nodes = new FlatTree();
24442 }
24443 addEventListener(name, handler) {
24444 if (!this.eventHandlers.has(name)) {
24445 this.eventHandlers.set(name, new SubscriptionManager());
24446 }
24447 return this.eventHandlers.get(name).add(handler);
24448 }
24449 notifyListeners(name, ...args) {
24450 const subscriptionManager = this.eventHandlers.get(name);
24451 subscriptionManager && subscriptionManager.notify(...args);
24452 }
24453 hasListeners(name) {
24454 return this.eventHandlers.has(name);
24455 }
24456 /**
24457 * Lifecycles
24458 */
24459 mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {
24460 if (this.instance)
24461 return;
24462 this.isSVG = isSVGElement(instance);
24463 this.instance = instance;
24464 const { layoutId, layout, visualElement } = this.options;
24465 if (visualElement && !visualElement.current) {
24466 visualElement.mount(instance);
24467 }
24468 this.root.nodes.add(this);
24469 this.parent && this.parent.children.add(this);
24470 if (isLayoutDirty && (layout || layoutId)) {
24471 this.isLayoutDirty = true;
24472 }
24473 if (attachResizeListener) {
24474 let cancelDelay;
24475 const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);
24476 attachResizeListener(instance, () => {
24477 this.root.updateBlockedByResize = true;
24478 cancelDelay && cancelDelay();
24479 cancelDelay = delay(resizeUnblockUpdate, 250);
24480 if (globalProjectionState.hasAnimatedSinceResize) {
24481 globalProjectionState.hasAnimatedSinceResize = false;
24482 this.nodes.forEach(finishAnimation);
24483 }
24484 });
24485 }
24486 if (layoutId) {
24487 this.root.registerSharedNode(layoutId, this);
24488 }
24489 // Only register the handler if it requires layout animation
24490 if (this.options.animate !== false &&
24491 visualElement &&
24492 (layoutId || layout)) {
24493 this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {
24494 if (this.isTreeAnimationBlocked()) {
24495 this.target = undefined;
24496 this.relativeTarget = undefined;
24497 return;
24498 }
24499 // TODO: Check here if an animation exists
24500 const layoutTransition = this.options.transition ||
24501 visualElement.getDefaultTransition() ||
24502 defaultLayoutTransition;
24503 const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();
24504 /**
24505 * The target layout of the element might stay the same,
24506 * but its position relative to its parent has changed.
24507 */
24508 const targetChanged = !this.targetLayout ||
24509 !boxEqualsRounded(this.targetLayout, newLayout) ||
24510 hasRelativeTargetChanged;
24511 /**
24512 * If the layout hasn't seemed to have changed, it might be that the
24513 * element is visually in the same place in the document but its position
24514 * relative to its parent has indeed changed. So here we check for that.
24515 */
24516 const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;
24517 if (this.options.layoutRoot ||
24518 (this.resumeFrom && this.resumeFrom.instance) ||
24519 hasOnlyRelativeTargetChanged ||
24520 (hasLayoutChanged &&
24521 (targetChanged || !this.currentAnimation))) {
24522 if (this.resumeFrom) {
24523 this.resumingFrom = this.resumeFrom;
24524 this.resumingFrom.resumingFrom = undefined;
24525 }
24526 this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
24527 const animationOptions = {
24528 ...get_value_transition_getValueTransition(layoutTransition, "layout"),
24529 onPlay: onLayoutAnimationStart,
24530 onComplete: onLayoutAnimationComplete,
24531 };
24532 if (visualElement.shouldReduceMotion ||
24533 this.options.layoutRoot) {
24534 animationOptions.delay = 0;
24535 animationOptions.type = false;
24536 }
24537 this.startAnimation(animationOptions);
24538 }
24539 else {
24540 /**
24541 * If the layout hasn't changed and we have an animation that hasn't started yet,
24542 * finish it immediately. Otherwise it will be animating from a location
24543 * that was probably never commited to screen and look like a jumpy box.
24544 */
24545 if (!hasLayoutChanged) {
24546 finishAnimation(this);
24547 }
24548 if (this.isLead() && this.options.onExitComplete) {
24549 this.options.onExitComplete();
24550 }
24551 }
24552 this.targetLayout = newLayout;
24553 });
24554 }
24555 }
24556 unmount() {
24557 this.options.layoutId && this.willUpdate();
24558 this.root.nodes.remove(this);
24559 const stack = this.getStack();
24560 stack && stack.remove(this);
24561 this.parent && this.parent.children.delete(this);
24562 this.instance = undefined;
24563 cancelFrame(this.updateProjection);
24564 }
24565 // only on the root
24566 blockUpdate() {
24567 this.updateManuallyBlocked = true;
24568 }
24569 unblockUpdate() {
24570 this.updateManuallyBlocked = false;
24571 }
24572 isUpdateBlocked() {
24573 return this.updateManuallyBlocked || this.updateBlockedByResize;
24574 }
24575 isTreeAnimationBlocked() {
24576 return (this.isAnimationBlocked ||
24577 (this.parent && this.parent.isTreeAnimationBlocked()) ||
24578 false);
24579 }
24580 // Note: currently only running on root node
24581 startUpdate() {
24582 if (this.isUpdateBlocked())
24583 return;
24584 this.isUpdating = true;
24585 this.nodes && this.nodes.forEach(resetSkewAndRotation);
24586 this.animationId++;
24587 }
24588 getTransformTemplate() {
24589 const { visualElement } = this.options;
24590 return visualElement && visualElement.getProps().transformTemplate;
24591 }
24592 willUpdate(shouldNotifyListeners = true) {
24593 this.root.hasTreeAnimated = true;
24594 if (this.root.isUpdateBlocked()) {
24595 this.options.onExitComplete && this.options.onExitComplete();
24596 return;
24597 }
24598 /**
24599 * If we're running optimised appear animations then these must be
24600 * cancelled before measuring the DOM. This is so we can measure
24601 * the true layout of the element rather than the WAAPI animation
24602 * which will be unaffected by the resetSkewAndRotate step.
24603 *
24604 * Note: This is a DOM write. Worst case scenario is this is sandwiched
24605 * between other snapshot reads which will cause unnecessary style recalculations.
24606 * This has to happen here though, as we don't yet know which nodes will need
24607 * snapshots in startUpdate(), but we only want to cancel optimised animations
24608 * if a layout animation measurement is actually going to be affected by them.
24609 */
24610 if (window.MotionCancelOptimisedAnimation &&
24611 !this.hasCheckedOptimisedAppear) {
24612 cancelTreeOptimisedTransformAnimations(this);
24613 }
24614 !this.root.isUpdating && this.root.startUpdate();
24615 if (this.isLayoutDirty)
24616 return;
24617 this.isLayoutDirty = true;
24618 for (let i = 0; i < this.path.length; i++) {
24619 const node = this.path[i];
24620 node.shouldResetTransform = true;
24621 node.updateScroll("snapshot");
24622 if (node.options.layoutRoot) {
24623 node.willUpdate(false);
24624 }
24625 }
24626 const { layoutId, layout } = this.options;
24627 if (layoutId === undefined && !layout)
24628 return;
24629 const transformTemplate = this.getTransformTemplate();
24630 this.prevTransformTemplateValue = transformTemplate
24631 ? transformTemplate(this.latestValues, "")
24632 : undefined;
24633 this.updateSnapshot();
24634 shouldNotifyListeners && this.notifyListeners("willUpdate");
24635 }
24636 update() {
24637 this.updateScheduled = false;
24638 const updateWasBlocked = this.isUpdateBlocked();
24639 // When doing an instant transition, we skip the layout update,
24640 // but should still clean up the measurements so that the next
24641 // snapshot could be taken correctly.
24642 if (updateWasBlocked) {
24643 this.unblockUpdate();
24644 this.clearAllSnapshots();
24645 this.nodes.forEach(clearMeasurements);
24646 return;
24647 }
24648 if (!this.isUpdating) {
24649 this.nodes.forEach(clearIsLayoutDirty);
24650 }
24651 this.isUpdating = false;
24652 /**
24653 * Write
24654 */
24655 this.nodes.forEach(resetTransformStyle);
24656 /**
24657 * Read ==================
24658 */
24659 // Update layout measurements of updated children
24660 this.nodes.forEach(updateLayout);
24661 /**
24662 * Write
24663 */
24664 // Notify listeners that the layout is updated
24665 this.nodes.forEach(notifyLayoutUpdate);
24666 this.clearAllSnapshots();
24667 /**
24668 * Manually flush any pending updates. Ideally
24669 * we could leave this to the following requestAnimationFrame but this seems
24670 * to leave a flash of incorrectly styled content.
24671 */
24672 const now = time.now();
24673 frameData.delta = clamp_clamp(0, 1000 / 60, now - frameData.timestamp);
24674 frameData.timestamp = now;
24675 frameData.isProcessing = true;
24676 frameSteps.update.process(frameData);
24677 frameSteps.preRender.process(frameData);
24678 frameSteps.render.process(frameData);
24679 frameData.isProcessing = false;
24680 }
24681 didUpdate() {
24682 if (!this.updateScheduled) {
24683 this.updateScheduled = true;
24684 microtask.read(this.scheduleUpdate);
24685 }
24686 }
24687 clearAllSnapshots() {
24688 this.nodes.forEach(clearSnapshot);
24689 this.sharedNodes.forEach(removeLeadSnapshots);
24690 }
24691 scheduleUpdateProjection() {
24692 if (!this.projectionUpdateScheduled) {
24693 this.projectionUpdateScheduled = true;
24694 frame_frame.preRender(this.updateProjection, false, true);
24695 }
24696 }
24697 scheduleCheckAfterUnmount() {
24698 /**
24699 * If the unmounting node is in a layoutGroup and did trigger a willUpdate,
24700 * we manually call didUpdate to give a chance to the siblings to animate.
24701 * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.
24702 */
24703 frame_frame.postRender(() => {
24704 if (this.isLayoutDirty) {
24705 this.root.didUpdate();
24706 }
24707 else {
24708 this.root.checkUpdateFailed();
24709 }
24710 });
24711 }
24712 /**
24713 * Update measurements
24714 */
24715 updateSnapshot() {
24716 if (this.snapshot || !this.instance)
24717 return;
24718 this.snapshot = this.measure();
24719 }
24720 updateLayout() {
24721 if (!this.instance)
24722 return;
24723 // TODO: Incorporate into a forwarded scroll offset
24724 this.updateScroll();
24725 if (!(this.options.alwaysMeasureLayout && this.isLead()) &&
24726 !this.isLayoutDirty) {
24727 return;
24728 }
24729 /**
24730 * When a node is mounted, it simply resumes from the prevLead's
24731 * snapshot instead of taking a new one, but the ancestors scroll
24732 * might have updated while the prevLead is unmounted. We need to
24733 * update the scroll again to make sure the layout we measure is
24734 * up to date.
24735 */
24736 if (this.resumeFrom && !this.resumeFrom.instance) {
24737 for (let i = 0; i < this.path.length; i++) {
24738 const node = this.path[i];
24739 node.updateScroll();
24740 }
24741 }
24742 const prevLayout = this.layout;
24743 this.layout = this.measure(false);
24744 this.layoutCorrected = createBox();
24745 this.isLayoutDirty = false;
24746 this.projectionDelta = undefined;
24747 this.notifyListeners("measure", this.layout.layoutBox);
24748 const { visualElement } = this.options;
24749 visualElement &&
24750 visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);
24751 }
24752 updateScroll(phase = "measure") {
24753 let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
24754 if (this.scroll &&
24755 this.scroll.animationId === this.root.animationId &&
24756 this.scroll.phase === phase) {
24757 needsMeasurement = false;
24758 }
24759 if (needsMeasurement) {
24760 const isRoot = checkIsScrollRoot(this.instance);
24761 this.scroll = {
24762 animationId: this.root.animationId,
24763 phase,
24764 isRoot,
24765 offset: measureScroll(this.instance),
24766 wasRoot: this.scroll ? this.scroll.isRoot : isRoot,
24767 };
24768 }
24769 }
24770 resetTransform() {
24771 if (!resetTransform)
24772 return;
24773 const isResetRequested = this.isLayoutDirty ||
24774 this.shouldResetTransform ||
24775 this.options.alwaysMeasureLayout;
24776 const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
24777 const transformTemplate = this.getTransformTemplate();
24778 const transformTemplateValue = transformTemplate
24779 ? transformTemplate(this.latestValues, "")
24780 : undefined;
24781 const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
24782 if (isResetRequested &&
24783 (hasProjection ||
24784 hasTransform(this.latestValues) ||
24785 transformTemplateHasChanged)) {
24786 resetTransform(this.instance, transformTemplateValue);
24787 this.shouldResetTransform = false;
24788 this.scheduleRender();
24789 }
24790 }
24791 measure(removeTransform = true) {
24792 const pageBox = this.measurePageBox();
24793 let layoutBox = this.removeElementScroll(pageBox);
24794 /**
24795 * Measurements taken during the pre-render stage
24796 * still have transforms applied so we remove them
24797 * via calculation.
24798 */
24799 if (removeTransform) {
24800 layoutBox = this.removeTransform(layoutBox);
24801 }
24802 roundBox(layoutBox);
24803 return {
24804 animationId: this.root.animationId,
24805 measuredBox: pageBox,
24806 layoutBox,
24807 latestValues: {},
24808 source: this.id,
24809 };
24810 }
24811 measurePageBox() {
24812 var _a;
24813 const { visualElement } = this.options;
24814 if (!visualElement)
24815 return createBox();
24816 const box = visualElement.measureViewportBox();
24817 const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);
24818 if (!wasInScrollRoot) {
24819 // Remove viewport scroll to give page-relative coordinates
24820 const { scroll } = this.root;
24821 if (scroll) {
24822 translateAxis(box.x, scroll.offset.x);
24823 translateAxis(box.y, scroll.offset.y);
24824 }
24825 }
24826 return box;
24827 }
24828 removeElementScroll(box) {
24829 var _a;
24830 const boxWithoutScroll = createBox();
24831 copyBoxInto(boxWithoutScroll, box);
24832 if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {
24833 return boxWithoutScroll;
24834 }
24835 /**
24836 * Performance TODO: Keep a cumulative scroll offset down the tree
24837 * rather than loop back up the path.
24838 */
24839 for (let i = 0; i < this.path.length; i++) {
24840 const node = this.path[i];
24841 const { scroll, options } = node;
24842 if (node !== this.root && scroll && options.layoutScroll) {
24843 /**
24844 * If this is a new scroll root, we want to remove all previous scrolls
24845 * from the viewport box.
24846 */
24847 if (scroll.wasRoot) {
24848 copyBoxInto(boxWithoutScroll, box);
24849 }
24850 translateAxis(boxWithoutScroll.x, scroll.offset.x);
24851 translateAxis(boxWithoutScroll.y, scroll.offset.y);
24852 }
24853 }
24854 return boxWithoutScroll;
24855 }
24856 applyTransform(box, transformOnly = false) {
24857 const withTransforms = createBox();
24858 copyBoxInto(withTransforms, box);
24859 for (let i = 0; i < this.path.length; i++) {
24860 const node = this.path[i];
24861 if (!transformOnly &&
24862 node.options.layoutScroll &&
24863 node.scroll &&
24864 node !== node.root) {
24865 transformBox(withTransforms, {
24866 x: -node.scroll.offset.x,
24867 y: -node.scroll.offset.y,
24868 });
24869 }
24870 if (!hasTransform(node.latestValues))
24871 continue;
24872 transformBox(withTransforms, node.latestValues);
24873 }
24874 if (hasTransform(this.latestValues)) {
24875 transformBox(withTransforms, this.latestValues);
24876 }
24877 return withTransforms;
24878 }
24879 removeTransform(box) {
24880 const boxWithoutTransform = createBox();
24881 copyBoxInto(boxWithoutTransform, box);
24882 for (let i = 0; i < this.path.length; i++) {
24883 const node = this.path[i];
24884 if (!node.instance)
24885 continue;
24886 if (!hasTransform(node.latestValues))
24887 continue;
24888 hasScale(node.latestValues) && node.updateSnapshot();
24889 const sourceBox = createBox();
24890 const nodeBox = node.measurePageBox();
24891 copyBoxInto(sourceBox, nodeBox);
24892 removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);
24893 }
24894 if (hasTransform(this.latestValues)) {
24895 removeBoxTransforms(boxWithoutTransform, this.latestValues);
24896 }
24897 return boxWithoutTransform;
24898 }
24899 setTargetDelta(delta) {
24900 this.targetDelta = delta;
24901 this.root.scheduleUpdateProjection();
24902 this.isProjectionDirty = true;
24903 }
24904 setOptions(options) {
24905 this.options = {
24906 ...this.options,
24907 ...options,
24908 crossfade: options.crossfade !== undefined ? options.crossfade : true,
24909 };
24910 }
24911 clearMeasurements() {
24912 this.scroll = undefined;
24913 this.layout = undefined;
24914 this.snapshot = undefined;
24915 this.prevTransformTemplateValue = undefined;
24916 this.targetDelta = undefined;
24917 this.target = undefined;
24918 this.isLayoutDirty = false;
24919 }
24920 forceRelativeParentToResolveTarget() {
24921 if (!this.relativeParent)
24922 return;
24923 /**
24924 * If the parent target isn't up-to-date, force it to update.
24925 * This is an unfortunate de-optimisation as it means any updating relative
24926 * projection will cause all the relative parents to recalculate back
24927 * up the tree.
24928 */
24929 if (this.relativeParent.resolvedRelativeTargetAt !==
24930 frameData.timestamp) {
24931 this.relativeParent.resolveTargetDelta(true);
24932 }
24933 }
24934 resolveTargetDelta(forceRecalculation = false) {
24935 var _a;
24936 /**
24937 * Once the dirty status of nodes has been spread through the tree, we also
24938 * need to check if we have a shared node of a different depth that has itself
24939 * been dirtied.
24940 */
24941 const lead = this.getLead();
24942 this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
24943 this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
24944 this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
24945 const isShared = Boolean(this.resumingFrom) || this !== lead;
24946 /**
24947 * We don't use transform for this step of processing so we don't
24948 * need to check whether any nodes have changed transform.
24949 */
24950 const canSkip = !(forceRecalculation ||
24951 (isShared && this.isSharedProjectionDirty) ||
24952 this.isProjectionDirty ||
24953 ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||
24954 this.attemptToResolveRelativeTarget ||
24955 this.root.updateBlockedByResize);
24956 if (canSkip)
24957 return;
24958 const { layout, layoutId } = this.options;
24959 /**
24960 * If we have no layout, we can't perform projection, so early return
24961 */
24962 if (!this.layout || !(layout || layoutId))
24963 return;
24964 this.resolvedRelativeTargetAt = frameData.timestamp;
24965 /**
24966 * If we don't have a targetDelta but do have a layout, we can attempt to resolve
24967 * a relativeParent. This will allow a component to perform scale correction
24968 * even if no animation has started.
24969 */
24970 if (!this.targetDelta && !this.relativeTarget) {
24971 const relativeParent = this.getClosestProjectingParent();
24972 if (relativeParent &&
24973 relativeParent.layout &&
24974 this.animationProgress !== 1) {
24975 this.relativeParent = relativeParent;
24976 this.forceRelativeParentToResolveTarget();
24977 this.relativeTarget = createBox();
24978 this.relativeTargetOrigin = createBox();
24979 calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
24980 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
24981 }
24982 else {
24983 this.relativeParent = this.relativeTarget = undefined;
24984 }
24985 }
24986 /**
24987 * If we have no relative target or no target delta our target isn't valid
24988 * for this frame.
24989 */
24990 if (!this.relativeTarget && !this.targetDelta)
24991 return;
24992 /**
24993 * Lazy-init target data structure
24994 */
24995 if (!this.target) {
24996 this.target = createBox();
24997 this.targetWithTransforms = createBox();
24998 }
24999 /**
25000 * If we've got a relative box for this component, resolve it into a target relative to the parent.
25001 */
25002 if (this.relativeTarget &&
25003 this.relativeTargetOrigin &&
25004 this.relativeParent &&
25005 this.relativeParent.target) {
25006 this.forceRelativeParentToResolveTarget();
25007 calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);
25008 /**
25009 * If we've only got a targetDelta, resolve it into a target
25010 */
25011 }
25012 else if (this.targetDelta) {
25013 if (Boolean(this.resumingFrom)) {
25014 // TODO: This is creating a new object every frame
25015 this.target = this.applyTransform(this.layout.layoutBox);
25016 }
25017 else {
25018 copyBoxInto(this.target, this.layout.layoutBox);
25019 }
25020 applyBoxDelta(this.target, this.targetDelta);
25021 }
25022 else {
25023 /**
25024 * If no target, use own layout as target
25025 */
25026 copyBoxInto(this.target, this.layout.layoutBox);
25027 }
25028 /**
25029 * If we've been told to attempt to resolve a relative target, do so.
25030 */
25031 if (this.attemptToResolveRelativeTarget) {
25032 this.attemptToResolveRelativeTarget = false;
25033 const relativeParent = this.getClosestProjectingParent();
25034 if (relativeParent &&
25035 Boolean(relativeParent.resumingFrom) ===
25036 Boolean(this.resumingFrom) &&
25037 !relativeParent.options.layoutScroll &&
25038 relativeParent.target &&
25039 this.animationProgress !== 1) {
25040 this.relativeParent = relativeParent;
25041 this.forceRelativeParentToResolveTarget();
25042 this.relativeTarget = createBox();
25043 this.relativeTargetOrigin = createBox();
25044 calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
25045 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
25046 }
25047 else {
25048 this.relativeParent = this.relativeTarget = undefined;
25049 }
25050 }
25051 /**
25052 * Increase debug counter for resolved target deltas
25053 */
25054 if (isDebug) {
25055 metrics.resolvedTargetDeltas++;
25056 }
25057 }
25058 getClosestProjectingParent() {
25059 if (!this.parent ||
25060 hasScale(this.parent.latestValues) ||
25061 has2DTranslate(this.parent.latestValues)) {
25062 return undefined;
25063 }
25064 if (this.parent.isProjecting()) {
25065 return this.parent;
25066 }
25067 else {
25068 return this.parent.getClosestProjectingParent();
25069 }
25070 }
25071 isProjecting() {
25072 return Boolean((this.relativeTarget ||
25073 this.targetDelta ||
25074 this.options.layoutRoot) &&
25075 this.layout);
25076 }
25077 calcProjection() {
25078 var _a;
25079 const lead = this.getLead();
25080 const isShared = Boolean(this.resumingFrom) || this !== lead;
25081 let canSkip = true;
25082 /**
25083 * If this is a normal layout animation and neither this node nor its nearest projecting
25084 * is dirty then we can't skip.
25085 */
25086 if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {
25087 canSkip = false;
25088 }
25089 /**
25090 * If this is a shared layout animation and this node's shared projection is dirty then
25091 * we can't skip.
25092 */
25093 if (isShared &&
25094 (this.isSharedProjectionDirty || this.isTransformDirty)) {
25095 canSkip = false;
25096 }
25097 /**
25098 * If we have resolved the target this frame we must recalculate the
25099 * projection to ensure it visually represents the internal calculations.
25100 */
25101 if (this.resolvedRelativeTargetAt === frameData.timestamp) {
25102 canSkip = false;
25103 }
25104 if (canSkip)
25105 return;
25106 const { layout, layoutId } = this.options;
25107 /**
25108 * If this section of the tree isn't animating we can
25109 * delete our target sources for the following frame.
25110 */
25111 this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||
25112 this.currentAnimation ||
25113 this.pendingAnimation);
25114 if (!this.isTreeAnimating) {
25115 this.targetDelta = this.relativeTarget = undefined;
25116 }
25117 if (!this.layout || !(layout || layoutId))
25118 return;
25119 /**
25120 * Reset the corrected box with the latest values from box, as we're then going
25121 * to perform mutative operations on it.
25122 */
25123 copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
25124 /**
25125 * Record previous tree scales before updating.
25126 */
25127 const prevTreeScaleX = this.treeScale.x;
25128 const prevTreeScaleY = this.treeScale.y;
25129 /**
25130 * Apply all the parent deltas to this box to produce the corrected box. This
25131 * is the layout box, as it will appear on screen as a result of the transforms of its parents.
25132 */
25133 applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
25134 /**
25135 * If this layer needs to perform scale correction but doesn't have a target,
25136 * use the layout as the target.
25137 */
25138 if (lead.layout &&
25139 !lead.target &&
25140 (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
25141 lead.target = lead.layout.layoutBox;
25142 lead.targetWithTransforms = createBox();
25143 }
25144 const { target } = lead;
25145 if (!target) {
25146 /**
25147 * If we don't have a target to project into, but we were previously
25148 * projecting, we want to remove the stored transform and schedule
25149 * a render to ensure the elements reflect the removed transform.
25150 */
25151 if (this.prevProjectionDelta) {
25152 this.createProjectionDeltas();
25153 this.scheduleRender();
25154 }
25155 return;
25156 }
25157 if (!this.projectionDelta || !this.prevProjectionDelta) {
25158 this.createProjectionDeltas();
25159 }
25160 else {
25161 copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);
25162 copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);
25163 }
25164 /**
25165 * Update the delta between the corrected box and the target box before user-set transforms were applied.
25166 * This will allow us to calculate the corrected borderRadius and boxShadow to compensate
25167 * for our layout reprojection, but still allow them to be scaled correctly by the user.
25168 * It might be that to simplify this we may want to accept that user-set scale is also corrected
25169 * and we wouldn't have to keep and calc both deltas, OR we could support a user setting
25170 * to allow people to choose whether these styles are corrected based on just the
25171 * layout reprojection or the final bounding box.
25172 */
25173 calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);
25174 if (this.treeScale.x !== prevTreeScaleX ||
25175 this.treeScale.y !== prevTreeScaleY ||
25176 !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||
25177 !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {
25178 this.hasProjected = true;
25179 this.scheduleRender();
25180 this.notifyListeners("projectionUpdate", target);
25181 }
25182 /**
25183 * Increase debug counter for recalculated projections
25184 */
25185 if (isDebug) {
25186 metrics.recalculatedProjection++;
25187 }
25188 }
25189 hide() {
25190 this.isVisible = false;
25191 // TODO: Schedule render
25192 }
25193 show() {
25194 this.isVisible = true;
25195 // TODO: Schedule render
25196 }
25197 scheduleRender(notifyAll = true) {
25198 var _a;
25199 (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender();
25200 if (notifyAll) {
25201 const stack = this.getStack();
25202 stack && stack.scheduleRender();
25203 }
25204 if (this.resumingFrom && !this.resumingFrom.instance) {
25205 this.resumingFrom = undefined;
25206 }
25207 }
25208 createProjectionDeltas() {
25209 this.prevProjectionDelta = createDelta();
25210 this.projectionDelta = createDelta();
25211 this.projectionDeltaWithTransform = createDelta();
25212 }
25213 setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
25214 const snapshot = this.snapshot;
25215 const snapshotLatestValues = snapshot
25216 ? snapshot.latestValues
25217 : {};
25218 const mixedValues = { ...this.latestValues };
25219 const targetDelta = createDelta();
25220 if (!this.relativeParent ||
25221 !this.relativeParent.options.layoutRoot) {
25222 this.relativeTarget = this.relativeTargetOrigin = undefined;
25223 }
25224 this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
25225 const relativeLayout = createBox();
25226 const snapshotSource = snapshot ? snapshot.source : undefined;
25227 const layoutSource = this.layout ? this.layout.source : undefined;
25228 const isSharedLayoutAnimation = snapshotSource !== layoutSource;
25229 const stack = this.getStack();
25230 const isOnlyMember = !stack || stack.members.length <= 1;
25231 const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&
25232 !isOnlyMember &&
25233 this.options.crossfade === true &&
25234 !this.path.some(hasOpacityCrossfade));
25235 this.animationProgress = 0;
25236 let prevRelativeTarget;
25237 this.mixTargetDelta = (latest) => {
25238 const progress = latest / 1000;
25239 mixAxisDelta(targetDelta.x, delta.x, progress);
25240 mixAxisDelta(targetDelta.y, delta.y, progress);
25241 this.setTargetDelta(targetDelta);
25242 if (this.relativeTarget &&
25243 this.relativeTargetOrigin &&
25244 this.layout &&
25245 this.relativeParent &&
25246 this.relativeParent.layout) {
25247 calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
25248 mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);
25249 /**
25250 * If this is an unchanged relative target we can consider the
25251 * projection not dirty.
25252 */
25253 if (prevRelativeTarget &&
25254 boxEquals(this.relativeTarget, prevRelativeTarget)) {
25255 this.isProjectionDirty = false;
25256 }
25257 if (!prevRelativeTarget)
25258 prevRelativeTarget = createBox();
25259 copyBoxInto(prevRelativeTarget, this.relativeTarget);
25260 }
25261 if (isSharedLayoutAnimation) {
25262 this.animationValues = mixedValues;
25263 mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);
25264 }
25265 this.root.scheduleUpdateProjection();
25266 this.scheduleRender();
25267 this.animationProgress = progress;
25268 };
25269 this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);
25270 }
25271 startAnimation(options) {
25272 this.notifyListeners("animationStart");
25273 this.currentAnimation && this.currentAnimation.stop();
25274 if (this.resumingFrom && this.resumingFrom.currentAnimation) {
25275 this.resumingFrom.currentAnimation.stop();
25276 }
25277 if (this.pendingAnimation) {
25278 cancelFrame(this.pendingAnimation);
25279 this.pendingAnimation = undefined;
25280 }
25281 /**
25282 * Start the animation in the next frame to have a frame with progress 0,
25283 * where the target is the same as when the animation started, so we can
25284 * calculate the relative positions correctly for instant transitions.
25285 */
25286 this.pendingAnimation = frame_frame.update(() => {
25287 globalProjectionState.hasAnimatedSinceResize = true;
25288 this.currentAnimation = animateSingleValue(0, animationTarget, {
25289 ...options,
25290 onUpdate: (latest) => {
25291 this.mixTargetDelta(latest);
25292 options.onUpdate && options.onUpdate(latest);
25293 },
25294 onComplete: () => {
25295 options.onComplete && options.onComplete();
25296 this.completeAnimation();
25297 },
25298 });
25299 if (this.resumingFrom) {
25300 this.resumingFrom.currentAnimation = this.currentAnimation;
25301 }
25302 this.pendingAnimation = undefined;
25303 });
25304 }
25305 completeAnimation() {
25306 if (this.resumingFrom) {
25307 this.resumingFrom.currentAnimation = undefined;
25308 this.resumingFrom.preserveOpacity = undefined;
25309 }
25310 const stack = this.getStack();
25311 stack && stack.exitAnimationComplete();
25312 this.resumingFrom =
25313 this.currentAnimation =
25314 this.animationValues =
25315 undefined;
25316 this.notifyListeners("animationComplete");
25317 }
25318 finishAnimation() {
25319 if (this.currentAnimation) {
25320 this.mixTargetDelta && this.mixTargetDelta(animationTarget);
25321 this.currentAnimation.stop();
25322 }
25323 this.completeAnimation();
25324 }
25325 applyTransformsToTarget() {
25326 const lead = this.getLead();
25327 let { targetWithTransforms, target, layout, latestValues } = lead;
25328 if (!targetWithTransforms || !target || !layout)
25329 return;
25330 /**
25331 * If we're only animating position, and this element isn't the lead element,
25332 * then instead of projecting into the lead box we instead want to calculate
25333 * a new target that aligns the two boxes but maintains the layout shape.
25334 */
25335 if (this !== lead &&
25336 this.layout &&
25337 layout &&
25338 shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {
25339 target = this.target || createBox();
25340 const xLength = calcLength(this.layout.layoutBox.x);
25341 target.x.min = lead.target.x.min;
25342 target.x.max = target.x.min + xLength;
25343 const yLength = calcLength(this.layout.layoutBox.y);
25344 target.y.min = lead.target.y.min;
25345 target.y.max = target.y.min + yLength;
25346 }
25347 copyBoxInto(targetWithTransforms, target);
25348 /**
25349 * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.
25350 * This is the final box that we will then project into by calculating a transform delta and
25351 * applying it to the corrected box.
25352 */
25353 transformBox(targetWithTransforms, latestValues);
25354 /**
25355 * Update the delta between the corrected box and the final target box, after
25356 * user-set transforms are applied to it. This will be used by the renderer to
25357 * create a transform style that will reproject the element from its layout layout
25358 * into the desired bounding box.
25359 */
25360 calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);
25361 }
25362 registerSharedNode(layoutId, node) {
25363 if (!this.sharedNodes.has(layoutId)) {
25364 this.sharedNodes.set(layoutId, new NodeStack());
25365 }
25366 const stack = this.sharedNodes.get(layoutId);
25367 stack.add(node);
25368 const config = node.options.initialPromotionConfig;
25369 node.promote({
25370 transition: config ? config.transition : undefined,
25371 preserveFollowOpacity: config && config.shouldPreserveFollowOpacity
25372 ? config.shouldPreserveFollowOpacity(node)
25373 : undefined,
25374 });
25375 }
25376 isLead() {
25377 const stack = this.getStack();
25378 return stack ? stack.lead === this : true;
25379 }
25380 getLead() {
25381 var _a;
25382 const { layoutId } = this.options;
25383 return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;
25384 }
25385 getPrevLead() {
25386 var _a;
25387 const { layoutId } = this.options;
25388 return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;
25389 }
25390 getStack() {
25391 const { layoutId } = this.options;
25392 if (layoutId)
25393 return this.root.sharedNodes.get(layoutId);
25394 }
25395 promote({ needsReset, transition, preserveFollowOpacity, } = {}) {
25396 const stack = this.getStack();
25397 if (stack)
25398 stack.promote(this, preserveFollowOpacity);
25399 if (needsReset) {
25400 this.projectionDelta = undefined;
25401 this.needsReset = true;
25402 }
25403 if (transition)
25404 this.setOptions({ transition });
25405 }
25406 relegate() {
25407 const stack = this.getStack();
25408 if (stack) {
25409 return stack.relegate(this);
25410 }
25411 else {
25412 return false;
25413 }
25414 }
25415 resetSkewAndRotation() {
25416 const { visualElement } = this.options;
25417 if (!visualElement)
25418 return;
25419 // If there's no detected skew or rotation values, we can early return without a forced render.
25420 let hasDistortingTransform = false;
25421 /**
25422 * An unrolled check for rotation values. Most elements don't have any rotation and
25423 * skipping the nested loop and new object creation is 50% faster.
25424 */
25425 const { latestValues } = visualElement;
25426 if (latestValues.z ||
25427 latestValues.rotate ||
25428 latestValues.rotateX ||
25429 latestValues.rotateY ||
25430 latestValues.rotateZ ||
25431 latestValues.skewX ||
25432 latestValues.skewY) {
25433 hasDistortingTransform = true;
25434 }
25435 // If there's no distorting values, we don't need to do any more.
25436 if (!hasDistortingTransform)
25437 return;
25438 const resetValues = {};
25439 if (latestValues.z) {
25440 resetDistortingTransform("z", visualElement, resetValues, this.animationValues);
25441 }
25442 // Check the skew and rotate value of all axes and reset to 0
25443 for (let i = 0; i < transformAxes.length; i++) {
25444 resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);
25445 resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);
25446 }
25447 // Force a render of this element to apply the transform with all skews and rotations
25448 // set to 0.
25449 visualElement.render();
25450 // Put back all the values we reset
25451 for (const key in resetValues) {
25452 visualElement.setStaticValue(key, resetValues[key]);
25453 if (this.animationValues) {
25454 this.animationValues[key] = resetValues[key];
25455 }
25456 }
25457 // Schedule a render for the next frame. This ensures we won't visually
25458 // see the element with the reset rotate value applied.
25459 visualElement.scheduleRender();
25460 }
25461 getProjectionStyles(styleProp) {
25462 var _a, _b;
25463 if (!this.instance || this.isSVG)
25464 return undefined;
25465 if (!this.isVisible) {
25466 return hiddenVisibility;
25467 }
25468 const styles = {
25469 visibility: "",
25470 };
25471 const transformTemplate = this.getTransformTemplate();
25472 if (this.needsReset) {
25473 this.needsReset = false;
25474 styles.opacity = "";
25475 styles.pointerEvents =
25476 resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
25477 styles.transform = transformTemplate
25478 ? transformTemplate(this.latestValues, "")
25479 : "none";
25480 return styles;
25481 }
25482 const lead = this.getLead();
25483 if (!this.projectionDelta || !this.layout || !lead.target) {
25484 const emptyStyles = {};
25485 if (this.options.layoutId) {
25486 emptyStyles.opacity =
25487 this.latestValues.opacity !== undefined
25488 ? this.latestValues.opacity
25489 : 1;
25490 emptyStyles.pointerEvents =
25491 resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
25492 }
25493 if (this.hasProjected && !hasTransform(this.latestValues)) {
25494 emptyStyles.transform = transformTemplate
25495 ? transformTemplate({}, "")
25496 : "none";
25497 this.hasProjected = false;
25498 }
25499 return emptyStyles;
25500 }
25501 const valuesToRender = lead.animationValues || lead.latestValues;
25502 this.applyTransformsToTarget();
25503 styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
25504 if (transformTemplate) {
25505 styles.transform = transformTemplate(valuesToRender, styles.transform);
25506 }
25507 const { x, y } = this.projectionDelta;
25508 styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
25509 if (lead.animationValues) {
25510 /**
25511 * If the lead component is animating, assign this either the entering/leaving
25512 * opacity
25513 */
25514 styles.opacity =
25515 lead === this
25516 ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1
25517 : this.preserveOpacity
25518 ? this.latestValues.opacity
25519 : valuesToRender.opacityExit;
25520 }
25521 else {
25522 /**
25523 * Or we're not animating at all, set the lead component to its layout
25524 * opacity and other components to hidden.
25525 */
25526 styles.opacity =
25527 lead === this
25528 ? valuesToRender.opacity !== undefined
25529 ? valuesToRender.opacity
25530 : ""
25531 : valuesToRender.opacityExit !== undefined
25532 ? valuesToRender.opacityExit
25533 : 0;
25534 }
25535 /**
25536 * Apply scale correction
25537 */
25538 for (const key in scaleCorrectors) {
25539 if (valuesToRender[key] === undefined)
25540 continue;
25541 const { correct, applyTo } = scaleCorrectors[key];
25542 /**
25543 * Only apply scale correction to the value if we have an
25544 * active projection transform. Otherwise these values become
25545 * vulnerable to distortion if the element changes size without
25546 * a corresponding layout animation.
25547 */
25548 const corrected = styles.transform === "none"
25549 ? valuesToRender[key]
25550 : correct(valuesToRender[key], lead);
25551 if (applyTo) {
25552 const num = applyTo.length;
25553 for (let i = 0; i < num; i++) {
25554 styles[applyTo[i]] = corrected;
25555 }
25556 }
25557 else {
25558 styles[key] = corrected;
25559 }
25560 }
25561 /**
25562 * Disable pointer events on follow components. This is to ensure
25563 * that if a follow component covers a lead component it doesn't block
25564 * pointer events on the lead.
25565 */
25566 if (this.options.layoutId) {
25567 styles.pointerEvents =
25568 lead === this
25569 ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""
25570 : "none";
25571 }
25572 return styles;
25573 }
25574 clearSnapshot() {
25575 this.resumeFrom = this.snapshot = undefined;
25576 }
25577 // Only run on root
25578 resetTree() {
25579 this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });
25580 this.root.nodes.forEach(clearMeasurements);
25581 this.root.sharedNodes.clear();
25582 }
25583 };
25584}
25585function updateLayout(node) {
25586 node.updateLayout();
25587}
25588function notifyLayoutUpdate(node) {
25589 var _a;
25590 const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;
25591 if (node.isLead() &&
25592 node.layout &&
25593 snapshot &&
25594 node.hasListeners("didUpdate")) {
25595 const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
25596 const { animationType } = node.options;
25597 const isShared = snapshot.source !== node.layout.source;
25598 // TODO Maybe we want to also resize the layout snapshot so we don't trigger
25599 // animations for instance if layout="size" and an element has only changed position
25600 if (animationType === "size") {
25601 eachAxis((axis) => {
25602 const axisSnapshot = isShared
25603 ? snapshot.measuredBox[axis]
25604 : snapshot.layoutBox[axis];
25605 const length = calcLength(axisSnapshot);
25606 axisSnapshot.min = layout[axis].min;
25607 axisSnapshot.max = axisSnapshot.min + length;
25608 });
25609 }
25610 else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {
25611 eachAxis((axis) => {
25612 const axisSnapshot = isShared
25613 ? snapshot.measuredBox[axis]
25614 : snapshot.layoutBox[axis];
25615 const length = calcLength(layout[axis]);
25616 axisSnapshot.max = axisSnapshot.min + length;
25617 /**
25618 * Ensure relative target gets resized and rerendererd
25619 */
25620 if (node.relativeTarget && !node.currentAnimation) {
25621 node.isProjectionDirty = true;
25622 node.relativeTarget[axis].max =
25623 node.relativeTarget[axis].min + length;
25624 }
25625 });
25626 }
25627 const layoutDelta = createDelta();
25628 calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);
25629 const visualDelta = createDelta();
25630 if (isShared) {
25631 calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);
25632 }
25633 else {
25634 calcBoxDelta(visualDelta, layout, snapshot.layoutBox);
25635 }
25636 const hasLayoutChanged = !isDeltaZero(layoutDelta);
25637 let hasRelativeTargetChanged = false;
25638 if (!node.resumeFrom) {
25639 const relativeParent = node.getClosestProjectingParent();
25640 /**
25641 * If the relativeParent is itself resuming from a different element then
25642 * the relative snapshot is not relavent
25643 */
25644 if (relativeParent && !relativeParent.resumeFrom) {
25645 const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
25646 if (parentSnapshot && parentLayout) {
25647 const relativeSnapshot = createBox();
25648 calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
25649 const relativeLayout = createBox();
25650 calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
25651 if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
25652 hasRelativeTargetChanged = true;
25653 }
25654 if (relativeParent.options.layoutRoot) {
25655 node.relativeTarget = relativeLayout;
25656 node.relativeTargetOrigin = relativeSnapshot;
25657 node.relativeParent = relativeParent;
25658 }
25659 }
25660 }
25661 }
25662 node.notifyListeners("didUpdate", {
25663 layout,
25664 snapshot,
25665 delta: visualDelta,
25666 layoutDelta,
25667 hasLayoutChanged,
25668 hasRelativeTargetChanged,
25669 });
25670 }
25671 else if (node.isLead()) {
25672 const { onExitComplete } = node.options;
25673 onExitComplete && onExitComplete();
25674 }
25675 /**
25676 * Clearing transition
25677 * TODO: Investigate why this transition is being passed in as {type: false } from Framer
25678 * and why we need it at all
25679 */
25680 node.options.transition = undefined;
25681}
25682function propagateDirtyNodes(node) {
25683 /**
25684 * Increase debug counter for nodes encountered this frame
25685 */
25686 if (isDebug) {
25687 metrics.totalNodes++;
25688 }
25689 if (!node.parent)
25690 return;
25691 /**
25692 * If this node isn't projecting, propagate isProjectionDirty. It will have
25693 * no performance impact but it will allow the next child that *is* projecting
25694 * but *isn't* dirty to just check its parent to see if *any* ancestor needs
25695 * correcting.
25696 */
25697 if (!node.isProjecting()) {
25698 node.isProjectionDirty = node.parent.isProjectionDirty;
25699 }
25700 /**
25701 * Propagate isSharedProjectionDirty and isTransformDirty
25702 * throughout the whole tree. A future revision can take another look at
25703 * this but for safety we still recalcualte shared nodes.
25704 */
25705 node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||
25706 node.parent.isProjectionDirty ||
25707 node.parent.isSharedProjectionDirty));
25708 node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);
25709}
25710function cleanDirtyNodes(node) {
25711 node.isProjectionDirty =
25712 node.isSharedProjectionDirty =
25713 node.isTransformDirty =
25714 false;
25715}
25716function clearSnapshot(node) {
25717 node.clearSnapshot();
25718}
25719function clearMeasurements(node) {
25720 node.clearMeasurements();
25721}
25722function clearIsLayoutDirty(node) {
25723 node.isLayoutDirty = false;
25724}
25725function resetTransformStyle(node) {
25726 const { visualElement } = node.options;
25727 if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {
25728 visualElement.notify("BeforeLayoutMeasure");
25729 }
25730 node.resetTransform();
25731}
25732function finishAnimation(node) {
25733 node.finishAnimation();
25734 node.targetDelta = node.relativeTarget = node.target = undefined;
25735 node.isProjectionDirty = true;
25736}
25737function resolveTargetDelta(node) {
25738 node.resolveTargetDelta();
25739}
25740function calcProjection(node) {
25741 node.calcProjection();
25742}
25743function resetSkewAndRotation(node) {
25744 node.resetSkewAndRotation();
25745}
25746function removeLeadSnapshots(stack) {
25747 stack.removeLeadSnapshot();
25748}
25749function mixAxisDelta(output, delta, p) {
25750 output.translate = mixNumber(delta.translate, 0, p);
25751 output.scale = mixNumber(delta.scale, 1, p);
25752 output.origin = delta.origin;
25753 output.originPoint = delta.originPoint;
25754}
25755function mixAxis(output, from, to, p) {
25756 output.min = mixNumber(from.min, to.min, p);
25757 output.max = mixNumber(from.max, to.max, p);
25758}
25759function mixBox(output, from, to, p) {
25760 mixAxis(output.x, from.x, to.x, p);
25761 mixAxis(output.y, from.y, to.y, p);
25762}
25763function hasOpacityCrossfade(node) {
25764 return (node.animationValues && node.animationValues.opacityExit !== undefined);
25765}
25766const defaultLayoutTransition = {
25767 duration: 0.45,
25768 ease: [0.4, 0, 0.1, 1],
25769};
25770const userAgentContains = (string) => typeof navigator !== "undefined" &&
25771 navigator.userAgent &&
25772 navigator.userAgent.toLowerCase().includes(string);
25773/**
25774 * Measured bounding boxes must be rounded in Safari and
25775 * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements
25776 * can appear to jump.
25777 */
25778const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/")
25779 ? Math.round
25780 : noop_noop;
25781function roundAxis(axis) {
25782 // Round to the nearest .5 pixels to support subpixel layouts
25783 axis.min = roundPoint(axis.min);
25784 axis.max = roundPoint(axis.max);
25785}
25786function roundBox(box) {
25787 roundAxis(box.x);
25788 roundAxis(box.y);
25789}
25790function shouldAnimatePositionOnly(animationType, snapshot, layout) {
25791 return (animationType === "position" ||
25792 (animationType === "preserve-aspect" &&
25793 !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));
25794}
25795function checkNodeWasScrollRoot(node) {
25796 var _a;
25797 return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot);
25798}
25799
25800
25801
25802;// ./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs
25803
25804
25805
25806const DocumentProjectionNode = createProjectionNode({
25807 attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify),
25808 measureScroll: () => ({
25809 x: document.documentElement.scrollLeft || document.body.scrollLeft,
25810 y: document.documentElement.scrollTop || document.body.scrollTop,
25811 }),
25812 checkIsScrollRoot: () => true,
25813});
25814
25815
25816
25817;// ./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs
25818
25819
25820
25821const rootProjectionNode = {
25822 current: undefined,
25823};
25824const HTMLProjectionNode = createProjectionNode({
25825 measureScroll: (instance) => ({
25826 x: instance.scrollLeft,
25827 y: instance.scrollTop,
25828 }),
25829 defaultParent: () => {
25830 if (!rootProjectionNode.current) {
25831 const documentNode = new DocumentProjectionNode({});
25832 documentNode.mount(window);
25833 documentNode.setOptions({ layoutScroll: true });
25834 rootProjectionNode.current = documentNode;
25835 }
25836 return rootProjectionNode.current;
25837 },
25838 resetTransform: (instance, value) => {
25839 instance.style.transform = value !== undefined ? value : "none";
25840 },
25841 checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"),
25842});
25843
25844
25845
25846;// ./node_modules/framer-motion/dist/es/motion/features/drag.mjs
25847
25848
25849
25850
25851
25852const drag = {
25853 pan: {
25854 Feature: PanGesture,
25855 },
25856 drag: {
25857 Feature: DragGesture,
25858 ProjectionNode: HTMLProjectionNode,
25859 MeasureLayout: MeasureLayout,
25860 },
25861};
25862
25863
25864
25865;// ./node_modules/framer-motion/dist/es/gestures/hover.mjs
25866
25867
25868
25869
25870
25871function handleHoverEvent(node, event, lifecycle) {
25872 const { props } = node;
25873 if (node.animationState && props.whileHover) {
25874 node.animationState.setActive("whileHover", lifecycle === "Start");
25875 }
25876 const eventName = ("onHover" + lifecycle);
25877 const callback = props[eventName];
25878 if (callback) {
25879 frame_frame.postRender(() => callback(event, extractEventInfo(event)));
25880 }
25881}
25882class HoverGesture extends Feature {
25883 mount() {
25884 const { current } = this.node;
25885 if (!current)
25886 return;
25887 this.unmount = hover(current, (startEvent) => {
25888 handleHoverEvent(this.node, startEvent, "Start");
25889 return (endEvent) => handleHoverEvent(this.node, endEvent, "End");
25890 });
25891 }
25892 unmount() { }
25893}
25894
25895
25896
25897;// ./node_modules/framer-motion/dist/es/gestures/focus.mjs
25898
25899
25900
25901
25902class FocusGesture extends Feature {
25903 constructor() {
25904 super(...arguments);
25905 this.isActive = false;
25906 }
25907 onFocus() {
25908 let isFocusVisible = false;
25909 /**
25910 * If this element doesn't match focus-visible then don't
25911 * apply whileHover. But, if matches throws that focus-visible
25912 * is not a valid selector then in that browser outline styles will be applied
25913 * to the element by default and we want to match that behaviour with whileFocus.
25914 */
25915 try {
25916 isFocusVisible = this.node.current.matches(":focus-visible");
25917 }
25918 catch (e) {
25919 isFocusVisible = true;
25920 }
25921 if (!isFocusVisible || !this.node.animationState)
25922 return;
25923 this.node.animationState.setActive("whileFocus", true);
25924 this.isActive = true;
25925 }
25926 onBlur() {
25927 if (!this.isActive || !this.node.animationState)
25928 return;
25929 this.node.animationState.setActive("whileFocus", false);
25930 this.isActive = false;
25931 }
25932 mount() {
25933 this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur()));
25934 }
25935 unmount() { }
25936}
25937
25938
25939
25940;// ./node_modules/framer-motion/dist/es/gestures/press.mjs
25941
25942
25943
25944
25945
25946function handlePressEvent(node, event, lifecycle) {
25947 const { props } = node;
25948 if (node.animationState && props.whileTap) {
25949 node.animationState.setActive("whileTap", lifecycle === "Start");
25950 }
25951 const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle));
25952 const callback = props[eventName];
25953 if (callback) {
25954 frame_frame.postRender(() => callback(event, extractEventInfo(event)));
25955 }
25956}
25957class PressGesture extends Feature {
25958 mount() {
25959 const { current } = this.node;
25960 if (!current)
25961 return;
25962 this.unmount = press(current, (startEvent) => {
25963 handlePressEvent(this.node, startEvent, "Start");
25964 return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel");
25965 }, { useGlobalTarget: this.node.props.globalTapTarget });
25966 }
25967 unmount() { }
25968}
25969
25970
25971
25972;// ./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs
25973/**
25974 * Map an IntersectionHandler callback to an element. We only ever make one handler for one
25975 * element, so even though these handlers might all be triggered by different
25976 * observers, we can keep them in the same map.
25977 */
25978const observerCallbacks = new WeakMap();
25979/**
25980 * Multiple observers can be created for multiple element/document roots. Each with
25981 * different settings. So here we store dictionaries of observers to each root,
25982 * using serialised settings (threshold/margin) as lookup keys.
25983 */
25984const observers = new WeakMap();
25985const fireObserverCallback = (entry) => {
25986 const callback = observerCallbacks.get(entry.target);
25987 callback && callback(entry);
25988};
25989const fireAllObserverCallbacks = (entries) => {
25990 entries.forEach(fireObserverCallback);
25991};
25992function initIntersectionObserver({ root, ...options }) {
25993 const lookupRoot = root || document;
25994 /**
25995 * If we don't have an observer lookup map for this root, create one.
25996 */
25997 if (!observers.has(lookupRoot)) {
25998 observers.set(lookupRoot, {});
25999 }
26000 const rootObservers = observers.get(lookupRoot);
26001 const key = JSON.stringify(options);
26002 /**
26003 * If we don't have an observer for this combination of root and settings,
26004 * create one.
26005 */
26006 if (!rootObservers[key]) {
26007 rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });
26008 }
26009 return rootObservers[key];
26010}
26011function observeIntersection(element, options, callback) {
26012 const rootInteresectionObserver = initIntersectionObserver(options);
26013 observerCallbacks.set(element, callback);
26014 rootInteresectionObserver.observe(element);
26015 return () => {
26016 observerCallbacks.delete(element);
26017 rootInteresectionObserver.unobserve(element);
26018 };
26019}
26020
26021
26022
26023;// ./node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs
26024
26025
26026
26027const thresholdNames = {
26028 some: 0,
26029 all: 1,
26030};
26031class InViewFeature extends Feature {
26032 constructor() {
26033 super(...arguments);
26034 this.hasEnteredView = false;
26035 this.isInView = false;
26036 }
26037 startObserver() {
26038 this.unmount();
26039 const { viewport = {} } = this.node.getProps();
26040 const { root, margin: rootMargin, amount = "some", once } = viewport;
26041 const options = {
26042 root: root ? root.current : undefined,
26043 rootMargin,
26044 threshold: typeof amount === "number" ? amount : thresholdNames[amount],
26045 };
26046 const onIntersectionUpdate = (entry) => {
26047 const { isIntersecting } = entry;
26048 /**
26049 * If there's been no change in the viewport state, early return.
26050 */
26051 if (this.isInView === isIntersecting)
26052 return;
26053 this.isInView = isIntersecting;
26054 /**
26055 * Handle hasEnteredView. If this is only meant to run once, and
26056 * element isn't visible, early return. Otherwise set hasEnteredView to true.
26057 */
26058 if (once && !isIntersecting && this.hasEnteredView) {
26059 return;
26060 }
26061 else if (isIntersecting) {
26062 this.hasEnteredView = true;
26063 }
26064 if (this.node.animationState) {
26065 this.node.animationState.setActive("whileInView", isIntersecting);
26066 }
26067 /**
26068 * Use the latest committed props rather than the ones in scope
26069 * when this observer is created
26070 */
26071 const { onViewportEnter, onViewportLeave } = this.node.getProps();
26072 const callback = isIntersecting ? onViewportEnter : onViewportLeave;
26073 callback && callback(entry);
26074 };
26075 return observeIntersection(this.node.current, options, onIntersectionUpdate);
26076 }
26077 mount() {
26078 this.startObserver();
26079 }
26080 update() {
26081 if (typeof IntersectionObserver === "undefined")
26082 return;
26083 const { props, prevProps } = this.node;
26084 const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
26085 if (hasOptionsChanged) {
26086 this.startObserver();
26087 }
26088 }
26089 unmount() { }
26090}
26091function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {
26092 return (name) => viewport[name] !== prevViewport[name];
26093}
26094
26095
26096
26097;// ./node_modules/framer-motion/dist/es/motion/features/gestures.mjs
26098
26099
26100
26101
26102
26103const gestureAnimations = {
26104 inView: {
26105 Feature: InViewFeature,
26106 },
26107 tap: {
26108 Feature: PressGesture,
26109 },
26110 focus: {
26111 Feature: FocusGesture,
26112 },
26113 hover: {
26114 Feature: HoverGesture,
26115 },
26116};
26117
26118
26119
26120;// ./node_modules/framer-motion/dist/es/motion/features/layout.mjs
26121
26122
26123
26124const layout = {
26125 layout: {
26126 ProjectionNode: HTMLProjectionNode,
26127 MeasureLayout: MeasureLayout,
26128 },
26129};
26130
26131
26132
26133;// ./node_modules/framer-motion/dist/es/context/LazyContext.mjs
26134"use client";
26135
26136
26137const LazyContext = (0,external_React_.createContext)({ strict: false });
26138
26139
26140
26141;// ./node_modules/framer-motion/dist/es/context/MotionContext/index.mjs
26142"use client";
26143
26144
26145const MotionContext = (0,external_React_.createContext)({});
26146
26147
26148
26149;// ./node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs
26150
26151
26152
26153
26154function isControllingVariants(props) {
26155 return (isAnimationControls(props.animate) ||
26156 variantProps.some((name) => isVariantLabel(props[name])));
26157}
26158function isVariantNode(props) {
26159 return Boolean(isControllingVariants(props) || props.variants);
26160}
26161
26162
26163
26164;// ./node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
26165
26166
26167
26168function getCurrentTreeVariants(props, context) {
26169 if (isControllingVariants(props)) {
26170 const { initial, animate } = props;
26171 return {
26172 initial: initial === false || isVariantLabel(initial)
26173 ? initial
26174 : undefined,
26175 animate: isVariantLabel(animate) ? animate : undefined,
26176 };
26177 }
26178 return props.inherit !== false ? context : {};
26179}
26180
26181
26182
26183;// ./node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
26184
26185
26186
26187
26188function useCreateMotionContext(props) {
26189 const { initial, animate } = getCurrentTreeVariants(props, (0,external_React_.useContext)(MotionContext));
26190 return (0,external_React_.useMemo)(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
26191}
26192function variantLabelsAsDependency(prop) {
26193 return Array.isArray(prop) ? prop.join(" ") : prop;
26194}
26195
26196
26197
26198;// ./node_modules/framer-motion/dist/es/motion/features/definitions.mjs
26199const featureProps = {
26200 animation: [
26201 "animate",
26202 "variants",
26203 "whileHover",
26204 "whileTap",
26205 "exit",
26206 "whileInView",
26207 "whileFocus",
26208 "whileDrag",
26209 ],
26210 exit: ["exit"],
26211 drag: ["drag", "dragControls"],
26212 focus: ["whileFocus"],
26213 hover: ["whileHover", "onHoverStart", "onHoverEnd"],
26214 tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
26215 pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
26216 inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
26217 layout: ["layout", "layoutId"],
26218};
26219const featureDefinitions = {};
26220for (const key in featureProps) {
26221 featureDefinitions[key] = {
26222 isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
26223 };
26224}
26225
26226
26227
26228;// ./node_modules/framer-motion/dist/es/motion/features/load-features.mjs
26229
26230
26231function loadFeatures(features) {
26232 for (const key in features) {
26233 featureDefinitions[key] = {
26234 ...featureDefinitions[key],
26235 ...features[key],
26236 };
26237 }
26238}
26239
26240
26241
26242;// ./node_modules/framer-motion/dist/es/motion/utils/symbol.mjs
26243const motionComponentSymbol = Symbol.for("motionComponentSymbol");
26244
26245
26246
26247;// ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs
26248
26249
26250
26251/**
26252 * Creates a ref function that, when called, hydrates the provided
26253 * external ref and VisualElement.
26254 */
26255function useMotionRef(visualState, visualElement, externalRef) {
26256 return (0,external_React_.useCallback)((instance) => {
26257 if (instance) {
26258 visualState.onMount && visualState.onMount(instance);
26259 }
26260 if (visualElement) {
26261 if (instance) {
26262 visualElement.mount(instance);
26263 }
26264 else {
26265 visualElement.unmount();
26266 }
26267 }
26268 if (externalRef) {
26269 if (typeof externalRef === "function") {
26270 externalRef(instance);
26271 }
26272 else if (isRefObject(externalRef)) {
26273 externalRef.current = instance;
26274 }
26275 }
26276 },
26277 /**
26278 * Only pass a new ref callback to React if we've received a visual element
26279 * factory. Otherwise we'll be mounting/remounting every time externalRef
26280 * or other dependencies change.
26281 */
26282 [visualElement]);
26283}
26284
26285
26286
26287;// ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
26300 var _a, _b;
26301 const { visualElement: parent } = (0,external_React_.useContext)(MotionContext);
26302 const lazyContext = (0,external_React_.useContext)(LazyContext);
26303 const presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext);
26304 const reducedMotionConfig = (0,external_React_.useContext)(MotionConfigContext).reducedMotion;
26305 const visualElementRef = (0,external_React_.useRef)(null);
26306 /**
26307 * If we haven't preloaded a renderer, check to see if we have one lazy-loaded
26308 */
26309 createVisualElement = createVisualElement || lazyContext.renderer;
26310 if (!visualElementRef.current && createVisualElement) {
26311 visualElementRef.current = createVisualElement(Component, {
26312 visualState,
26313 parent,
26314 props,
26315 presenceContext,
26316 blockInitialAnimation: presenceContext
26317 ? presenceContext.initial === false
26318 : false,
26319 reducedMotionConfig,
26320 });
26321 }
26322 const visualElement = visualElementRef.current;
26323 /**
26324 * Load Motion gesture and animation features. These are rendered as renderless
26325 * components so each feature can optionally make use of React lifecycle methods.
26326 */
26327 const initialLayoutGroupConfig = (0,external_React_.useContext)(SwitchLayoutGroupContext);
26328 if (visualElement &&
26329 !visualElement.projection &&
26330 ProjectionNodeConstructor &&
26331 (visualElement.type === "html" || visualElement.type === "svg")) {
26332 use_visual_element_createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
26333 }
26334 const isMounted = (0,external_React_.useRef)(false);
26335 (0,external_React_.useInsertionEffect)(() => {
26336 /**
26337 * Check the component has already mounted before calling
26338 * `update` unnecessarily. This ensures we skip the initial update.
26339 */
26340 if (visualElement && isMounted.current) {
26341 visualElement.update(props, presenceContext);
26342 }
26343 });
26344 /**
26345 * Cache this value as we want to know whether HandoffAppearAnimations
26346 * was present on initial render - it will be deleted after this.
26347 */
26348 const optimisedAppearId = props[optimizedAppearDataAttribute];
26349 const wantsHandoff = (0,external_React_.useRef)(Boolean(optimisedAppearId) &&
26350 !((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&
26351 ((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));
26352 useIsomorphicLayoutEffect(() => {
26353 if (!visualElement)
26354 return;
26355 isMounted.current = true;
26356 window.MotionIsMounted = true;
26357 visualElement.updateFeatures();
26358 microtask.render(visualElement.render);
26359 /**
26360 * Ideally this function would always run in a useEffect.
26361 *
26362 * However, if we have optimised appear animations to handoff from,
26363 * it needs to happen synchronously to ensure there's no flash of
26364 * incorrect styles in the event of a hydration error.
26365 *
26366 * So if we detect a situtation where optimised appear animations
26367 * are running, we use useLayoutEffect to trigger animations.
26368 */
26369 if (wantsHandoff.current && visualElement.animationState) {
26370 visualElement.animationState.animateChanges();
26371 }
26372 });
26373 (0,external_React_.useEffect)(() => {
26374 if (!visualElement)
26375 return;
26376 if (!wantsHandoff.current && visualElement.animationState) {
26377 visualElement.animationState.animateChanges();
26378 }
26379 if (wantsHandoff.current) {
26380 // This ensures all future calls to animateChanges() in this component will run in useEffect
26381 queueMicrotask(() => {
26382 var _a;
26383 (_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);
26384 });
26385 wantsHandoff.current = false;
26386 }
26387 });
26388 return visualElement;
26389}
26390function use_visual_element_createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
26391 const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
26392 visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
26393 ? undefined
26394 : getClosestProjectingNode(visualElement.parent));
26395 visualElement.projection.setOptions({
26396 layoutId,
26397 layout,
26398 alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
26399 visualElement,
26400 /**
26401 * TODO: Update options in an effect. This could be tricky as it'll be too late
26402 * to update by the time layout animations run.
26403 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
26404 * ensuring it gets called if there's no potential layout animations.
26405 *
26406 */
26407 animationType: typeof layout === "string" ? layout : "both",
26408 initialPromotionConfig,
26409 layoutScroll,
26410 layoutRoot,
26411 });
26412}
26413function getClosestProjectingNode(visualElement) {
26414 if (!visualElement)
26415 return undefined;
26416 return visualElement.options.allowProjection !== false
26417 ? visualElement.projection
26418 : getClosestProjectingNode(visualElement.parent);
26419}
26420
26421
26422
26423;// ./node_modules/framer-motion/dist/es/motion/index.mjs
26424"use client";
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440/**
26441 * Create a `motion` component.
26442 *
26443 * This function accepts a Component argument, which can be either a string (ie "div"
26444 * for `motion.div`), or an actual React component.
26445 *
26446 * Alongside this is a config option which provides a way of rendering the provided
26447 * component "offline", or outside the React render cycle.
26448 */
26449function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {
26450 var _a, _b;
26451 preloadedFeatures && loadFeatures(preloadedFeatures);
26452 function MotionComponent(props, externalRef) {
26453 /**
26454 * If we need to measure the element we load this functionality in a
26455 * separate class component in order to gain access to getSnapshotBeforeUpdate.
26456 */
26457 let MeasureLayout;
26458 const configAndProps = {
26459 ...(0,external_React_.useContext)(MotionConfigContext),
26460 ...props,
26461 layoutId: useLayoutId(props),
26462 };
26463 const { isStatic } = configAndProps;
26464 const context = useCreateMotionContext(props);
26465 const visualState = useVisualState(props, isStatic);
26466 if (!isStatic && is_browser_isBrowser) {
26467 useStrictMode(configAndProps, preloadedFeatures);
26468 const layoutProjection = getProjectionFunctionality(configAndProps);
26469 MeasureLayout = layoutProjection.MeasureLayout;
26470 /**
26471 * Create a VisualElement for this component. A VisualElement provides a common
26472 * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
26473 * providing a way of rendering to these APIs outside of the React render loop
26474 * for more performant animations and interactions
26475 */
26476 context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);
26477 }
26478 /**
26479 * The mount order and hierarchy is specific to ensure our element ref
26480 * is hydrated by the time features fire their effects.
26481 */
26482 return ((0,external_ReactJSXRuntime_namespaceObject.jsxs)(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? ((0,external_ReactJSXRuntime_namespaceObject.jsx)(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));
26483 }
26484 MotionComponent.displayName = `motion.${typeof Component === "string"
26485 ? Component
26486 : `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`;
26487 const ForwardRefMotionComponent = (0,external_React_.forwardRef)(MotionComponent);
26488 ForwardRefMotionComponent[motionComponentSymbol] = Component;
26489 return ForwardRefMotionComponent;
26490}
26491function useLayoutId({ layoutId }) {
26492 const layoutGroupId = (0,external_React_.useContext)(LayoutGroupContext).id;
26493 return layoutGroupId && layoutId !== undefined
26494 ? layoutGroupId + "-" + layoutId
26495 : layoutId;
26496}
26497function useStrictMode(configAndProps, preloadedFeatures) {
26498 const isStrict = (0,external_React_.useContext)(LazyContext).strict;
26499 /**
26500 * If we're in development mode, check to make sure we're not rendering a motion component
26501 * as a child of LazyMotion, as this will break the file-size benefits of using it.
26502 */
26503 if (false) {}
26504}
26505function getProjectionFunctionality(props) {
26506 const { drag, layout } = featureDefinitions;
26507 if (!drag && !layout)
26508 return {};
26509 const combined = { ...drag, ...layout };
26510 return {
26511 MeasureLayout: (drag === null || drag === void 0 ? void 0 : drag.isEnabled(props)) || (layout === null || layout === void 0 ? void 0 : layout.isEnabled(props))
26512 ? combined.MeasureLayout
26513 : undefined,
26514 ProjectionNode: combined.ProjectionNode,
26515 };
26516}
26517
26518
26519
26520;// ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
26521/**
26522 * We keep these listed separately as we use the lowercase tag names as part
26523 * of the runtime bundle to detect SVG components
26524 */
26525const lowercaseSVGElements = [
26526 "animate",
26527 "circle",
26528 "defs",
26529 "desc",
26530 "ellipse",
26531 "g",
26532 "image",
26533 "line",
26534 "filter",
26535 "marker",
26536 "mask",
26537 "metadata",
26538 "path",
26539 "pattern",
26540 "polygon",
26541 "polyline",
26542 "rect",
26543 "stop",
26544 "switch",
26545 "symbol",
26546 "svg",
26547 "text",
26548 "tspan",
26549 "use",
26550 "view",
26551];
26552
26553
26554
26555;// ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs
26556
26557
26558function isSVGComponent(Component) {
26559 if (
26560 /**
26561 * If it's not a string, it's a custom React component. Currently we only support
26562 * HTML custom React components.
26563 */
26564 typeof Component !== "string" ||
26565 /**
26566 * If it contains a dash, the element is a custom HTML webcomponent.
26567 */
26568 Component.includes("-")) {
26569 return false;
26570 }
26571 else if (
26572 /**
26573 * If it's in our list of lowercase SVG tags, it's an SVG component
26574 */
26575 lowercaseSVGElements.indexOf(Component) > -1 ||
26576 /**
26577 * If it contains a capital letter, it's an SVG component
26578 */
26579 /[A-Z]/u.test(Component)) {
26580 return true;
26581 }
26582 return false;
26583}
26584
26585
26586
26587;// ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597function makeState({ scrapeMotionValuesFromProps, createRenderState, onUpdate, }, props, context, presenceContext) {
26598 const state = {
26599 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
26600 renderState: createRenderState(),
26601 };
26602 if (onUpdate) {
26603 /**
26604 * onMount works without the VisualElement because it could be
26605 * called before the VisualElement payload has been hydrated.
26606 * (e.g. if someone is using m components <m.circle />)
26607 */
26608 state.onMount = (instance) => onUpdate({ props, current: instance, ...state });
26609 state.onUpdate = (visualElement) => onUpdate(visualElement);
26610 }
26611 return state;
26612}
26613const makeUseVisualState = (config) => (props, isStatic) => {
26614 const context = (0,external_React_.useContext)(MotionContext);
26615 const presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext);
26616 const make = () => makeState(config, props, context, presenceContext);
26617 return isStatic ? make() : useConstant(make);
26618};
26619function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
26620 const values = {};
26621 const motionValues = scrapeMotionValues(props, {});
26622 for (const key in motionValues) {
26623 values[key] = resolveMotionValue(motionValues[key]);
26624 }
26625 let { initial, animate } = props;
26626 const isControllingVariants$1 = isControllingVariants(props);
26627 const isVariantNode$1 = isVariantNode(props);
26628 if (context &&
26629 isVariantNode$1 &&
26630 !isControllingVariants$1 &&
26631 props.inherit !== false) {
26632 if (initial === undefined)
26633 initial = context.initial;
26634 if (animate === undefined)
26635 animate = context.animate;
26636 }
26637 let isInitialAnimationBlocked = presenceContext
26638 ? presenceContext.initial === false
26639 : false;
26640 isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
26641 const variantToSet = isInitialAnimationBlocked ? animate : initial;
26642 if (variantToSet &&
26643 typeof variantToSet !== "boolean" &&
26644 !isAnimationControls(variantToSet)) {
26645 const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
26646 for (let i = 0; i < list.length; i++) {
26647 const resolved = resolveVariantFromProps(props, list[i]);
26648 if (resolved) {
26649 const { transitionEnd, transition, ...target } = resolved;
26650 for (const key in target) {
26651 let valueTarget = target[key];
26652 if (Array.isArray(valueTarget)) {
26653 /**
26654 * Take final keyframe if the initial animation is blocked because
26655 * we want to initialise at the end of that blocked animation.
26656 */
26657 const index = isInitialAnimationBlocked
26658 ? valueTarget.length - 1
26659 : 0;
26660 valueTarget = valueTarget[index];
26661 }
26662 if (valueTarget !== null) {
26663 values[key] = valueTarget;
26664 }
26665 }
26666 for (const key in transitionEnd) {
26667 values[key] = transitionEnd[key];
26668 }
26669 }
26670 }
26671 }
26672 return values;
26673}
26674
26675
26676
26677;// ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs
26678/**
26679 * Provided a value and a ValueType, returns the value as that value type.
26680 */
26681const getValueAsType = (value, type) => {
26682 return type && typeof value === "number"
26683 ? type.transform(value)
26684 : value;
26685};
26686
26687
26688
26689;// ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs
26690
26691
26692
26693
26694const translateAlias = {
26695 x: "translateX",
26696 y: "translateY",
26697 z: "translateZ",
26698 transformPerspective: "perspective",
26699};
26700const numTransforms = transformPropOrder.length;
26701/**
26702 * Build a CSS transform style from individual x/y/scale etc properties.
26703 *
26704 * This outputs with a default order of transforms/scales/rotations, this can be customised by
26705 * providing a transformTemplate function.
26706 */
26707function buildTransform(latestValues, transform, transformTemplate) {
26708 // The transform string we're going to build into.
26709 let transformString = "";
26710 let transformIsDefault = true;
26711 /**
26712 * Loop over all possible transforms in order, adding the ones that
26713 * are present to the transform string.
26714 */
26715 for (let i = 0; i < numTransforms; i++) {
26716 const key = transformPropOrder[i];
26717 const value = latestValues[key];
26718 if (value === undefined)
26719 continue;
26720 let valueIsDefault = true;
26721 if (typeof value === "number") {
26722 valueIsDefault = value === (key.startsWith("scale") ? 1 : 0);
26723 }
26724 else {
26725 valueIsDefault = parseFloat(value) === 0;
26726 }
26727 if (!valueIsDefault || transformTemplate) {
26728 const valueAsType = getValueAsType(value, numberValueTypes[key]);
26729 if (!valueIsDefault) {
26730 transformIsDefault = false;
26731 const transformName = translateAlias[key] || key;
26732 transformString += `${transformName}(${valueAsType}) `;
26733 }
26734 if (transformTemplate) {
26735 transform[key] = valueAsType;
26736 }
26737 }
26738 }
26739 transformString = transformString.trim();
26740 // If we have a custom `transform` template, pass our transform values and
26741 // generated transformString to that before returning
26742 if (transformTemplate) {
26743 transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
26744 }
26745 else if (transformIsDefault) {
26746 transformString = "none";
26747 }
26748 return transformString;
26749}
26750
26751
26752
26753;// ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs
26754
26755
26756
26757
26758
26759
26760function buildHTMLStyles(state, latestValues, transformTemplate) {
26761 const { style, vars, transformOrigin } = state;
26762 // Track whether we encounter any transform or transformOrigin values.
26763 let hasTransform = false;
26764 let hasTransformOrigin = false;
26765 /**
26766 * Loop over all our latest animated values and decide whether to handle them
26767 * as a style or CSS variable.
26768 *
26769 * Transforms and transform origins are kept separately for further processing.
26770 */
26771 for (const key in latestValues) {
26772 const value = latestValues[key];
26773 if (transformProps.has(key)) {
26774 // If this is a transform, flag to enable further transform processing
26775 hasTransform = true;
26776 continue;
26777 }
26778 else if (isCSSVariableName(key)) {
26779 vars[key] = value;
26780 continue;
26781 }
26782 else {
26783 // Convert the value to its default value type, ie 0 -> "0px"
26784 const valueAsType = getValueAsType(value, numberValueTypes[key]);
26785 if (key.startsWith("origin")) {
26786 // If this is a transform origin, flag and enable further transform-origin processing
26787 hasTransformOrigin = true;
26788 transformOrigin[key] =
26789 valueAsType;
26790 }
26791 else {
26792 style[key] = valueAsType;
26793 }
26794 }
26795 }
26796 if (!latestValues.transform) {
26797 if (hasTransform || transformTemplate) {
26798 style.transform = buildTransform(latestValues, state.transform, transformTemplate);
26799 }
26800 else if (style.transform) {
26801 /**
26802 * If we have previously created a transform but currently don't have any,
26803 * reset transform style to none.
26804 */
26805 style.transform = "none";
26806 }
26807 }
26808 /**
26809 * Build a transformOrigin style. Uses the same defaults as the browser for
26810 * undefined origins.
26811 */
26812 if (hasTransformOrigin) {
26813 const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin;
26814 style.transformOrigin = `${originX} ${originY} ${originZ}`;
26815 }
26816}
26817
26818
26819
26820;// ./node_modules/framer-motion/dist/es/render/svg/utils/path.mjs
26821
26822
26823const dashKeys = {
26824 offset: "stroke-dashoffset",
26825 array: "stroke-dasharray",
26826};
26827const camelKeys = {
26828 offset: "strokeDashoffset",
26829 array: "strokeDasharray",
26830};
26831/**
26832 * Build SVG path properties. Uses the path's measured length to convert
26833 * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
26834 * and stroke-dasharray attributes.
26835 *
26836 * This function is mutative to reduce per-frame GC.
26837 */
26838function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {
26839 // Normalise path length by setting SVG attribute pathLength to 1
26840 attrs.pathLength = 1;
26841 // We use dash case when setting attributes directly to the DOM node and camel case
26842 // when defining props on a React component.
26843 const keys = useDashCase ? dashKeys : camelKeys;
26844 // Build the dash offset
26845 attrs[keys.offset] = px.transform(-offset);
26846 // Build the dash array
26847 const pathLength = px.transform(length);
26848 const pathSpacing = px.transform(spacing);
26849 attrs[keys.array] = `${pathLength} ${pathSpacing}`;
26850}
26851
26852
26853
26854;// ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs
26855
26856
26857function transform_origin_calcOrigin(origin, offset, size) {
26858 return typeof origin === "string"
26859 ? origin
26860 : px.transform(offset + size * origin);
26861}
26862/**
26863 * The SVG transform origin defaults are different to CSS and is less intuitive,
26864 * so we use the measured dimensions of the SVG to reconcile these.
26865 */
26866function calcSVGTransformOrigin(dimensions, originX, originY) {
26867 const pxOriginX = transform_origin_calcOrigin(originX, dimensions.x, dimensions.width);
26868 const pxOriginY = transform_origin_calcOrigin(originY, dimensions.y, dimensions.height);
26869 return `${pxOriginX} ${pxOriginY}`;
26870}
26871
26872
26873
26874;// ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs
26875
26876
26877
26878
26879/**
26880 * Build SVG visual attrbutes, like cx and style.transform
26881 */
26882function buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0,
26883// This is object creation, which we try to avoid per-frame.
26884...latest }, isSVGTag, transformTemplate) {
26885 buildHTMLStyles(state, latest, transformTemplate);
26886 /**
26887 * For svg tags we just want to make sure viewBox is animatable and treat all the styles
26888 * as normal HTML tags.
26889 */
26890 if (isSVGTag) {
26891 if (state.style.viewBox) {
26892 state.attrs.viewBox = state.style.viewBox;
26893 }
26894 return;
26895 }
26896 state.attrs = state.style;
26897 state.style = {};
26898 const { attrs, style, dimensions } = state;
26899 /**
26900 * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs
26901 * and copy it into style.
26902 */
26903 if (attrs.transform) {
26904 if (dimensions)
26905 style.transform = attrs.transform;
26906 delete attrs.transform;
26907 }
26908 // Parse transformOrigin
26909 if (dimensions &&
26910 (originX !== undefined || originY !== undefined || style.transform)) {
26911 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);
26912 }
26913 // Render attrX/attrY/attrScale as attributes
26914 if (attrX !== undefined)
26915 attrs.x = attrX;
26916 if (attrY !== undefined)
26917 attrs.y = attrY;
26918 if (attrScale !== undefined)
26919 attrs.scale = attrScale;
26920 // Build SVG path if one has been defined
26921 if (pathLength !== undefined) {
26922 buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);
26923 }
26924}
26925
26926
26927
26928;// ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs
26929const createHtmlRenderState = () => ({
26930 style: {},
26931 transform: {},
26932 transformOrigin: {},
26933 vars: {},
26934});
26935
26936
26937
26938;// ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
26939
26940
26941const createSvgRenderState = () => ({
26942 ...createHtmlRenderState(),
26943 attrs: {},
26944});
26945
26946
26947
26948;// ./node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs
26949const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg";
26950
26951
26952
26953;// ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs
26954function renderHTML(element, { style, vars }, styleProp, projection) {
26955 Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
26956 // Loop over any CSS variables and assign those.
26957 for (const key in vars) {
26958 element.style.setProperty(key, vars[key]);
26959 }
26960}
26961
26962
26963
26964;// ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs
26965/**
26966 * A set of attribute names that are always read/written as camel case.
26967 */
26968const camelCaseAttributes = new Set([
26969 "baseFrequency",
26970 "diffuseConstant",
26971 "kernelMatrix",
26972 "kernelUnitLength",
26973 "keySplines",
26974 "keyTimes",
26975 "limitingConeAngle",
26976 "markerHeight",
26977 "markerWidth",
26978 "numOctaves",
26979 "targetX",
26980 "targetY",
26981 "surfaceScale",
26982 "specularConstant",
26983 "specularExponent",
26984 "stdDeviation",
26985 "tableValues",
26986 "viewBox",
26987 "gradientTransform",
26988 "pathLength",
26989 "startOffset",
26990 "textLength",
26991 "lengthAdjust",
26992]);
26993
26994
26995
26996;// ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs
26997
26998
26999
27000
27001function renderSVG(element, renderState, _styleProp, projection) {
27002 renderHTML(element, renderState, undefined, projection);
27003 for (const key in renderState.attrs) {
27004 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
27005 }
27006}
27007
27008
27009
27010;// ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs
27011
27012
27013
27014function isForcedMotionValue(key, { layout, layoutId }) {
27015 return (transformProps.has(key) ||
27016 key.startsWith("origin") ||
27017 ((layout || layoutId !== undefined) &&
27018 (!!scaleCorrectors[key] || key === "opacity")));
27019}
27020
27021
27022
27023;// ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs
27024
27025
27026
27027function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
27028 var _a;
27029 const { style } = props;
27030 const newValues = {};
27031 for (const key in style) {
27032 if (isMotionValue(style[key]) ||
27033 (prevProps.style &&
27034 isMotionValue(prevProps.style[key])) ||
27035 isForcedMotionValue(key, props) ||
27036 ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) {
27037 newValues[key] = style[key];
27038 }
27039 }
27040 return newValues;
27041}
27042
27043
27044
27045;// ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs
27046
27047
27048
27049
27050function scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement) {
27051 const newValues = scrapeMotionValuesFromProps(props, prevProps, visualElement);
27052 for (const key in props) {
27053 if (isMotionValue(props[key]) ||
27054 isMotionValue(prevProps[key])) {
27055 const targetKey = transformPropOrder.indexOf(key) !== -1
27056 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1)
27057 : key;
27058 newValues[targetKey] = props[key];
27059 }
27060 }
27061 return newValues;
27062}
27063
27064
27065
27066;// ./node_modules/framer-motion/dist/es/render/svg/config-motion.mjs
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076function updateSVGDimensions(instance, renderState) {
27077 try {
27078 renderState.dimensions =
27079 typeof instance.getBBox === "function"
27080 ? instance.getBBox()
27081 : instance.getBoundingClientRect();
27082 }
27083 catch (e) {
27084 // Most likely trying to measure an unrendered element under Firefox
27085 renderState.dimensions = {
27086 x: 0,
27087 y: 0,
27088 width: 0,
27089 height: 0,
27090 };
27091 }
27092}
27093const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"];
27094const svgMotionConfig = {
27095 useVisualState: makeUseVisualState({
27096 scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
27097 createRenderState: createSvgRenderState,
27098 onUpdate: ({ props, prevProps, current, renderState, latestValues, }) => {
27099 if (!current)
27100 return;
27101 let hasTransform = !!props.drag;
27102 if (!hasTransform) {
27103 for (const key in latestValues) {
27104 if (transformProps.has(key)) {
27105 hasTransform = true;
27106 break;
27107 }
27108 }
27109 }
27110 if (!hasTransform)
27111 return;
27112 let needsMeasure = !prevProps;
27113 if (prevProps) {
27114 /**
27115 * Check the layout props for changes, if any are found we need to
27116 * measure the element again.
27117 */
27118 for (let i = 0; i < layoutProps.length; i++) {
27119 const key = layoutProps[i];
27120 if (props[key] !==
27121 prevProps[key]) {
27122 needsMeasure = true;
27123 }
27124 }
27125 }
27126 if (!needsMeasure)
27127 return;
27128 frame_frame.read(() => {
27129 updateSVGDimensions(current, renderState);
27130 frame_frame.render(() => {
27131 buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate);
27132 renderSVG(current, renderState);
27133 });
27134 });
27135 },
27136 }),
27137};
27138
27139
27140
27141;// ./node_modules/framer-motion/dist/es/render/html/config-motion.mjs
27142
27143
27144
27145
27146const htmlMotionConfig = {
27147 useVisualState: makeUseVisualState({
27148 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,
27149 createRenderState: createHtmlRenderState,
27150 }),
27151};
27152
27153
27154
27155;// ./node_modules/framer-motion/dist/es/render/html/use-props.mjs
27156
27157
27158
27159
27160
27161
27162function copyRawValuesOnly(target, source, props) {
27163 for (const key in source) {
27164 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
27165 target[key] = source[key];
27166 }
27167 }
27168}
27169function useInitialMotionValues({ transformTemplate }, visualState) {
27170 return (0,external_React_.useMemo)(() => {
27171 const state = createHtmlRenderState();
27172 buildHTMLStyles(state, visualState, transformTemplate);
27173 return Object.assign({}, state.vars, state.style);
27174 }, [visualState]);
27175}
27176function useStyle(props, visualState) {
27177 const styleProp = props.style || {};
27178 const style = {};
27179 /**
27180 * Copy non-Motion Values straight into style
27181 */
27182 copyRawValuesOnly(style, styleProp, props);
27183 Object.assign(style, useInitialMotionValues(props, visualState));
27184 return style;
27185}
27186function useHTMLProps(props, visualState) {
27187 // The `any` isn't ideal but it is the type of createElement props argument
27188 const htmlProps = {};
27189 const style = useStyle(props, visualState);
27190 if (props.drag && props.dragListener !== false) {
27191 // Disable the ghost element when a user drags
27192 htmlProps.draggable = false;
27193 // Disable text selection
27194 style.userSelect =
27195 style.WebkitUserSelect =
27196 style.WebkitTouchCallout =
27197 "none";
27198 // Disable scrolling on the draggable direction
27199 style.touchAction =
27200 props.drag === true
27201 ? "none"
27202 : `pan-${props.drag === "x" ? "y" : "x"}`;
27203 }
27204 if (props.tabIndex === undefined &&
27205 (props.onTap || props.onTapStart || props.whileTap)) {
27206 htmlProps.tabIndex = 0;
27207 }
27208 htmlProps.style = style;
27209 return htmlProps;
27210}
27211
27212
27213
27214;// ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
27215/**
27216 * A list of all valid MotionProps.
27217 *
27218 * @privateRemarks
27219 * This doesn't throw if a `MotionProp` name is missing - it should.
27220 */
27221const validMotionProps = new Set([
27222 "animate",
27223 "exit",
27224 "variants",
27225 "initial",
27226 "style",
27227 "values",
27228 "variants",
27229 "transition",
27230 "transformTemplate",
27231 "custom",
27232 "inherit",
27233 "onBeforeLayoutMeasure",
27234 "onAnimationStart",
27235 "onAnimationComplete",
27236 "onUpdate",
27237 "onDragStart",
27238 "onDrag",
27239 "onDragEnd",
27240 "onMeasureDragConstraints",
27241 "onDirectionLock",
27242 "onDragTransitionEnd",
27243 "_dragX",
27244 "_dragY",
27245 "onHoverStart",
27246 "onHoverEnd",
27247 "onViewportEnter",
27248 "onViewportLeave",
27249 "globalTapTarget",
27250 "ignoreStrict",
27251 "viewport",
27252]);
27253/**
27254 * Check whether a prop name is a valid `MotionProp` key.
27255 *
27256 * @param key - Name of the property to check
27257 * @returns `true` is key is a valid `MotionProp`.
27258 *
27259 * @public
27260 */
27261function isValidMotionProp(key) {
27262 return (key.startsWith("while") ||
27263 (key.startsWith("drag") && key !== "draggable") ||
27264 key.startsWith("layout") ||
27265 key.startsWith("onTap") ||
27266 key.startsWith("onPan") ||
27267 key.startsWith("onLayout") ||
27268 validMotionProps.has(key));
27269}
27270
27271
27272
27273;// ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
27274
27275
27276let shouldForward = (key) => !isValidMotionProp(key);
27277function loadExternalIsValidProp(isValidProp) {
27278 if (!isValidProp)
27279 return;
27280 // Explicitly filter our events
27281 shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
27282}
27283/**
27284 * Emotion and Styled Components both allow users to pass through arbitrary props to their components
27285 * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
27286 * of these should be passed to the underlying DOM node.
27287 *
27288 * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
27289 * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
27290 * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
27291 * `@emotion/is-prop-valid`, however to fix this problem we need to use it.
27292 *
27293 * By making it an optionalDependency we can offer this functionality only in the situations where it's
27294 * actually required.
27295 */
27296try {
27297 /**
27298 * We attempt to import this package but require won't be defined in esm environments, in that case
27299 * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
27300 * in favour of explicit injection.
27301 */
27302 loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
27303}
27304catch (_a) {
27305 // We don't need to actually do anything here - the fallback is the existing `isPropValid`.
27306}
27307function filterProps(props, isDom, forwardMotionProps) {
27308 const filteredProps = {};
27309 for (const key in props) {
27310 /**
27311 * values is considered a valid prop by Emotion, so if it's present
27312 * this will be rendered out to the DOM unless explicitly filtered.
27313 *
27314 * We check the type as it could be used with the `feColorMatrix`
27315 * element, which we support.
27316 */
27317 if (key === "values" && typeof props.values === "object")
27318 continue;
27319 if (shouldForward(key) ||
27320 (forwardMotionProps === true && isValidMotionProp(key)) ||
27321 (!isDom && !isValidMotionProp(key)) ||
27322 // If trying to use native HTML drag events, forward drag listeners
27323 (props["draggable"] &&
27324 key.startsWith("onDrag"))) {
27325 filteredProps[key] =
27326 props[key];
27327 }
27328 }
27329 return filteredProps;
27330}
27331
27332
27333
27334;// ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs
27335
27336
27337
27338
27339
27340
27341function useSVGProps(props, visualState, _isStatic, Component) {
27342 const visualProps = (0,external_React_.useMemo)(() => {
27343 const state = createSvgRenderState();
27344 buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
27345 return {
27346 ...state.attrs,
27347 style: { ...state.style },
27348 };
27349 }, [visualState]);
27350 if (props.style) {
27351 const rawStyles = {};
27352 copyRawValuesOnly(rawStyles, props.style, props);
27353 visualProps.style = { ...rawStyles, ...visualProps.style };
27354 }
27355 return visualProps;
27356}
27357
27358
27359
27360;// ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs
27361
27362
27363
27364
27365
27366
27367
27368function createUseRender(forwardMotionProps = false) {
27369 const useRender = (Component, props, ref, { latestValues }, isStatic) => {
27370 const useVisualProps = isSVGComponent(Component)
27371 ? useSVGProps
27372 : useHTMLProps;
27373 const visualProps = useVisualProps(props, latestValues, isStatic, Component);
27374 const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
27375 const elementProps = Component !== external_React_.Fragment
27376 ? { ...filteredProps, ...visualProps, ref }
27377 : {};
27378 /**
27379 * If component has been handed a motion value as its child,
27380 * memoise its initial value and render that. Subsequent updates
27381 * will be handled by the onChange handler
27382 */
27383 const { children } = props;
27384 const renderedChildren = (0,external_React_.useMemo)(() => (isMotionValue(children) ? children.get() : children), [children]);
27385 return (0,external_React_.createElement)(Component, {
27386 ...elementProps,
27387 children: renderedChildren,
27388 });
27389 };
27390 return useRender;
27391}
27392
27393
27394
27395;// ./node_modules/framer-motion/dist/es/render/components/create-factory.mjs
27396
27397
27398
27399
27400
27401
27402function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
27403 return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) {
27404 const baseConfig = isSVGComponent(Component)
27405 ? svgMotionConfig
27406 : htmlMotionConfig;
27407 const config = {
27408 ...baseConfig,
27409 preloadedFeatures,
27410 useRender: createUseRender(forwardMotionProps),
27411 createVisualElement,
27412 Component,
27413 };
27414 return createRendererMotionComponent(config);
27415 };
27416}
27417
27418
27419
27420;// ./node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs
27421// Does this device prefer reduced motion? Returns `null` server-side.
27422const prefersReducedMotion = { current: null };
27423const hasReducedMotionListener = { current: false };
27424
27425
27426
27427;// ./node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs
27428
27429
27430
27431function initPrefersReducedMotion() {
27432 hasReducedMotionListener.current = true;
27433 if (!is_browser_isBrowser)
27434 return;
27435 if (window.matchMedia) {
27436 const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
27437 const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);
27438 motionMediaQuery.addListener(setReducedMotionPreferences);
27439 setReducedMotionPreferences();
27440 }
27441 else {
27442 prefersReducedMotion.current = false;
27443 }
27444}
27445
27446
27447
27448;// ./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs
27449
27450
27451
27452
27453
27454/**
27455 * A list of all ValueTypes
27456 */
27457const valueTypes = [...dimensionValueTypes, color, complex];
27458/**
27459 * Tests a value against the list of ValueTypes
27460 */
27461const findValueType = (v) => valueTypes.find(testValueType(v));
27462
27463
27464
27465;// ./node_modules/framer-motion/dist/es/render/store.mjs
27466const visualElementStore = new WeakMap();
27467
27468
27469
27470;// ./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs
27471
27472
27473
27474
27475function updateMotionValuesFromProps(element, next, prev) {
27476 for (const key in next) {
27477 const nextValue = next[key];
27478 const prevValue = prev[key];
27479 if (isMotionValue(nextValue)) {
27480 /**
27481 * If this is a motion value found in props or style, we want to add it
27482 * to our visual element's motion value map.
27483 */
27484 element.addValue(key, nextValue);
27485 /**
27486 * Check the version of the incoming motion value with this version
27487 * and warn against mismatches.
27488 */
27489 if (false) {}
27490 }
27491 else if (isMotionValue(prevValue)) {
27492 /**
27493 * If we're swapping from a motion value to a static value,
27494 * create a new motion value from that
27495 */
27496 element.addValue(key, motionValue(nextValue, { owner: element }));
27497 }
27498 else if (prevValue !== nextValue) {
27499 /**
27500 * If this is a flat value that has changed, update the motion value
27501 * or create one if it doesn't exist. We only want to do this if we're
27502 * not handling the value with our animation state.
27503 */
27504 if (element.hasValue(key)) {
27505 const existingValue = element.getValue(key);
27506 if (existingValue.liveStyle === true) {
27507 existingValue.jump(nextValue);
27508 }
27509 else if (!existingValue.hasAnimated) {
27510 existingValue.set(nextValue);
27511 }
27512 }
27513 else {
27514 const latestValue = element.getStaticValue(key);
27515 element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));
27516 }
27517 }
27518 }
27519 // Handle removed values
27520 for (const key in prev) {
27521 if (next[key] === undefined)
27522 element.removeValue(key);
27523 }
27524 return next;
27525}
27526
27527
27528
27529;// ./node_modules/framer-motion/dist/es/render/VisualElement.mjs
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552const propEventHandlers = [
27553 "AnimationStart",
27554 "AnimationComplete",
27555 "Update",
27556 "BeforeLayoutMeasure",
27557 "LayoutMeasure",
27558 "LayoutAnimationStart",
27559 "LayoutAnimationComplete",
27560];
27561/**
27562 * A VisualElement is an imperative abstraction around UI elements such as
27563 * HTMLElement, SVGElement, Three.Object3D etc.
27564 */
27565class VisualElement {
27566 /**
27567 * This method takes React props and returns found MotionValues. For example, HTML
27568 * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
27569 *
27570 * This isn't an abstract method as it needs calling in the constructor, but it is
27571 * intended to be one.
27572 */
27573 scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {
27574 return {};
27575 }
27576 constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {
27577 /**
27578 * A reference to the current underlying Instance, e.g. a HTMLElement
27579 * or Three.Mesh etc.
27580 */
27581 this.current = null;
27582 /**
27583 * A set containing references to this VisualElement's children.
27584 */
27585 this.children = new Set();
27586 /**
27587 * Determine what role this visual element should take in the variant tree.
27588 */
27589 this.isVariantNode = false;
27590 this.isControllingVariants = false;
27591 /**
27592 * Decides whether this VisualElement should animate in reduced motion
27593 * mode.
27594 *
27595 * TODO: This is currently set on every individual VisualElement but feels
27596 * like it could be set globally.
27597 */
27598 this.shouldReduceMotion = null;
27599 /**
27600 * A map of all motion values attached to this visual element. Motion
27601 * values are source of truth for any given animated value. A motion
27602 * value might be provided externally by the component via props.
27603 */
27604 this.values = new Map();
27605 this.KeyframeResolver = KeyframeResolver;
27606 /**
27607 * Cleanup functions for active features (hover/tap/exit etc)
27608 */
27609 this.features = {};
27610 /**
27611 * A map of every subscription that binds the provided or generated
27612 * motion values onChange listeners to this visual element.
27613 */
27614 this.valueSubscriptions = new Map();
27615 /**
27616 * A reference to the previously-provided motion values as returned
27617 * from scrapeMotionValuesFromProps. We use the keys in here to determine
27618 * if any motion values need to be removed after props are updated.
27619 */
27620 this.prevMotionValues = {};
27621 /**
27622 * An object containing a SubscriptionManager for each active event.
27623 */
27624 this.events = {};
27625 /**
27626 * An object containing an unsubscribe function for each prop event subscription.
27627 * For example, every "Update" event can have multiple subscribers via
27628 * VisualElement.on(), but only one of those can be defined via the onUpdate prop.
27629 */
27630 this.propEventSubscriptions = {};
27631 this.notifyUpdate = () => this.notify("Update", this.latestValues);
27632 this.render = () => {
27633 if (!this.current)
27634 return;
27635 this.triggerBuild();
27636 this.renderInstance(this.current, this.renderState, this.props.style, this.projection);
27637 };
27638 this.renderScheduledAt = 0.0;
27639 this.scheduleRender = () => {
27640 const now = time.now();
27641 if (this.renderScheduledAt < now) {
27642 this.renderScheduledAt = now;
27643 frame_frame.render(this.render, false, true);
27644 }
27645 };
27646 const { latestValues, renderState, onUpdate } = visualState;
27647 this.onUpdate = onUpdate;
27648 this.latestValues = latestValues;
27649 this.baseTarget = { ...latestValues };
27650 this.initialValues = props.initial ? { ...latestValues } : {};
27651 this.renderState = renderState;
27652 this.parent = parent;
27653 this.props = props;
27654 this.presenceContext = presenceContext;
27655 this.depth = parent ? parent.depth + 1 : 0;
27656 this.reducedMotionConfig = reducedMotionConfig;
27657 this.options = options;
27658 this.blockInitialAnimation = Boolean(blockInitialAnimation);
27659 this.isControllingVariants = isControllingVariants(props);
27660 this.isVariantNode = isVariantNode(props);
27661 if (this.isVariantNode) {
27662 this.variantChildren = new Set();
27663 }
27664 this.manuallyAnimateOnMount = Boolean(parent && parent.current);
27665 /**
27666 * Any motion values that are provided to the element when created
27667 * aren't yet bound to the element, as this would technically be impure.
27668 * However, we iterate through the motion values and set them to the
27669 * initial values for this component.
27670 *
27671 * TODO: This is impure and we should look at changing this to run on mount.
27672 * Doing so will break some tests but this isn't necessarily a breaking change,
27673 * more a reflection of the test.
27674 */
27675 const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);
27676 for (const key in initialMotionValues) {
27677 const value = initialMotionValues[key];
27678 if (latestValues[key] !== undefined && isMotionValue(value)) {
27679 value.set(latestValues[key], false);
27680 }
27681 }
27682 }
27683 mount(instance) {
27684 this.current = instance;
27685 visualElementStore.set(instance, this);
27686 if (this.projection && !this.projection.instance) {
27687 this.projection.mount(instance);
27688 }
27689 if (this.parent && this.isVariantNode && !this.isControllingVariants) {
27690 this.removeFromVariantTree = this.parent.addVariantChild(this);
27691 }
27692 this.values.forEach((value, key) => this.bindToMotionValue(key, value));
27693 if (!hasReducedMotionListener.current) {
27694 initPrefersReducedMotion();
27695 }
27696 this.shouldReduceMotion =
27697 this.reducedMotionConfig === "never"
27698 ? false
27699 : this.reducedMotionConfig === "always"
27700 ? true
27701 : prefersReducedMotion.current;
27702 if (false) {}
27703 if (this.parent)
27704 this.parent.children.add(this);
27705 this.update(this.props, this.presenceContext);
27706 }
27707 unmount() {
27708 visualElementStore.delete(this.current);
27709 this.projection && this.projection.unmount();
27710 cancelFrame(this.notifyUpdate);
27711 cancelFrame(this.render);
27712 this.valueSubscriptions.forEach((remove) => remove());
27713 this.valueSubscriptions.clear();
27714 this.removeFromVariantTree && this.removeFromVariantTree();
27715 this.parent && this.parent.children.delete(this);
27716 for (const key in this.events) {
27717 this.events[key].clear();
27718 }
27719 for (const key in this.features) {
27720 const feature = this.features[key];
27721 if (feature) {
27722 feature.unmount();
27723 feature.isMounted = false;
27724 }
27725 }
27726 this.current = null;
27727 }
27728 bindToMotionValue(key, value) {
27729 if (this.valueSubscriptions.has(key)) {
27730 this.valueSubscriptions.get(key)();
27731 }
27732 const valueIsTransform = transformProps.has(key);
27733 const removeOnChange = value.on("change", (latestValue) => {
27734 this.latestValues[key] = latestValue;
27735 this.props.onUpdate && frame_frame.preRender(this.notifyUpdate);
27736 if (valueIsTransform && this.projection) {
27737 this.projection.isTransformDirty = true;
27738 }
27739 });
27740 const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
27741 let removeSyncCheck;
27742 if (window.MotionCheckAppearSync) {
27743 removeSyncCheck = window.MotionCheckAppearSync(this, key, value);
27744 }
27745 this.valueSubscriptions.set(key, () => {
27746 removeOnChange();
27747 removeOnRenderRequest();
27748 if (removeSyncCheck)
27749 removeSyncCheck();
27750 if (value.owner)
27751 value.stop();
27752 });
27753 }
27754 sortNodePosition(other) {
27755 /**
27756 * If these nodes aren't even of the same type we can't compare their depth.
27757 */
27758 if (!this.current ||
27759 !this.sortInstanceNodePosition ||
27760 this.type !== other.type) {
27761 return 0;
27762 }
27763 return this.sortInstanceNodePosition(this.current, other.current);
27764 }
27765 updateFeatures() {
27766 let key = "animation";
27767 for (key in featureDefinitions) {
27768 const featureDefinition = featureDefinitions[key];
27769 if (!featureDefinition)
27770 continue;
27771 const { isEnabled, Feature: FeatureConstructor } = featureDefinition;
27772 /**
27773 * If this feature is enabled but not active, make a new instance.
27774 */
27775 if (!this.features[key] &&
27776 FeatureConstructor &&
27777 isEnabled(this.props)) {
27778 this.features[key] = new FeatureConstructor(this);
27779 }
27780 /**
27781 * If we have a feature, mount or update it.
27782 */
27783 if (this.features[key]) {
27784 const feature = this.features[key];
27785 if (feature.isMounted) {
27786 feature.update();
27787 }
27788 else {
27789 feature.mount();
27790 feature.isMounted = true;
27791 }
27792 }
27793 }
27794 }
27795 triggerBuild() {
27796 this.build(this.renderState, this.latestValues, this.props);
27797 }
27798 /**
27799 * Measure the current viewport box with or without transforms.
27800 * Only measures axis-aligned boxes, rotate and skew must be manually
27801 * removed with a re-render to work.
27802 */
27803 measureViewportBox() {
27804 return this.current
27805 ? this.measureInstanceViewportBox(this.current, this.props)
27806 : createBox();
27807 }
27808 getStaticValue(key) {
27809 return this.latestValues[key];
27810 }
27811 setStaticValue(key, value) {
27812 this.latestValues[key] = value;
27813 }
27814 /**
27815 * Update the provided props. Ensure any newly-added motion values are
27816 * added to our map, old ones removed, and listeners updated.
27817 */
27818 update(props, presenceContext) {
27819 if (props.transformTemplate || this.props.transformTemplate) {
27820 this.scheduleRender();
27821 }
27822 this.prevProps = this.props;
27823 this.props = props;
27824 this.prevPresenceContext = this.presenceContext;
27825 this.presenceContext = presenceContext;
27826 /**
27827 * Update prop event handlers ie onAnimationStart, onAnimationComplete
27828 */
27829 for (let i = 0; i < propEventHandlers.length; i++) {
27830 const key = propEventHandlers[i];
27831 if (this.propEventSubscriptions[key]) {
27832 this.propEventSubscriptions[key]();
27833 delete this.propEventSubscriptions[key];
27834 }
27835 const listenerName = ("on" + key);
27836 const listener = props[listenerName];
27837 if (listener) {
27838 this.propEventSubscriptions[key] = this.on(key, listener);
27839 }
27840 }
27841 this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);
27842 if (this.handleChildMotionValue) {
27843 this.handleChildMotionValue();
27844 }
27845 this.onUpdate && this.onUpdate(this);
27846 }
27847 getProps() {
27848 return this.props;
27849 }
27850 /**
27851 * Returns the variant definition with a given name.
27852 */
27853 getVariant(name) {
27854 return this.props.variants ? this.props.variants[name] : undefined;
27855 }
27856 /**
27857 * Returns the defined default transition on this component.
27858 */
27859 getDefaultTransition() {
27860 return this.props.transition;
27861 }
27862 getTransformPagePoint() {
27863 return this.props.transformPagePoint;
27864 }
27865 getClosestVariantNode() {
27866 return this.isVariantNode
27867 ? this
27868 : this.parent
27869 ? this.parent.getClosestVariantNode()
27870 : undefined;
27871 }
27872 /**
27873 * Add a child visual element to our set of children.
27874 */
27875 addVariantChild(child) {
27876 const closestVariantNode = this.getClosestVariantNode();
27877 if (closestVariantNode) {
27878 closestVariantNode.variantChildren &&
27879 closestVariantNode.variantChildren.add(child);
27880 return () => closestVariantNode.variantChildren.delete(child);
27881 }
27882 }
27883 /**
27884 * Add a motion value and bind it to this visual element.
27885 */
27886 addValue(key, value) {
27887 // Remove existing value if it exists
27888 const existingValue = this.values.get(key);
27889 if (value !== existingValue) {
27890 if (existingValue)
27891 this.removeValue(key);
27892 this.bindToMotionValue(key, value);
27893 this.values.set(key, value);
27894 this.latestValues[key] = value.get();
27895 }
27896 }
27897 /**
27898 * Remove a motion value and unbind any active subscriptions.
27899 */
27900 removeValue(key) {
27901 this.values.delete(key);
27902 const unsubscribe = this.valueSubscriptions.get(key);
27903 if (unsubscribe) {
27904 unsubscribe();
27905 this.valueSubscriptions.delete(key);
27906 }
27907 delete this.latestValues[key];
27908 this.removeValueFromRenderState(key, this.renderState);
27909 }
27910 /**
27911 * Check whether we have a motion value for this key
27912 */
27913 hasValue(key) {
27914 return this.values.has(key);
27915 }
27916 getValue(key, defaultValue) {
27917 if (this.props.values && this.props.values[key]) {
27918 return this.props.values[key];
27919 }
27920 let value = this.values.get(key);
27921 if (value === undefined && defaultValue !== undefined) {
27922 value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });
27923 this.addValue(key, value);
27924 }
27925 return value;
27926 }
27927 /**
27928 * If we're trying to animate to a previously unencountered value,
27929 * we need to check for it in our state and as a last resort read it
27930 * directly from the instance (which might have performance implications).
27931 */
27932 readValue(key, target) {
27933 var _a;
27934 let value = this.latestValues[key] !== undefined || !this.current
27935 ? this.latestValues[key]
27936 : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options);
27937 if (value !== undefined && value !== null) {
27938 if (typeof value === "string" &&
27939 (isNumericalString(value) || isZeroValueString(value))) {
27940 // If this is a number read as a string, ie "0" or "200", convert it to a number
27941 value = parseFloat(value);
27942 }
27943 else if (!findValueType(value) && complex.test(target)) {
27944 value = animatable_none_getAnimatableNone(key, target);
27945 }
27946 this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);
27947 }
27948 return isMotionValue(value) ? value.get() : value;
27949 }
27950 /**
27951 * Set the base target to later animate back to. This is currently
27952 * only hydrated on creation and when we first read a value.
27953 */
27954 setBaseTarget(key, value) {
27955 this.baseTarget[key] = value;
27956 }
27957 /**
27958 * Find the base target for a value thats been removed from all animation
27959 * props.
27960 */
27961 getBaseTarget(key) {
27962 var _a;
27963 const { initial } = this.props;
27964 let valueFromInitial;
27965 if (typeof initial === "string" || typeof initial === "object") {
27966 const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom);
27967 if (variant) {
27968 valueFromInitial = variant[key];
27969 }
27970 }
27971 /**
27972 * If this value still exists in the current initial variant, read that.
27973 */
27974 if (initial && valueFromInitial !== undefined) {
27975 return valueFromInitial;
27976 }
27977 /**
27978 * Alternatively, if this VisualElement config has defined a getBaseTarget
27979 * so we can read the value from an alternative source, try that.
27980 */
27981 const target = this.getBaseTargetFromProps(this.props, key);
27982 if (target !== undefined && !isMotionValue(target))
27983 return target;
27984 /**
27985 * If the value was initially defined on initial, but it doesn't any more,
27986 * return undefined. Otherwise return the value as initially read from the DOM.
27987 */
27988 return this.initialValues[key] !== undefined &&
27989 valueFromInitial === undefined
27990 ? undefined
27991 : this.baseTarget[key];
27992 }
27993 on(eventName, callback) {
27994 if (!this.events[eventName]) {
27995 this.events[eventName] = new SubscriptionManager();
27996 }
27997 return this.events[eventName].add(callback);
27998 }
27999 notify(eventName, ...args) {
28000 if (this.events[eventName]) {
28001 this.events[eventName].notify(...args);
28002 }
28003 }
28004}
28005
28006
28007
28008;// ./node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs
28009
28010
28011
28012
28013class DOMVisualElement extends VisualElement {
28014 constructor() {
28015 super(...arguments);
28016 this.KeyframeResolver = DOMKeyframesResolver;
28017 }
28018 sortInstanceNodePosition(a, b) {
28019 /**
28020 * compareDocumentPosition returns a bitmask, by using the bitwise &
28021 * we're returning true if 2 in that bitmask is set to true. 2 is set
28022 * to true if b preceeds a.
28023 */
28024 return a.compareDocumentPosition(b) & 2 ? 1 : -1;
28025 }
28026 getBaseTargetFromProps(props, key) {
28027 return props.style
28028 ? props.style[key]
28029 : undefined;
28030 }
28031 removeValueFromRenderState(key, { vars, style }) {
28032 delete vars[key];
28033 delete style[key];
28034 }
28035 handleChildMotionValue() {
28036 if (this.childSubscription) {
28037 this.childSubscription();
28038 delete this.childSubscription;
28039 }
28040 const { children } = this.props;
28041 if (isMotionValue(children)) {
28042 this.childSubscription = children.on("change", (latest) => {
28043 if (this.current) {
28044 this.current.textContent = `${latest}`;
28045 }
28046 });
28047 }
28048 }
28049}
28050
28051
28052
28053;// ./node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063function HTMLVisualElement_getComputedStyle(element) {
28064 return window.getComputedStyle(element);
28065}
28066class HTMLVisualElement extends DOMVisualElement {
28067 constructor() {
28068 super(...arguments);
28069 this.type = "html";
28070 this.renderInstance = renderHTML;
28071 }
28072 readValueFromInstance(instance, key) {
28073 if (transformProps.has(key)) {
28074 const defaultType = getDefaultValueType(key);
28075 return defaultType ? defaultType.default || 0 : 0;
28076 }
28077 else {
28078 const computedStyle = HTMLVisualElement_getComputedStyle(instance);
28079 const value = (isCSSVariableName(key)
28080 ? computedStyle.getPropertyValue(key)
28081 : computedStyle[key]) || 0;
28082 return typeof value === "string" ? value.trim() : value;
28083 }
28084 }
28085 measureInstanceViewportBox(instance, { transformPagePoint }) {
28086 return measureViewportBox(instance, transformPagePoint);
28087 }
28088 build(renderState, latestValues, props) {
28089 buildHTMLStyles(renderState, latestValues, props.transformTemplate);
28090 }
28091 scrapeMotionValuesFromProps(props, prevProps, visualElement) {
28092 return scrapeMotionValuesFromProps(props, prevProps, visualElement);
28093 }
28094}
28095
28096
28097
28098;// ./node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110class SVGVisualElement extends DOMVisualElement {
28111 constructor() {
28112 super(...arguments);
28113 this.type = "svg";
28114 this.isSVGTag = false;
28115 this.measureInstanceViewportBox = createBox;
28116 }
28117 getBaseTargetFromProps(props, key) {
28118 return props[key];
28119 }
28120 readValueFromInstance(instance, key) {
28121 if (transformProps.has(key)) {
28122 const defaultType = getDefaultValueType(key);
28123 return defaultType ? defaultType.default || 0 : 0;
28124 }
28125 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
28126 return instance.getAttribute(key);
28127 }
28128 scrapeMotionValuesFromProps(props, prevProps, visualElement) {
28129 return scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement);
28130 }
28131 build(renderState, latestValues, props) {
28132 buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
28133 }
28134 renderInstance(instance, renderState, styleProp, projection) {
28135 renderSVG(instance, renderState, styleProp, projection);
28136 }
28137 mount(instance) {
28138 this.isSVGTag = isSVGTag(instance.tagName);
28139 super.mount(instance);
28140 }
28141}
28142
28143
28144
28145;// ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs
28146
28147
28148
28149
28150
28151const createDomVisualElement = (Component, options) => {
28152 return isSVGComponent(Component)
28153 ? new SVGVisualElement(options)
28154 : new HTMLVisualElement(options, {
28155 allowProjection: Component !== external_React_.Fragment,
28156 });
28157};
28158
28159
28160
28161;// ./node_modules/framer-motion/dist/es/render/components/motion/create.mjs
28162
28163
28164
28165
28166
28167
28168
28169const createMotionComponent = /*@__PURE__*/ createMotionComponentFactory({
28170 ...animations,
28171 ...gestureAnimations,
28172 ...drag,
28173 ...layout,
28174}, createDomVisualElement);
28175
28176
28177
28178;// ./node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs
28179
28180
28181
28182const motion = /*@__PURE__*/ createDOMMotionComponentProxy(createMotionComponent);
28183
28184
28185
28186;// ./node_modules/@wordpress/components/build-module/utils/use-responsive-value.js
28187
28188const breakpoints = ["40em", "52em", "64em"];
28189const useBreakpointIndex = (options = {}) => {
28190 const {
28191 defaultIndex = 0
28192 } = options;
28193 if (typeof defaultIndex !== "number") {
28194 throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
28195 } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) {
28196 throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
28197 }
28198 const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
28199 (0,external_wp_element_namespaceObject.useEffect)(() => {
28200 const getIndex = () => breakpoints.filter((bp) => {
28201 return typeof window !== "undefined" ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
28202 }).length;
28203 const onResize = () => {
28204 const newValue = getIndex();
28205 if (value !== newValue) {
28206 setValue(newValue);
28207 }
28208 };
28209 onResize();
28210 if (typeof window !== "undefined") {
28211 window.addEventListener("resize", onResize);
28212 }
28213 return () => {
28214 if (typeof window !== "undefined") {
28215 window.removeEventListener("resize", onResize);
28216 }
28217 };
28218 }, [value]);
28219 return value;
28220};
28221function useResponsiveValue(values, options = {}) {
28222 const index = useBreakpointIndex(options);
28223 if (!Array.isArray(values) && typeof values !== "function") {
28224 return values;
28225 }
28226 const array = values || [];
28227 return (
28228 /** @type {T[]} */
28229 array[
28230 /* eslint-enable jsdoc/no-undefined-types */
28231 index >= array.length ? array.length - 1 : index
28232 ]
28233 );
28234}
28235
28236
28237;// ./node_modules/@wordpress/components/build-module/flex/styles.js
28238function styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
28239 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
28240}
28241
28242const Flex = true ? {
28243 name: "zjik7",
28244 styles: "display:flex"
28245} : 0;
28246const Item = true ? {
28247 name: "qgaee5",
28248 styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"
28249} : 0;
28250const block = true ? {
28251 name: "82a6rk",
28252 styles: "flex:1"
28253} : 0;
28254const ItemsColumn = true ? {
28255 name: "13nosa1",
28256 styles: ">*{min-height:0;}"
28257} : 0;
28258const ItemsRow = true ? {
28259 name: "1pwxzk4",
28260 styles: ">*{min-width:0;}"
28261} : 0;
28262
28263
28264;// ./node_modules/@wordpress/components/build-module/flex/flex/hook.js
28265
28266
28267
28268
28269
28270
28271
28272
28273function useDeprecatedProps(props) {
28274 const {
28275 isReversed,
28276 ...otherProps
28277 } = props;
28278 if (typeof isReversed !== "undefined") {
28279 external_wp_deprecated_default()("Flex isReversed", {
28280 alternative: 'Flex direction="row-reverse" or "column-reverse"',
28281 since: "5.9"
28282 });
28283 return {
28284 ...otherProps,
28285 direction: isReversed ? "row-reverse" : "row"
28286 };
28287 }
28288 return otherProps;
28289}
28290function useFlex(props) {
28291 const {
28292 align,
28293 className,
28294 direction: directionProp = "row",
28295 expanded = true,
28296 gap = 2,
28297 justify = "space-between",
28298 wrap = false,
28299 ...otherProps
28300 } = useContextSystem(useDeprecatedProps(props), "Flex");
28301 const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];
28302 const direction = useResponsiveValue(directionAsArray);
28303 const isColumn = typeof direction === "string" && !!direction.includes("column");
28304 const cx = useCx();
28305 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
28306 const base = /* @__PURE__ */ emotion_react_browser_esm_css({
28307 alignItems: align !== null && align !== void 0 ? align : isColumn ? "normal" : "center",
28308 flexDirection: direction,
28309 flexWrap: wrap ? "wrap" : void 0,
28310 gap: space(gap),
28311 justifyContent: justify,
28312 height: isColumn && expanded ? "100%" : void 0,
28313 width: !isColumn && expanded ? "100%" : void 0
28314 }, true ? "" : 0, true ? "" : 0);
28315 return cx(Flex, base, isColumn ? ItemsColumn : ItemsRow, className);
28316 }, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]);
28317 return {
28318 ...otherProps,
28319 className: classes,
28320 isColumn
28321 };
28322}
28323
28324
28325;// ./node_modules/@wordpress/components/build-module/flex/context.js
28326
28327const FlexContext = (0,external_wp_element_namespaceObject.createContext)({
28328 flexItemDisplay: void 0
28329});
28330const useFlexContext = () => (0,external_wp_element_namespaceObject.useContext)(FlexContext);
28331
28332
28333;// ./node_modules/@wordpress/components/build-module/flex/flex/component.js
28334
28335
28336
28337
28338
28339function UnconnectedFlex(props, forwardedRef) {
28340 const {
28341 children,
28342 isColumn,
28343 ...otherProps
28344 } = useFlex(props);
28345 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexContext.Provider, {
28346 value: {
28347 flexItemDisplay: isColumn ? "block" : void 0
28348 },
28349 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
28350 ...otherProps,
28351 ref: forwardedRef,
28352 children
28353 })
28354 });
28355}
28356const component_Flex = contextConnect(UnconnectedFlex, "Flex");
28357var flex_component_component_default = component_Flex;
28358
28359
28360;// ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js
28361
28362
28363
28364
28365
28366function useFlexItem(props) {
28367 const {
28368 className,
28369 display: displayProp,
28370 isBlock = false,
28371 ...otherProps
28372 } = useContextSystem(props, "FlexItem");
28373 const sx = {};
28374 const contextDisplay = useFlexContext().flexItemDisplay;
28375 sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
28376 display: displayProp || contextDisplay
28377 }, true ? "" : 0, true ? "" : 0);
28378 const cx = useCx();
28379 const classes = cx(Item, sx.Base, isBlock && block, className);
28380 return {
28381 ...otherProps,
28382 className: classes
28383 };
28384}
28385
28386
28387;// ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js
28388
28389
28390function useFlexBlock(props) {
28391 const otherProps = useContextSystem(props, "FlexBlock");
28392 const flexItemProps = useFlexItem({
28393 isBlock: true,
28394 ...otherProps
28395 });
28396 return flexItemProps;
28397}
28398
28399
28400;// ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js
28401
28402
28403
28404
28405function UnconnectedFlexBlock(props, forwardedRef) {
28406 const flexBlockProps = useFlexBlock(props);
28407 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
28408 ...flexBlockProps,
28409 ref: forwardedRef
28410 });
28411}
28412const FlexBlock = contextConnect(UnconnectedFlexBlock, "FlexBlock");
28413var flex_block_component_component_default = FlexBlock;
28414
28415
28416;// ./node_modules/@wordpress/components/build-module/utils/rtl.js
28417
28418
28419const LOWER_LEFT_REGEXP = new RegExp(/-left/g);
28420const LOWER_RIGHT_REGEXP = new RegExp(/-right/g);
28421const UPPER_LEFT_REGEXP = new RegExp(/Left/g);
28422const UPPER_RIGHT_REGEXP = new RegExp(/Right/g);
28423function getConvertedKey(key) {
28424 if (key === "left") {
28425 return "right";
28426 }
28427 if (key === "right") {
28428 return "left";
28429 }
28430 if (LOWER_LEFT_REGEXP.test(key)) {
28431 return key.replace(LOWER_LEFT_REGEXP, "-right");
28432 }
28433 if (LOWER_RIGHT_REGEXP.test(key)) {
28434 return key.replace(LOWER_RIGHT_REGEXP, "-left");
28435 }
28436 if (UPPER_LEFT_REGEXP.test(key)) {
28437 return key.replace(UPPER_LEFT_REGEXP, "Right");
28438 }
28439 if (UPPER_RIGHT_REGEXP.test(key)) {
28440 return key.replace(UPPER_RIGHT_REGEXP, "Left");
28441 }
28442 return key;
28443}
28444const convertLTRToRTL = (ltrStyles = {}) => {
28445 return Object.fromEntries(Object.entries(ltrStyles).map(([key, value]) => [getConvertedKey(key), value]));
28446};
28447function rtl(ltrStyles = {}, rtlStyles) {
28448 return () => {
28449 if (rtlStyles) {
28450 return (0,external_wp_i18n_namespaceObject.isRTL)() ? /* @__PURE__ */ emotion_react_browser_esm_css(rtlStyles, true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css(ltrStyles, true ? "" : 0, true ? "" : 0);
28451 }
28452 return (0,external_wp_i18n_namespaceObject.isRTL)() ? /* @__PURE__ */ emotion_react_browser_esm_css(convertLTRToRTL(ltrStyles), true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css(ltrStyles, true ? "" : 0, true ? "" : 0);
28453 };
28454}
28455rtl.watch = () => (0,external_wp_i18n_namespaceObject.isRTL)();
28456
28457
28458;// ./node_modules/@wordpress/components/build-module/spacer/hook.js
28459
28460
28461
28462
28463function isDefined(o) {
28464 return typeof o !== "undefined" && o !== null;
28465}
28466function useSpacer(props) {
28467 const {
28468 className,
28469 margin,
28470 marginBottom = 2,
28471 marginLeft,
28472 marginRight,
28473 marginTop,
28474 marginX,
28475 marginY,
28476 padding,
28477 paddingBottom,
28478 paddingLeft,
28479 paddingRight,
28480 paddingTop,
28481 paddingX,
28482 paddingY,
28483 ...otherProps
28484 } = useContextSystem(props, "Spacer");
28485 const cx = useCx();
28486 const classes = cx(isDefined(margin) && /* @__PURE__ */ emotion_react_browser_esm_css("margin:", space(margin), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginY) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(marginY), ";margin-top:", space(marginY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginX) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-left:", space(marginX), ";margin-right:", space(marginX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginTop) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-top:", space(marginTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginBottom) && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(marginBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(marginLeft) && rtl({
28487 marginLeft: space(marginLeft)
28488 })(), isDefined(marginRight) && rtl({
28489 marginRight: space(marginRight)
28490 })(), isDefined(padding) && /* @__PURE__ */ emotion_react_browser_esm_css("padding:", space(padding), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingY) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-bottom:", space(paddingY), ";padding-top:", space(paddingY), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingX) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-left:", space(paddingX), ";padding-right:", space(paddingX), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingTop) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-top:", space(paddingTop), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingBottom) && /* @__PURE__ */ emotion_react_browser_esm_css("padding-bottom:", space(paddingBottom), ";" + ( true ? "" : 0), true ? "" : 0), isDefined(paddingLeft) && rtl({
28491 paddingLeft: space(paddingLeft)
28492 })(), isDefined(paddingRight) && rtl({
28493 paddingRight: space(paddingRight)
28494 })(), className);
28495 return {
28496 ...otherProps,
28497 className: classes
28498 };
28499}
28500
28501
28502;// ./node_modules/@wordpress/components/build-module/spacer/component.js
28503
28504
28505
28506
28507function UnconnectedSpacer(props, forwardedRef) {
28508 const spacerProps = useSpacer(props);
28509 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
28510 ...spacerProps,
28511 ref: forwardedRef
28512 });
28513}
28514const Spacer = contextConnect(UnconnectedSpacer, "Spacer");
28515var spacer_component_component_default = Spacer;
28516
28517
28518;// ./node_modules/@wordpress/icons/build-module/library/plus.js
28519
28520
28521var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
28522
28523
28524;// ./node_modules/@wordpress/icons/build-module/library/reset.js
28525
28526
28527var reset_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" }) });
28528
28529
28530;// ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js
28531
28532
28533
28534
28535function UnconnectedFlexItem(props, forwardedRef) {
28536 const flexItemProps = useFlexItem(props);
28537 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
28538 ...flexItemProps,
28539 ref: forwardedRef
28540 });
28541}
28542const FlexItem = contextConnect(UnconnectedFlexItem, "FlexItem");
28543var flex_item_component_component_default = FlexItem;
28544
28545
28546;// ./node_modules/@wordpress/components/build-module/truncate/styles.js
28547function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
28548 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
28549}
28550
28551const Truncate = true ? {
28552 name: "hdknak",
28553 styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"
28554} : 0;
28555
28556
28557;// ./node_modules/@wordpress/components/build-module/utils/values.js
28558function isValueDefined(value) {
28559 return value !== void 0 && value !== null;
28560}
28561function isValueEmpty(value) {
28562 const isEmptyString = value === "";
28563 return !isValueDefined(value) || isEmptyString;
28564}
28565function getDefinedValue(values = [], fallbackValue) {
28566 var _values$find;
28567 return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue;
28568}
28569const stringToNumber = (value) => {
28570 return parseFloat(value);
28571};
28572const ensureNumber = (value) => {
28573 return typeof value === "string" ? stringToNumber(value) : value;
28574};
28575
28576
28577;// ./node_modules/@wordpress/components/build-module/truncate/utils.js
28578
28579const TRUNCATE_ELLIPSIS = "\u2026";
28580const TRUNCATE_TYPE = {
28581 auto: "auto",
28582 head: "head",
28583 middle: "middle",
28584 tail: "tail",
28585 none: "none"
28586};
28587const TRUNCATE_DEFAULT_PROPS = {
28588 ellipsis: TRUNCATE_ELLIPSIS,
28589 ellipsizeMode: TRUNCATE_TYPE.auto,
28590 limit: 0,
28591 numberOfLines: 0
28592};
28593function truncateMiddle(word, headLength, tailLength, ellipsis) {
28594 if (typeof word !== "string") {
28595 return "";
28596 }
28597 const wordLength = word.length;
28598 const frontLength = ~~headLength;
28599 const backLength = ~~tailLength;
28600 const truncateStr = isValueDefined(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS;
28601 if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) {
28602 return word;
28603 } else if (backLength === 0) {
28604 return word.slice(0, frontLength) + truncateStr;
28605 }
28606 return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
28607}
28608function truncateContent(words = "", props) {
28609 const mergedProps = {
28610 ...TRUNCATE_DEFAULT_PROPS,
28611 ...props
28612 };
28613 const {
28614 ellipsis,
28615 ellipsizeMode,
28616 limit
28617 } = mergedProps;
28618 if (ellipsizeMode === TRUNCATE_TYPE.none) {
28619 return words;
28620 }
28621 let truncateHead;
28622 let truncateTail;
28623 switch (ellipsizeMode) {
28624 case TRUNCATE_TYPE.head:
28625 truncateHead = 0;
28626 truncateTail = limit;
28627 break;
28628 case TRUNCATE_TYPE.middle:
28629 truncateHead = Math.floor(limit / 2);
28630 truncateTail = Math.floor(limit / 2);
28631 break;
28632 default:
28633 truncateHead = limit;
28634 truncateTail = 0;
28635 }
28636 const truncatedContent = ellipsizeMode !== TRUNCATE_TYPE.auto ? truncateMiddle(words, truncateHead, truncateTail, ellipsis) : words;
28637 return truncatedContent;
28638}
28639
28640
28641;// ./node_modules/@wordpress/components/build-module/truncate/hook.js
28642
28643
28644
28645
28646
28647
28648function useTruncate(props) {
28649 const {
28650 className,
28651 children,
28652 ellipsis = TRUNCATE_ELLIPSIS,
28653 ellipsizeMode = TRUNCATE_TYPE.auto,
28654 limit = 0,
28655 numberOfLines = 0,
28656 ...otherProps
28657 } = useContextSystem(props, "Truncate");
28658 const cx = useCx();
28659 let childrenAsText;
28660 if (typeof children === "string") {
28661 childrenAsText = children;
28662 } else if (typeof children === "number") {
28663 childrenAsText = children.toString();
28664 }
28665 const truncatedContent = childrenAsText ? truncateContent(childrenAsText, {
28666 ellipsis,
28667 ellipsizeMode,
28668 limit,
28669 numberOfLines
28670 }) : children;
28671 const shouldTruncate = !!childrenAsText && ellipsizeMode === TRUNCATE_TYPE.auto;
28672 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
28673 const truncateLines = /* @__PURE__ */ emotion_react_browser_esm_css(numberOfLines === 1 ? "word-break: break-all;" : "", " -webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : 0), true ? "" : 0);
28674 return cx(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && truncateLines, className);
28675 }, [className, cx, numberOfLines, shouldTruncate]);
28676 return {
28677 ...otherProps,
28678 className: classes,
28679 children: truncatedContent
28680 };
28681}
28682
28683
28684;// ./node_modules/colord/index.mjs
28685var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},colord_n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},colord_e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},colord_a=function(r){return{r:colord_e(r.r,0,255),g:colord_e(r.g,0,255),b:colord_e(r.b,0,255),a:colord_e(r.a)}},colord_o=function(r){return{r:colord_n(r.r),g:colord_n(r.g),b:colord_n(r.b),a:colord_n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),l:colord_e(r.l,0,100),a:colord_e(r.a)}},d=function(r){return{h:colord_n(r.h),s:colord_n(r.s),l:colord_n(r.l),a:colord_n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?colord_n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?colord_n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:colord_a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?colord_a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),v:colord_e(r.v,0,100),a:colord_e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:colord_e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:colord_e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return colord_n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=colord_o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(colord_n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return colord_o(this.rgba)},r.prototype.toRgbString=function(){return r=colord_o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:colord_n(r.h),s:colord_n(r.s),v:colord_n(r.v),a:colord_n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):colord_n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):colord_n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
28686
28687;// ./node_modules/colord/plugins/names.mjs
28688/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
28689
28690;// ./node_modules/@wordpress/components/build-module/utils/colors.js
28691
28692
28693
28694let colorComputationNode;
28695k([names]);
28696function colors_rgba(hexValue = "", alpha = 1) {
28697 return colord(hexValue).alpha(alpha).toRgbString();
28698}
28699function getColorComputationNode() {
28700 if (typeof document === "undefined") {
28701 return;
28702 }
28703 if (!colorComputationNode) {
28704 const el = document.createElement("div");
28705 el.setAttribute("data-g2-color-computation-node", "");
28706 document.body.appendChild(el);
28707 colorComputationNode = el;
28708 }
28709 return colorComputationNode;
28710}
28711function isColor(value) {
28712 if (typeof value !== "string") {
28713 return false;
28714 }
28715 const test = w(value);
28716 return test.isValid();
28717}
28718function _getComputedBackgroundColor(backgroundColor) {
28719 if (typeof backgroundColor !== "string") {
28720 return "";
28721 }
28722 if (isColor(backgroundColor)) {
28723 return backgroundColor;
28724 }
28725 if (!backgroundColor.includes("var(")) {
28726 return "";
28727 }
28728 if (typeof document === "undefined") {
28729 return "";
28730 }
28731 const el = getColorComputationNode();
28732 if (!el) {
28733 return "";
28734 }
28735 el.style.background = backgroundColor;
28736 const computedColor = window?.getComputedStyle(el).background;
28737 el.style.background = "";
28738 return computedColor || "";
28739}
28740const getComputedBackgroundColor = memize(_getComputedBackgroundColor);
28741function getOptimalTextColor(backgroundColor) {
28742 const background = getComputedBackgroundColor(backgroundColor);
28743 return w(background).isLight() ? "#000000" : "#ffffff";
28744}
28745function getOptimalTextShade(backgroundColor) {
28746 const result = getOptimalTextColor(backgroundColor);
28747 return result === "#000000" ? "dark" : "light";
28748}
28749
28750
28751;// ./node_modules/@wordpress/components/build-module/text/styles.js
28752function text_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
28753 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
28754}
28755
28756
28757const Text = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";line-height:", config_values_default.fontLineHeightBase, ";margin:0;text-wrap:balance;text-wrap:pretty;" + ( true ? "" : 0), true ? "" : 0);
28758const styles_block = true ? {
28759 name: "4zleql",
28760 styles: "display:block"
28761} : 0;
28762const positive = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.alert.green, ";" + ( true ? "" : 0), true ? "" : 0);
28763const destructive = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.alert.red, ";" + ( true ? "" : 0), true ? "" : 0);
28764const muted = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.gray[700], ";" + ( true ? "" : 0), true ? "" : 0);
28765const highlighterText = /* @__PURE__ */ emotion_react_browser_esm_css("mark{background:", COLORS.alert.yellow, ";border-radius:", config_values_default.radiusSmall, ";box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}" + ( true ? "" : 0), true ? "" : 0);
28766const upperCase = true ? {
28767 name: "50zrmy",
28768 styles: "text-transform:uppercase"
28769} : 0;
28770
28771
28772// EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js
28773var dist = __webpack_require__(9664);
28774;// ./node_modules/@wordpress/components/build-module/text/utils.js
28775
28776
28777
28778const lowercaseProps = (object) => {
28779 const mapped = {};
28780 for (const key in object) {
28781 mapped[key.toLowerCase()] = object[key];
28782 }
28783 return mapped;
28784};
28785const memoizedLowercaseProps = memize(lowercaseProps);
28786function createHighlighterText({
28787 activeClassName = "",
28788 activeIndex = -1,
28789 activeStyle,
28790 autoEscape,
28791 caseSensitive = false,
28792 children,
28793 findChunks,
28794 highlightClassName = "",
28795 highlightStyle = {},
28796 highlightTag = "mark",
28797 sanitize,
28798 searchWords = [],
28799 unhighlightClassName = "",
28800 unhighlightStyle
28801}) {
28802 if (!children) {
28803 return null;
28804 }
28805 if (typeof children !== "string") {
28806 return children;
28807 }
28808 const textToHighlight = children;
28809 const chunks = (0,dist.findAll)({
28810 autoEscape,
28811 caseSensitive,
28812 findChunks,
28813 sanitize,
28814 searchWords,
28815 textToHighlight
28816 });
28817 const HighlightTag = highlightTag;
28818 let highlightIndex = -1;
28819 let highlightClassNames = "";
28820 let highlightStyles;
28821 const textContent = chunks.map((chunk, index) => {
28822 const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start);
28823 if (chunk.highlight) {
28824 highlightIndex++;
28825 let highlightClass;
28826 if (typeof highlightClassName === "object") {
28827 if (!caseSensitive) {
28828 highlightClassName = memoizedLowercaseProps(highlightClassName);
28829 highlightClass = highlightClassName[text.toLowerCase()];
28830 } else {
28831 highlightClass = highlightClassName[text];
28832 }
28833 } else {
28834 highlightClass = highlightClassName;
28835 }
28836 const isActive = highlightIndex === +activeIndex;
28837 highlightClassNames = `${highlightClass} ${isActive ? activeClassName : ""}`;
28838 highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle;
28839 const props = {
28840 children: text,
28841 className: highlightClassNames,
28842 key: index,
28843 style: highlightStyles
28844 };
28845 if (typeof HighlightTag !== "string") {
28846 props.highlightIndex = highlightIndex;
28847 }
28848 return (0,external_wp_element_namespaceObject.createElement)(HighlightTag, props);
28849 }
28850 return (0,external_wp_element_namespaceObject.createElement)("span", {
28851 children: text,
28852 className: unhighlightClassName,
28853 key: index,
28854 style: unhighlightStyle
28855 });
28856 });
28857 return textContent;
28858}
28859
28860
28861;// ./node_modules/@wordpress/components/build-module/utils/font-size.js
28862
28863const BASE_FONT_SIZE = 13;
28864const PRESET_FONT_SIZES = {
28865 body: BASE_FONT_SIZE,
28866 caption: 10,
28867 footnote: 11,
28868 largeTitle: 28,
28869 subheadline: 12,
28870 title: 20
28871};
28872const HEADING_FONT_SIZES = [1, 2, 3, 4, 5, 6].flatMap((n) => [n, n.toString()]);
28873function getFontSize(size = BASE_FONT_SIZE) {
28874 if (size in PRESET_FONT_SIZES) {
28875 return getFontSize(PRESET_FONT_SIZES[size]);
28876 }
28877 if (typeof size !== "number") {
28878 const parsed = parseFloat(size);
28879 if (Number.isNaN(parsed)) {
28880 return size;
28881 }
28882 size = parsed;
28883 }
28884 const ratio = `(${size} / ${BASE_FONT_SIZE})`;
28885 return `calc(${ratio} * ${config_values_default.fontSize})`;
28886}
28887function getHeadingFontSize(size = 3) {
28888 if (!HEADING_FONT_SIZES.includes(size)) {
28889 return getFontSize(size);
28890 }
28891 const headingSize = `fontSizeH${size}`;
28892 return config_values_default[headingSize];
28893}
28894
28895
28896;// ./node_modules/@wordpress/components/build-module/text/get-line-height.js
28897
28898
28899function getLineHeight(adjustLineHeightForInnerControls, lineHeight) {
28900 if (lineHeight) {
28901 return lineHeight;
28902 }
28903 if (!adjustLineHeightForInnerControls) {
28904 return;
28905 }
28906 let value = `calc(${config_values_default.controlHeight} + ${space(2)})`;
28907 switch (adjustLineHeightForInnerControls) {
28908 case "large":
28909 value = `calc(${config_values_default.controlHeightLarge} + ${space(2)})`;
28910 break;
28911 case "small":
28912 value = `calc(${config_values_default.controlHeightSmall} + ${space(2)})`;
28913 break;
28914 case "xSmall":
28915 value = `calc(${config_values_default.controlHeightXSmall} + ${space(2)})`;
28916 break;
28917 default:
28918 break;
28919 }
28920 return value;
28921}
28922
28923
28924;// ./node_modules/@wordpress/components/build-module/text/hook.js
28925function hook_EMOTION_STRINGIFIED_CSS_ERROR_() {
28926 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
28927}
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939var hook_ref = true ? {
28940 name: "50zrmy",
28941 styles: "text-transform:uppercase"
28942} : 0;
28943function useText(props) {
28944 const {
28945 adjustLineHeightForInnerControls,
28946 align,
28947 children,
28948 className,
28949 color,
28950 ellipsizeMode,
28951 isDestructive = false,
28952 display,
28953 highlightEscape = false,
28954 highlightCaseSensitive = false,
28955 highlightWords,
28956 highlightSanitize,
28957 isBlock = false,
28958 letterSpacing,
28959 lineHeight: lineHeightProp,
28960 optimizeReadabilityFor,
28961 size,
28962 truncate = false,
28963 upperCase = false,
28964 variant,
28965 weight = config_values_default.fontWeight,
28966 ...otherProps
28967 } = useContextSystem(props, "Text");
28968 let content = children;
28969 const isHighlighter = Array.isArray(highlightWords);
28970 const isCaption = size === "caption";
28971 if (isHighlighter) {
28972 if (typeof children !== "string") {
28973 throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");
28974 }
28975 content = createHighlighterText({
28976 autoEscape: highlightEscape,
28977 children,
28978 caseSensitive: highlightCaseSensitive,
28979 searchWords: highlightWords,
28980 sanitize: highlightSanitize
28981 });
28982 }
28983 const cx = useCx();
28984 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
28985 const sx = {};
28986 const lineHeight = getLineHeight(adjustLineHeightForInnerControls, lineHeightProp);
28987 sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
28988 color,
28989 display,
28990 fontSize: getFontSize(size),
28991 fontWeight: weight,
28992 lineHeight,
28993 letterSpacing,
28994 textAlign: align
28995 }, true ? "" : 0, true ? "" : 0);
28996 sx.upperCase = hook_ref;
28997 sx.optimalTextColor = null;
28998 if (optimizeReadabilityFor) {
28999 const isOptimalTextColorDark = getOptimalTextShade(optimizeReadabilityFor) === "dark";
29000 sx.optimalTextColor = isOptimalTextColorDark ? /* @__PURE__ */ emotion_react_browser_esm_css({
29001 color: COLORS.gray[900]
29002 }, true ? "" : 0, true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css({
29003 color: COLORS.white
29004 }, true ? "" : 0, true ? "" : 0);
29005 }
29006 return cx(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className);
29007 }, [adjustLineHeightForInnerControls, align, className, color, cx, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]);
29008 let finalEllipsizeMode;
29009 if (truncate === true) {
29010 finalEllipsizeMode = "auto";
29011 }
29012 if (truncate === false) {
29013 finalEllipsizeMode = "none";
29014 }
29015 const finalComponentProps = {
29016 ...otherProps,
29017 className: classes,
29018 children,
29019 ellipsizeMode: ellipsizeMode || finalEllipsizeMode
29020 };
29021 const truncateProps = useTruncate(finalComponentProps);
29022 if (!truncate && Array.isArray(children)) {
29023 content = external_wp_element_namespaceObject.Children.map(children, (child) => {
29024 if (typeof child !== "object" || child === null || !("props" in child)) {
29025 return child;
29026 }
29027 const isLink = hasConnectNamespace(child, ["Link"]);
29028 if (isLink) {
29029 return (0,external_wp_element_namespaceObject.cloneElement)(child, {
29030 size: child.props.size || "inherit"
29031 });
29032 }
29033 return child;
29034 });
29035 }
29036 return {
29037 ...truncateProps,
29038 children: truncate ? truncateProps.children : content
29039 };
29040}
29041
29042
29043;// ./node_modules/@wordpress/components/build-module/text/component.js
29044
29045
29046
29047
29048function UnconnectedText(props, forwardedRef) {
29049 const textProps = useText(props);
29050 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
29051 as: "span",
29052 ...textProps,
29053 ref: forwardedRef
29054 });
29055}
29056const component_Text = contextConnect(UnconnectedText, "Text");
29057var text_component_component_default = component_Text;
29058
29059
29060;// ./node_modules/@wordpress/components/build-module/utils/base-label.js
29061function base_label_EMOTION_STRINGIFIED_CSS_ERROR_() {
29062 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
29063}
29064
29065const baseLabelTypography = true ? {
29066 name: "9amh4a",
29067 styles: "font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"
29068} : 0;
29069
29070
29071;// ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js
29072
29073function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
29074 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
29075}
29076
29077
29078
29079
29080
29081const Prefix = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
29082 target: "em5sgkm8"
29083} : 0)( true ? {
29084 name: "pvvbxf",
29085 styles: "box-sizing:border-box;display:block"
29086} : 0);
29087const Suffix = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
29088 target: "em5sgkm7"
29089} : 0)( true ? {
29090 name: "jgf79h",
29091 styles: "align-items:center;align-self:stretch;box-sizing:border-box;display:flex"
29092} : 0);
29093const backdropBorderColor = ({
29094 disabled,
29095 isBorderless
29096}) => {
29097 if (isBorderless) {
29098 return "transparent";
29099 }
29100 if (disabled) {
29101 return COLORS.ui.borderDisabled;
29102 }
29103 return COLORS.ui.border;
29104};
29105const BackdropUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
29106 target: "em5sgkm6"
29107} : 0)("&&&{box-sizing:border-box;border-color:", backdropBorderColor, ";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", rtl({
29108 paddingLeft: 2
29109}), ";}" + ( true ? "" : 0));
29110const Root = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
29111 target: "em5sgkm5"
29112} : 0)("box-sizing:border-box;position:relative;border-radius:", config_values_default.radiusSmall, ";padding-top:0;&:focus-within:not( :has( :is( ", Prefix, ", ", Suffix, " ):focus-within ) ){", BackdropUI, "{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values_default.controlBoxShadowFocus, ";outline:2px solid transparent;outline-offset:-2px;}}" + ( true ? "" : 0));
29113const containerDisabledStyles = ({
29114 disabled
29115}) => {
29116 const backgroundColor = disabled ? COLORS.ui.backgroundDisabled : COLORS.ui.background;
29117 return /* @__PURE__ */ emotion_react_browser_esm_css({
29118 backgroundColor
29119 }, true ? "" : 0, true ? "" : 0);
29120};
29121var input_control_styles_ref = true ? {
29122 name: "1d3w5wq",
29123 styles: "width:100%"
29124} : 0;
29125const containerWidthStyles = ({
29126 __unstableInputWidth,
29127 labelPosition
29128}) => {
29129 if (!__unstableInputWidth) {
29130 return input_control_styles_ref;
29131 }
29132 if (labelPosition === "side") {
29133 return "";
29134 }
29135 if (labelPosition === "edge") {
29136 return /* @__PURE__ */ emotion_react_browser_esm_css({
29137 flex: `0 0 ${__unstableInputWidth}`
29138 }, true ? "" : 0, true ? "" : 0);
29139 }
29140 return /* @__PURE__ */ emotion_react_browser_esm_css({
29141 width: __unstableInputWidth
29142 }, true ? "" : 0, true ? "" : 0);
29143};
29144const Container = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
29145 target: "em5sgkm4"
29146} : 0)("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerWidthStyles, ";" + ( true ? "" : 0));
29147const disabledStyles = ({
29148 disabled
29149}) => {
29150 if (!disabled) {
29151 return "";
29152 }
29153 return /* @__PURE__ */ emotion_react_browser_esm_css({
29154 color: COLORS.ui.textDisabled
29155 }, true ? "" : 0, true ? "" : 0);
29156};
29157const fontSizeStyles = ({
29158 inputSize: size
29159}) => {
29160 const sizes = {
29161 default: "13px",
29162 small: "11px",
29163 compact: "13px",
29164 "__unstable-large": "13px"
29165 };
29166 const fontSize = sizes[size] || sizes.default;
29167 const fontSizeMobile = "16px";
29168 if (!fontSize) {
29169 return "";
29170 }
29171 return /* @__PURE__ */ emotion_react_browser_esm_css("font-size:", fontSizeMobile, ";@media ( min-width: 600px ){font-size:", fontSize, ";}" + ( true ? "" : 0), true ? "" : 0);
29172};
29173const getSizeConfig = ({
29174 inputSize: size,
29175 __next40pxDefaultSize
29176}) => {
29177 const sizes = {
29178 default: {
29179 height: 40,
29180 lineHeight: 1,
29181 minHeight: 40,
29182 paddingLeft: config_values_default.controlPaddingX,
29183 paddingRight: config_values_default.controlPaddingX
29184 },
29185 small: {
29186 height: 24,
29187 lineHeight: 1,
29188 minHeight: 24,
29189 paddingLeft: config_values_default.controlPaddingXSmall,
29190 paddingRight: config_values_default.controlPaddingXSmall
29191 },
29192 compact: {
29193 height: 32,
29194 lineHeight: 1,
29195 minHeight: 32,
29196 paddingLeft: config_values_default.controlPaddingXSmall,
29197 paddingRight: config_values_default.controlPaddingXSmall
29198 },
29199 "__unstable-large": {
29200 height: 40,
29201 lineHeight: 1,
29202 minHeight: 40,
29203 paddingLeft: config_values_default.controlPaddingX,
29204 paddingRight: config_values_default.controlPaddingX
29205 }
29206 };
29207 if (!__next40pxDefaultSize) {
29208 sizes.default = sizes.compact;
29209 }
29210 return sizes[size] || sizes.default;
29211};
29212const sizeStyles = (props) => {
29213 return /* @__PURE__ */ emotion_react_browser_esm_css(getSizeConfig(props), true ? "" : 0, true ? "" : 0);
29214};
29215const customPaddings = ({
29216 paddingInlineStart,
29217 paddingInlineEnd
29218}) => {
29219 return /* @__PURE__ */ emotion_react_browser_esm_css({
29220 paddingInlineStart,
29221 paddingInlineEnd
29222 }, true ? "" : 0, true ? "" : 0);
29223};
29224const dragStyles = ({
29225 isDragging,
29226 dragCursor
29227}) => {
29228 let defaultArrowStyles;
29229 let activeDragCursorStyles;
29230 if (isDragging) {
29231 defaultArrowStyles = /* @__PURE__ */ emotion_react_browser_esm_css("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}" + ( true ? "" : 0), true ? "" : 0);
29232 }
29233 if (isDragging && dragCursor) {
29234 activeDragCursorStyles = /* @__PURE__ */ emotion_react_browser_esm_css("&:active{cursor:", dragCursor, ";}" + ( true ? "" : 0), true ? "" : 0);
29235 }
29236 return /* @__PURE__ */ emotion_react_browser_esm_css(defaultArrowStyles, " ", activeDragCursorStyles, ";" + ( true ? "" : 0), true ? "" : 0);
29237};
29238const Input = /* @__PURE__ */ emotion_styled_base_browser_esm("input", true ? {
29239 target: "em5sgkm3"
29240} : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.theme.foreground, ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", customPaddings, " &::-webkit-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&[type='email'],&[type='url']{direction:ltr;}}" + ( true ? "" : 0));
29241const BaseLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
29242 target: "em5sgkm2"
29243} : 0)("&&&{", baseLabelTypography, ";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}" + ( true ? "" : 0));
29244const Label = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseLabel, {
29245 ...props,
29246 as: "label"
29247});
29248const LabelWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_item_component_component_default, true ? {
29249 target: "em5sgkm1"
29250} : 0)( true ? {
29251 name: "1b6uupn",
29252 styles: "max-width:calc( 100% - 10px )"
29253} : 0);
29254const prefixSuffixWrapperStyles = ({
29255 variant = "default",
29256 size,
29257 __next40pxDefaultSize,
29258 isPrefix
29259}) => {
29260 const {
29261 paddingLeft: padding
29262 } = getSizeConfig({
29263 inputSize: size,
29264 __next40pxDefaultSize
29265 });
29266 const paddingProperty = isPrefix ? "paddingInlineStart" : "paddingInlineEnd";
29267 if (variant === "default") {
29268 return /* @__PURE__ */ emotion_react_browser_esm_css({
29269 [paddingProperty]: padding
29270 }, true ? "" : 0, true ? "" : 0);
29271 }
29272 return /* @__PURE__ */ emotion_react_browser_esm_css({
29273 display: "flex",
29274 [paddingProperty]: padding - 4
29275 }, true ? "" : 0, true ? "" : 0);
29276};
29277const PrefixSuffixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
29278 target: "em5sgkm0"
29279} : 0)(prefixSuffixWrapperStyles, ";" + ( true ? "" : 0));
29280
29281
29282;// ./node_modules/@wordpress/components/build-module/input-control/backdrop.js
29283
29284
29285
29286function Backdrop({
29287 disabled = false,
29288 isBorderless = false
29289}) {
29290 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BackdropUI, {
29291 "aria-hidden": "true",
29292 className: "components-input-control__backdrop",
29293 disabled,
29294 isBorderless
29295 });
29296}
29297const MemoizedBackdrop = (0,external_wp_element_namespaceObject.memo)(Backdrop);
29298var backdrop_default = MemoizedBackdrop;
29299
29300
29301;// ./node_modules/@wordpress/components/build-module/input-control/label.js
29302
29303
29304
29305function label_Label({
29306 children,
29307 hideLabelFromVision,
29308 htmlFor,
29309 ...props
29310}) {
29311 if (!children) {
29312 return null;
29313 }
29314 if (hideLabelFromVision) {
29315 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
29316 as: "label",
29317 htmlFor,
29318 children
29319 });
29320 }
29321 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LabelWrapper, {
29322 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Label, {
29323 htmlFor,
29324 ...props,
29325 children
29326 })
29327 });
29328}
29329
29330
29331;// ./node_modules/@wordpress/components/build-module/utils/use-deprecated-props.js
29332function useDeprecated36pxDefaultSizeProp(props) {
29333 const {
29334 __next36pxDefaultSize,
29335 __next40pxDefaultSize,
29336 ...otherProps
29337 } = props;
29338 return {
29339 ...otherProps,
29340 __next40pxDefaultSize: __next40pxDefaultSize !== null && __next40pxDefaultSize !== void 0 ? __next40pxDefaultSize : __next36pxDefaultSize
29341 };
29342}
29343
29344
29345;// ./node_modules/@wordpress/components/build-module/input-control/input-base.js
29346
29347
29348
29349
29350
29351
29352
29353
29354function useUniqueId(idProp) {
29355 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputBase);
29356 const id = `input-base-control-${instanceId}`;
29357 return idProp || id;
29358}
29359function getUIFlexProps(labelPosition) {
29360 const props = {};
29361 switch (labelPosition) {
29362 case "top":
29363 props.direction = "column";
29364 props.expanded = false;
29365 props.gap = 0;
29366 break;
29367 case "bottom":
29368 props.direction = "column-reverse";
29369 props.expanded = false;
29370 props.gap = 0;
29371 break;
29372 case "edge":
29373 props.justify = "space-between";
29374 break;
29375 }
29376 return props;
29377}
29378function InputBase(props, ref) {
29379 const {
29380 __next40pxDefaultSize,
29381 __unstableInputWidth,
29382 children,
29383 className,
29384 disabled = false,
29385 hideLabelFromVision = false,
29386 labelPosition,
29387 id: idProp,
29388 isBorderless = false,
29389 label,
29390 prefix,
29391 size = "default",
29392 suffix,
29393 ...restProps
29394 } = useDeprecated36pxDefaultSizeProp(useContextSystem(props, "InputBase"));
29395 const id = useUniqueId(idProp);
29396 const hideLabel = hideLabelFromVision || !label;
29397 const prefixSuffixContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
29398 return {
29399 InputControlPrefixWrapper: {
29400 __next40pxDefaultSize,
29401 size
29402 },
29403 InputControlSuffixWrapper: {
29404 __next40pxDefaultSize,
29405 size
29406 }
29407 };
29408 }, [__next40pxDefaultSize, size]);
29409 return (
29410 // @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.
29411 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Root, {
29412 ...restProps,
29413 ...getUIFlexProps(labelPosition),
29414 className,
29415 gap: 2,
29416 ref,
29417 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(label_Label, {
29418 className: "components-input-control__label",
29419 hideLabelFromVision,
29420 labelPosition,
29421 htmlFor: id,
29422 children: label
29423 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Container, {
29424 __unstableInputWidth,
29425 className: "components-input-control__container",
29426 disabled,
29427 hideLabel,
29428 labelPosition,
29429 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ContextSystemProvider, {
29430 value: prefixSuffixContextValue,
29431 children: [prefix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Prefix, {
29432 className: "components-input-control__prefix",
29433 children: prefix
29434 }), children, suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Suffix, {
29435 className: "components-input-control__suffix",
29436 children: suffix
29437 })]
29438 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(backdrop_default, {
29439 disabled,
29440 isBorderless
29441 })]
29442 })]
29443 })
29444 );
29445}
29446var input_base_default = contextConnect(InputBase, "InputBase");
29447
29448
29449;// ./node_modules/@use-gesture/core/dist/maths-0ab39ae9.esm.js
29450function maths_0ab39ae9_esm_clamp(v, min, max) {
29451 return Math.max(min, Math.min(v, max));
29452}
29453const V = {
29454 toVector(v, fallback) {
29455 if (v === undefined) v = fallback;
29456 return Array.isArray(v) ? v : [v, v];
29457 },
29458 add(v1, v2) {
29459 return [v1[0] + v2[0], v1[1] + v2[1]];
29460 },
29461 sub(v1, v2) {
29462 return [v1[0] - v2[0], v1[1] - v2[1]];
29463 },
29464 addTo(v1, v2) {
29465 v1[0] += v2[0];
29466 v1[1] += v2[1];
29467 },
29468 subTo(v1, v2) {
29469 v1[0] -= v2[0];
29470 v1[1] -= v2[1];
29471 }
29472};
29473function rubberband(distance, dimension, constant) {
29474 if (dimension === 0 || Math.abs(dimension) === Infinity) return Math.pow(distance, constant * 5);
29475 return distance * dimension * constant / (dimension + constant * distance);
29476}
29477function rubberbandIfOutOfBounds(position, min, max, constant = 0.15) {
29478 if (constant === 0) return maths_0ab39ae9_esm_clamp(position, min, max);
29479 if (position < min) return -rubberband(min - position, max - min, constant) + min;
29480 if (position > max) return +rubberband(position - max, max - min, constant) + max;
29481 return position;
29482}
29483function computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) {
29484 const [[X0, X1], [Y0, Y1]] = bounds;
29485 return [rubberbandIfOutOfBounds(Vx, X0, X1, Rx), rubberbandIfOutOfBounds(Vy, Y0, Y1, Ry)];
29486}
29487
29488
29489
29490;// ./node_modules/@use-gesture/core/dist/actions-fe213e88.esm.js
29491
29492
29493function _toPrimitive(input, hint) {
29494 if (typeof input !== "object" || input === null) return input;
29495 var prim = input[Symbol.toPrimitive];
29496 if (prim !== undefined) {
29497 var res = prim.call(input, hint || "default");
29498 if (typeof res !== "object") return res;
29499 throw new TypeError("@@toPrimitive must return a primitive value.");
29500 }
29501 return (hint === "string" ? String : Number)(input);
29502}
29503
29504function _toPropertyKey(arg) {
29505 var key = _toPrimitive(arg, "string");
29506 return typeof key === "symbol" ? key : String(key);
29507}
29508
29509function _defineProperty(obj, key, value) {
29510 key = _toPropertyKey(key);
29511 if (key in obj) {
29512 Object.defineProperty(obj, key, {
29513 value: value,
29514 enumerable: true,
29515 configurable: true,
29516 writable: true
29517 });
29518 } else {
29519 obj[key] = value;
29520 }
29521 return obj;
29522}
29523
29524function actions_fe213e88_esm_ownKeys(e, r) {
29525 var t = Object.keys(e);
29526 if (Object.getOwnPropertySymbols) {
29527 var o = Object.getOwnPropertySymbols(e);
29528 r && (o = o.filter(function (r) {
29529 return Object.getOwnPropertyDescriptor(e, r).enumerable;
29530 })), t.push.apply(t, o);
29531 }
29532 return t;
29533}
29534function _objectSpread2(e) {
29535 for (var r = 1; r < arguments.length; r++) {
29536 var t = null != arguments[r] ? arguments[r] : {};
29537 r % 2 ? actions_fe213e88_esm_ownKeys(Object(t), !0).forEach(function (r) {
29538 _defineProperty(e, r, t[r]);
29539 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : actions_fe213e88_esm_ownKeys(Object(t)).forEach(function (r) {
29540 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
29541 });
29542 }
29543 return e;
29544}
29545
29546const EVENT_TYPE_MAP = {
29547 pointer: {
29548 start: 'down',
29549 change: 'move',
29550 end: 'up'
29551 },
29552 mouse: {
29553 start: 'down',
29554 change: 'move',
29555 end: 'up'
29556 },
29557 touch: {
29558 start: 'start',
29559 change: 'move',
29560 end: 'end'
29561 },
29562 gesture: {
29563 start: 'start',
29564 change: 'change',
29565 end: 'end'
29566 }
29567};
29568function capitalize(string) {
29569 if (!string) return '';
29570 return string[0].toUpperCase() + string.slice(1);
29571}
29572const actionsWithoutCaptureSupported = ['enter', 'leave'];
29573function hasCapture(capture = false, actionKey) {
29574 return capture && !actionsWithoutCaptureSupported.includes(actionKey);
29575}
29576function toHandlerProp(device, action = '', capture = false) {
29577 const deviceProps = EVENT_TYPE_MAP[device];
29578 const actionKey = deviceProps ? deviceProps[action] || action : action;
29579 return 'on' + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? 'Capture' : '');
29580}
29581const pointerCaptureEvents = ['gotpointercapture', 'lostpointercapture'];
29582function parseProp(prop) {
29583 let eventKey = prop.substring(2).toLowerCase();
29584 const passive = !!~eventKey.indexOf('passive');
29585 if (passive) eventKey = eventKey.replace('passive', '');
29586 const captureKey = pointerCaptureEvents.includes(eventKey) ? 'capturecapture' : 'capture';
29587 const capture = !!~eventKey.indexOf(captureKey);
29588 if (capture) eventKey = eventKey.replace('capture', '');
29589 return {
29590 device: eventKey,
29591 capture,
29592 passive
29593 };
29594}
29595function toDomEventType(device, action = '') {
29596 const deviceProps = EVENT_TYPE_MAP[device];
29597 const actionKey = deviceProps ? deviceProps[action] || action : action;
29598 return device + actionKey;
29599}
29600function isTouch(event) {
29601 return 'touches' in event;
29602}
29603function getPointerType(event) {
29604 if (isTouch(event)) return 'touch';
29605 if ('pointerType' in event) return event.pointerType;
29606 return 'mouse';
29607}
29608function getCurrentTargetTouchList(event) {
29609 return Array.from(event.touches).filter(e => {
29610 var _event$currentTarget, _event$currentTarget$;
29611 return e.target === event.currentTarget || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || (_event$currentTarget$ = _event$currentTarget.contains) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.call(_event$currentTarget, e.target));
29612 });
29613}
29614function getTouchList(event) {
29615 return event.type === 'touchend' || event.type === 'touchcancel' ? event.changedTouches : event.targetTouches;
29616}
29617function getValueEvent(event) {
29618 return isTouch(event) ? getTouchList(event)[0] : event;
29619}
29620function distanceAngle(P1, P2) {
29621 try {
29622 const dx = P2.clientX - P1.clientX;
29623 const dy = P2.clientY - P1.clientY;
29624 const cx = (P2.clientX + P1.clientX) / 2;
29625 const cy = (P2.clientY + P1.clientY) / 2;
29626 const distance = Math.hypot(dx, dy);
29627 const angle = -(Math.atan2(dx, dy) * 180) / Math.PI;
29628 const origin = [cx, cy];
29629 return {
29630 angle,
29631 distance,
29632 origin
29633 };
29634 } catch (_unused) {}
29635 return null;
29636}
29637function touchIds(event) {
29638 return getCurrentTargetTouchList(event).map(touch => touch.identifier);
29639}
29640function touchDistanceAngle(event, ids) {
29641 const [P1, P2] = Array.from(event.touches).filter(touch => ids.includes(touch.identifier));
29642 return distanceAngle(P1, P2);
29643}
29644function pointerId(event) {
29645 const valueEvent = getValueEvent(event);
29646 return isTouch(event) ? valueEvent.identifier : valueEvent.pointerId;
29647}
29648function pointerValues(event) {
29649 const valueEvent = getValueEvent(event);
29650 return [valueEvent.clientX, valueEvent.clientY];
29651}
29652const LINE_HEIGHT = 40;
29653const PAGE_HEIGHT = 800;
29654function wheelValues(event) {
29655 let {
29656 deltaX,
29657 deltaY,
29658 deltaMode
29659 } = event;
29660 if (deltaMode === 1) {
29661 deltaX *= LINE_HEIGHT;
29662 deltaY *= LINE_HEIGHT;
29663 } else if (deltaMode === 2) {
29664 deltaX *= PAGE_HEIGHT;
29665 deltaY *= PAGE_HEIGHT;
29666 }
29667 return [deltaX, deltaY];
29668}
29669function scrollValues(event) {
29670 var _ref, _ref2;
29671 const {
29672 scrollX,
29673 scrollY,
29674 scrollLeft,
29675 scrollTop
29676 } = event.currentTarget;
29677 return [(_ref = scrollX !== null && scrollX !== void 0 ? scrollX : scrollLeft) !== null && _ref !== void 0 ? _ref : 0, (_ref2 = scrollY !== null && scrollY !== void 0 ? scrollY : scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0];
29678}
29679function getEventDetails(event) {
29680 const payload = {};
29681 if ('buttons' in event) payload.buttons = event.buttons;
29682 if ('shiftKey' in event) {
29683 const {
29684 shiftKey,
29685 altKey,
29686 metaKey,
29687 ctrlKey
29688 } = event;
29689 Object.assign(payload, {
29690 shiftKey,
29691 altKey,
29692 metaKey,
29693 ctrlKey
29694 });
29695 }
29696 return payload;
29697}
29698
29699function call(v, ...args) {
29700 if (typeof v === 'function') {
29701 return v(...args);
29702 } else {
29703 return v;
29704 }
29705}
29706function actions_fe213e88_esm_noop() {}
29707function actions_fe213e88_esm_chain(...fns) {
29708 if (fns.length === 0) return actions_fe213e88_esm_noop;
29709 if (fns.length === 1) return fns[0];
29710 return function () {
29711 let result;
29712 for (const fn of fns) {
29713 result = fn.apply(this, arguments) || result;
29714 }
29715 return result;
29716 };
29717}
29718function assignDefault(value, fallback) {
29719 return Object.assign({}, fallback, value || {});
29720}
29721
29722const BEFORE_LAST_KINEMATICS_DELAY = 32;
29723class Engine {
29724 constructor(ctrl, args, key) {
29725 this.ctrl = ctrl;
29726 this.args = args;
29727 this.key = key;
29728 if (!this.state) {
29729 this.state = {};
29730 this.computeValues([0, 0]);
29731 this.computeInitial();
29732 if (this.init) this.init();
29733 this.reset();
29734 }
29735 }
29736 get state() {
29737 return this.ctrl.state[this.key];
29738 }
29739 set state(state) {
29740 this.ctrl.state[this.key] = state;
29741 }
29742 get shared() {
29743 return this.ctrl.state.shared;
29744 }
29745 get eventStore() {
29746 return this.ctrl.gestureEventStores[this.key];
29747 }
29748 get timeoutStore() {
29749 return this.ctrl.gestureTimeoutStores[this.key];
29750 }
29751 get config() {
29752 return this.ctrl.config[this.key];
29753 }
29754 get sharedConfig() {
29755 return this.ctrl.config.shared;
29756 }
29757 get handler() {
29758 return this.ctrl.handlers[this.key];
29759 }
29760 reset() {
29761 const {
29762 state,
29763 shared,
29764 ingKey,
29765 args
29766 } = this;
29767 shared[ingKey] = state._active = state.active = state._blocked = state._force = false;
29768 state._step = [false, false];
29769 state.intentional = false;
29770 state._movement = [0, 0];
29771 state._distance = [0, 0];
29772 state._direction = [0, 0];
29773 state._delta = [0, 0];
29774 state._bounds = [[-Infinity, Infinity], [-Infinity, Infinity]];
29775 state.args = args;
29776 state.axis = undefined;
29777 state.memo = undefined;
29778 state.elapsedTime = state.timeDelta = 0;
29779 state.direction = [0, 0];
29780 state.distance = [0, 0];
29781 state.overflow = [0, 0];
29782 state._movementBound = [false, false];
29783 state.velocity = [0, 0];
29784 state.movement = [0, 0];
29785 state.delta = [0, 0];
29786 state.timeStamp = 0;
29787 }
29788 start(event) {
29789 const state = this.state;
29790 const config = this.config;
29791 if (!state._active) {
29792 this.reset();
29793 this.computeInitial();
29794 state._active = true;
29795 state.target = event.target;
29796 state.currentTarget = event.currentTarget;
29797 state.lastOffset = config.from ? call(config.from, state) : state.offset;
29798 state.offset = state.lastOffset;
29799 state.startTime = state.timeStamp = event.timeStamp;
29800 }
29801 }
29802 computeValues(values) {
29803 const state = this.state;
29804 state._values = values;
29805 state.values = this.config.transform(values);
29806 }
29807 computeInitial() {
29808 const state = this.state;
29809 state._initial = state._values;
29810 state.initial = state.values;
29811 }
29812 compute(event) {
29813 const {
29814 state,
29815 config,
29816 shared
29817 } = this;
29818 state.args = this.args;
29819 let dt = 0;
29820 if (event) {
29821 state.event = event;
29822 if (config.preventDefault && event.cancelable) state.event.preventDefault();
29823 state.type = event.type;
29824 shared.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size;
29825 shared.locked = !!document.pointerLockElement;
29826 Object.assign(shared, getEventDetails(event));
29827 shared.down = shared.pressed = shared.buttons % 2 === 1 || shared.touches > 0;
29828 dt = event.timeStamp - state.timeStamp;
29829 state.timeStamp = event.timeStamp;
29830 state.elapsedTime = state.timeStamp - state.startTime;
29831 }
29832 if (state._active) {
29833 const _absoluteDelta = state._delta.map(Math.abs);
29834 V.addTo(state._distance, _absoluteDelta);
29835 }
29836 if (this.axisIntent) this.axisIntent(event);
29837 const [_m0, _m1] = state._movement;
29838 const [t0, t1] = config.threshold;
29839 const {
29840 _step,
29841 values
29842 } = state;
29843 if (config.hasCustomTransform) {
29844 if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && values[0];
29845 if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && values[1];
29846 } else {
29847 if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && Math.sign(_m0) * t0;
29848 if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && Math.sign(_m1) * t1;
29849 }
29850 state.intentional = _step[0] !== false || _step[1] !== false;
29851 if (!state.intentional) return;
29852 const movement = [0, 0];
29853 if (config.hasCustomTransform) {
29854 const [v0, v1] = values;
29855 movement[0] = _step[0] !== false ? v0 - _step[0] : 0;
29856 movement[1] = _step[1] !== false ? v1 - _step[1] : 0;
29857 } else {
29858 movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
29859 movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
29860 }
29861 if (this.restrictToAxis && !state._blocked) this.restrictToAxis(movement);
29862 const previousOffset = state.offset;
29863 const gestureIsActive = state._active && !state._blocked || state.active;
29864 if (gestureIsActive) {
29865 state.first = state._active && !state.active;
29866 state.last = !state._active && state.active;
29867 state.active = shared[this.ingKey] = state._active;
29868 if (event) {
29869 if (state.first) {
29870 if ('bounds' in config) state._bounds = call(config.bounds, state);
29871 if (this.setup) this.setup();
29872 }
29873 state.movement = movement;
29874 this.computeOffset();
29875 }
29876 }
29877 const [ox, oy] = state.offset;
29878 const [[x0, x1], [y0, y1]] = state._bounds;
29879 state.overflow = [ox < x0 ? -1 : ox > x1 ? 1 : 0, oy < y0 ? -1 : oy > y1 ? 1 : 0];
29880 state._movementBound[0] = state.overflow[0] ? state._movementBound[0] === false ? state._movement[0] : state._movementBound[0] : false;
29881 state._movementBound[1] = state.overflow[1] ? state._movementBound[1] === false ? state._movement[1] : state._movementBound[1] : false;
29882 const rubberband = state._active ? config.rubberband || [0, 0] : [0, 0];
29883 state.offset = computeRubberband(state._bounds, state.offset, rubberband);
29884 state.delta = V.sub(state.offset, previousOffset);
29885 this.computeMovement();
29886 if (gestureIsActive && (!state.last || dt > BEFORE_LAST_KINEMATICS_DELAY)) {
29887 state.delta = V.sub(state.offset, previousOffset);
29888 const absoluteDelta = state.delta.map(Math.abs);
29889 V.addTo(state.distance, absoluteDelta);
29890 state.direction = state.delta.map(Math.sign);
29891 state._direction = state._delta.map(Math.sign);
29892 if (!state.first && dt > 0) {
29893 state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt];
29894 state.timeDelta = dt;
29895 }
29896 }
29897 }
29898 emit() {
29899 const state = this.state;
29900 const shared = this.shared;
29901 const config = this.config;
29902 if (!state._active) this.clean();
29903 if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return;
29904 const memo = this.handler(_objectSpread2(_objectSpread2(_objectSpread2({}, shared), state), {}, {
29905 [this.aliasKey]: state.values
29906 }));
29907 if (memo !== undefined) state.memo = memo;
29908 }
29909 clean() {
29910 this.eventStore.clean();
29911 this.timeoutStore.clean();
29912 }
29913}
29914
29915function selectAxis([dx, dy], threshold) {
29916 const absDx = Math.abs(dx);
29917 const absDy = Math.abs(dy);
29918 if (absDx > absDy && absDx > threshold) {
29919 return 'x';
29920 }
29921 if (absDy > absDx && absDy > threshold) {
29922 return 'y';
29923 }
29924 return undefined;
29925}
29926class CoordinatesEngine extends Engine {
29927 constructor(...args) {
29928 super(...args);
29929 _defineProperty(this, "aliasKey", 'xy');
29930 }
29931 reset() {
29932 super.reset();
29933 this.state.axis = undefined;
29934 }
29935 init() {
29936 this.state.offset = [0, 0];
29937 this.state.lastOffset = [0, 0];
29938 }
29939 computeOffset() {
29940 this.state.offset = V.add(this.state.lastOffset, this.state.movement);
29941 }
29942 computeMovement() {
29943 this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
29944 }
29945 axisIntent(event) {
29946 const state = this.state;
29947 const config = this.config;
29948 if (!state.axis && event) {
29949 const threshold = typeof config.axisThreshold === 'object' ? config.axisThreshold[getPointerType(event)] : config.axisThreshold;
29950 state.axis = selectAxis(state._movement, threshold);
29951 }
29952 state._blocked = (config.lockDirection || !!config.axis) && !state.axis || !!config.axis && config.axis !== state.axis;
29953 }
29954 restrictToAxis(v) {
29955 if (this.config.axis || this.config.lockDirection) {
29956 switch (this.state.axis) {
29957 case 'x':
29958 v[1] = 0;
29959 break;
29960 case 'y':
29961 v[0] = 0;
29962 break;
29963 }
29964 }
29965 }
29966}
29967
29968const actions_fe213e88_esm_identity = v => v;
29969const DEFAULT_RUBBERBAND = 0.15;
29970const commonConfigResolver = {
29971 enabled(value = true) {
29972 return value;
29973 },
29974 eventOptions(value, _k, config) {
29975 return _objectSpread2(_objectSpread2({}, config.shared.eventOptions), value);
29976 },
29977 preventDefault(value = false) {
29978 return value;
29979 },
29980 triggerAllEvents(value = false) {
29981 return value;
29982 },
29983 rubberband(value = 0) {
29984 switch (value) {
29985 case true:
29986 return [DEFAULT_RUBBERBAND, DEFAULT_RUBBERBAND];
29987 case false:
29988 return [0, 0];
29989 default:
29990 return V.toVector(value);
29991 }
29992 },
29993 from(value) {
29994 if (typeof value === 'function') return value;
29995 if (value != null) return V.toVector(value);
29996 },
29997 transform(value, _k, config) {
29998 const transform = value || config.shared.transform;
29999 this.hasCustomTransform = !!transform;
30000 if (false) {}
30001 return transform || actions_fe213e88_esm_identity;
30002 },
30003 threshold(value) {
30004 return V.toVector(value, 0);
30005 }
30006};
30007if (false) {}
30008
30009const DEFAULT_AXIS_THRESHOLD = 0;
30010const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
30011 axis(_v, _k, {
30012 axis
30013 }) {
30014 this.lockDirection = axis === 'lock';
30015 if (!this.lockDirection) return axis;
30016 },
30017 axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
30018 return value;
30019 },
30020 bounds(value = {}) {
30021 if (typeof value === 'function') {
30022 return state => coordinatesConfigResolver.bounds(value(state));
30023 }
30024 if ('current' in value) {
30025 return () => value.current;
30026 }
30027 if (typeof HTMLElement === 'function' && value instanceof HTMLElement) {
30028 return value;
30029 }
30030 const {
30031 left = -Infinity,
30032 right = Infinity,
30033 top = -Infinity,
30034 bottom = Infinity
30035 } = value;
30036 return [[left, right], [top, bottom]];
30037 }
30038});
30039
30040const KEYS_DELTA_MAP = {
30041 ArrowRight: (displacement, factor = 1) => [displacement * factor, 0],
30042 ArrowLeft: (displacement, factor = 1) => [-1 * displacement * factor, 0],
30043 ArrowUp: (displacement, factor = 1) => [0, -1 * displacement * factor],
30044 ArrowDown: (displacement, factor = 1) => [0, displacement * factor]
30045};
30046class DragEngine extends CoordinatesEngine {
30047 constructor(...args) {
30048 super(...args);
30049 _defineProperty(this, "ingKey", 'dragging');
30050 }
30051 reset() {
30052 super.reset();
30053 const state = this.state;
30054 state._pointerId = undefined;
30055 state._pointerActive = false;
30056 state._keyboardActive = false;
30057 state._preventScroll = false;
30058 state._delayed = false;
30059 state.swipe = [0, 0];
30060 state.tap = false;
30061 state.canceled = false;
30062 state.cancel = this.cancel.bind(this);
30063 }
30064 setup() {
30065 const state = this.state;
30066 if (state._bounds instanceof HTMLElement) {
30067 const boundRect = state._bounds.getBoundingClientRect();
30068 const targetRect = state.currentTarget.getBoundingClientRect();
30069 const _bounds = {
30070 left: boundRect.left - targetRect.left + state.offset[0],
30071 right: boundRect.right - targetRect.right + state.offset[0],
30072 top: boundRect.top - targetRect.top + state.offset[1],
30073 bottom: boundRect.bottom - targetRect.bottom + state.offset[1]
30074 };
30075 state._bounds = coordinatesConfigResolver.bounds(_bounds);
30076 }
30077 }
30078 cancel() {
30079 const state = this.state;
30080 if (state.canceled) return;
30081 state.canceled = true;
30082 state._active = false;
30083 setTimeout(() => {
30084 this.compute();
30085 this.emit();
30086 }, 0);
30087 }
30088 setActive() {
30089 this.state._active = this.state._pointerActive || this.state._keyboardActive;
30090 }
30091 clean() {
30092 this.pointerClean();
30093 this.state._pointerActive = false;
30094 this.state._keyboardActive = false;
30095 super.clean();
30096 }
30097 pointerDown(event) {
30098 const config = this.config;
30099 const state = this.state;
30100 if (event.buttons != null && (Array.isArray(config.pointerButtons) ? !config.pointerButtons.includes(event.buttons) : config.pointerButtons !== -1 && config.pointerButtons !== event.buttons)) return;
30101 const ctrlIds = this.ctrl.setEventIds(event);
30102 if (config.pointerCapture) {
30103 event.target.setPointerCapture(event.pointerId);
30104 }
30105 if (ctrlIds && ctrlIds.size > 1 && state._pointerActive) return;
30106 this.start(event);
30107 this.setupPointer(event);
30108 state._pointerId = pointerId(event);
30109 state._pointerActive = true;
30110 this.computeValues(pointerValues(event));
30111 this.computeInitial();
30112 if (config.preventScrollAxis && getPointerType(event) !== 'mouse') {
30113 state._active = false;
30114 this.setupScrollPrevention(event);
30115 } else if (config.delay > 0) {
30116 this.setupDelayTrigger(event);
30117 if (config.triggerAllEvents) {
30118 this.compute(event);
30119 this.emit();
30120 }
30121 } else {
30122 this.startPointerDrag(event);
30123 }
30124 }
30125 startPointerDrag(event) {
30126 const state = this.state;
30127 state._active = true;
30128 state._preventScroll = true;
30129 state._delayed = false;
30130 this.compute(event);
30131 this.emit();
30132 }
30133 pointerMove(event) {
30134 const state = this.state;
30135 const config = this.config;
30136 if (!state._pointerActive) return;
30137 const id = pointerId(event);
30138 if (state._pointerId !== undefined && id !== state._pointerId) return;
30139 const _values = pointerValues(event);
30140 if (document.pointerLockElement === event.target) {
30141 state._delta = [event.movementX, event.movementY];
30142 } else {
30143 state._delta = V.sub(_values, state._values);
30144 this.computeValues(_values);
30145 }
30146 V.addTo(state._movement, state._delta);
30147 this.compute(event);
30148 if (state._delayed && state.intentional) {
30149 this.timeoutStore.remove('dragDelay');
30150 state.active = false;
30151 this.startPointerDrag(event);
30152 return;
30153 }
30154 if (config.preventScrollAxis && !state._preventScroll) {
30155 if (state.axis) {
30156 if (state.axis === config.preventScrollAxis || config.preventScrollAxis === 'xy') {
30157 state._active = false;
30158 this.clean();
30159 return;
30160 } else {
30161 this.timeoutStore.remove('startPointerDrag');
30162 this.startPointerDrag(event);
30163 return;
30164 }
30165 } else {
30166 return;
30167 }
30168 }
30169 this.emit();
30170 }
30171 pointerUp(event) {
30172 this.ctrl.setEventIds(event);
30173 try {
30174 if (this.config.pointerCapture && event.target.hasPointerCapture(event.pointerId)) {
30175 ;
30176 event.target.releasePointerCapture(event.pointerId);
30177 }
30178 } catch (_unused) {
30179 if (false) {}
30180 }
30181 const state = this.state;
30182 const config = this.config;
30183 if (!state._active || !state._pointerActive) return;
30184 const id = pointerId(event);
30185 if (state._pointerId !== undefined && id !== state._pointerId) return;
30186 this.state._pointerActive = false;
30187 this.setActive();
30188 this.compute(event);
30189 const [dx, dy] = state._distance;
30190 state.tap = dx <= config.tapsThreshold && dy <= config.tapsThreshold;
30191 if (state.tap && config.filterTaps) {
30192 state._force = true;
30193 } else {
30194 const [_dx, _dy] = state._delta;
30195 const [_mx, _my] = state._movement;
30196 const [svx, svy] = config.swipe.velocity;
30197 const [sx, sy] = config.swipe.distance;
30198 const sdt = config.swipe.duration;
30199 if (state.elapsedTime < sdt) {
30200 const _vx = Math.abs(_dx / state.timeDelta);
30201 const _vy = Math.abs(_dy / state.timeDelta);
30202 if (_vx > svx && Math.abs(_mx) > sx) state.swipe[0] = Math.sign(_dx);
30203 if (_vy > svy && Math.abs(_my) > sy) state.swipe[1] = Math.sign(_dy);
30204 }
30205 }
30206 this.emit();
30207 }
30208 pointerClick(event) {
30209 if (!this.state.tap && event.detail > 0) {
30210 event.preventDefault();
30211 event.stopPropagation();
30212 }
30213 }
30214 setupPointer(event) {
30215 const config = this.config;
30216 const device = config.device;
30217 if (false) {}
30218 if (config.pointerLock) {
30219 event.currentTarget.requestPointerLock();
30220 }
30221 if (!config.pointerCapture) {
30222 this.eventStore.add(this.sharedConfig.window, device, 'change', this.pointerMove.bind(this));
30223 this.eventStore.add(this.sharedConfig.window, device, 'end', this.pointerUp.bind(this));
30224 this.eventStore.add(this.sharedConfig.window, device, 'cancel', this.pointerUp.bind(this));
30225 }
30226 }
30227 pointerClean() {
30228 if (this.config.pointerLock && document.pointerLockElement === this.state.currentTarget) {
30229 document.exitPointerLock();
30230 }
30231 }
30232 preventScroll(event) {
30233 if (this.state._preventScroll && event.cancelable) {
30234 event.preventDefault();
30235 }
30236 }
30237 setupScrollPrevention(event) {
30238 this.state._preventScroll = false;
30239 persistEvent(event);
30240 const remove = this.eventStore.add(this.sharedConfig.window, 'touch', 'change', this.preventScroll.bind(this), {
30241 passive: false
30242 });
30243 this.eventStore.add(this.sharedConfig.window, 'touch', 'end', remove);
30244 this.eventStore.add(this.sharedConfig.window, 'touch', 'cancel', remove);
30245 this.timeoutStore.add('startPointerDrag', this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
30246 }
30247 setupDelayTrigger(event) {
30248 this.state._delayed = true;
30249 this.timeoutStore.add('dragDelay', () => {
30250 this.state._step = [0, 0];
30251 this.startPointerDrag(event);
30252 }, this.config.delay);
30253 }
30254 keyDown(event) {
30255 const deltaFn = KEYS_DELTA_MAP[event.key];
30256 if (deltaFn) {
30257 const state = this.state;
30258 const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;
30259 this.start(event);
30260 state._delta = deltaFn(this.config.keyboardDisplacement, factor);
30261 state._keyboardActive = true;
30262 V.addTo(state._movement, state._delta);
30263 this.compute(event);
30264 this.emit();
30265 }
30266 }
30267 keyUp(event) {
30268 if (!(event.key in KEYS_DELTA_MAP)) return;
30269 this.state._keyboardActive = false;
30270 this.setActive();
30271 this.compute(event);
30272 this.emit();
30273 }
30274 bind(bindFunction) {
30275 const device = this.config.device;
30276 bindFunction(device, 'start', this.pointerDown.bind(this));
30277 if (this.config.pointerCapture) {
30278 bindFunction(device, 'change', this.pointerMove.bind(this));
30279 bindFunction(device, 'end', this.pointerUp.bind(this));
30280 bindFunction(device, 'cancel', this.pointerUp.bind(this));
30281 bindFunction('lostPointerCapture', '', this.pointerUp.bind(this));
30282 }
30283 if (this.config.keys) {
30284 bindFunction('key', 'down', this.keyDown.bind(this));
30285 bindFunction('key', 'up', this.keyUp.bind(this));
30286 }
30287 if (this.config.filterTaps) {
30288 bindFunction('click', '', this.pointerClick.bind(this), {
30289 capture: true,
30290 passive: false
30291 });
30292 }
30293 }
30294}
30295function persistEvent(event) {
30296 'persist' in event && typeof event.persist === 'function' && event.persist();
30297}
30298
30299const actions_fe213e88_esm_isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement;
30300function supportsTouchEvents() {
30301 return actions_fe213e88_esm_isBrowser && 'ontouchstart' in window;
30302}
30303function isTouchScreen() {
30304 return supportsTouchEvents() || actions_fe213e88_esm_isBrowser && window.navigator.maxTouchPoints > 1;
30305}
30306function supportsPointerEvents() {
30307 return actions_fe213e88_esm_isBrowser && 'onpointerdown' in window;
30308}
30309function supportsPointerLock() {
30310 return actions_fe213e88_esm_isBrowser && 'exitPointerLock' in window.document;
30311}
30312function supportsGestureEvents() {
30313 try {
30314 return 'constructor' in GestureEvent;
30315 } catch (e) {
30316 return false;
30317 }
30318}
30319const SUPPORT = {
30320 isBrowser: actions_fe213e88_esm_isBrowser,
30321 gesture: supportsGestureEvents(),
30322 touch: supportsTouchEvents(),
30323 touchscreen: isTouchScreen(),
30324 pointer: supportsPointerEvents(),
30325 pointerLock: supportsPointerLock()
30326};
30327
30328const DEFAULT_PREVENT_SCROLL_DELAY = 250;
30329const DEFAULT_DRAG_DELAY = 180;
30330const DEFAULT_SWIPE_VELOCITY = 0.5;
30331const DEFAULT_SWIPE_DISTANCE = 50;
30332const DEFAULT_SWIPE_DURATION = 250;
30333const DEFAULT_KEYBOARD_DISPLACEMENT = 10;
30334const DEFAULT_DRAG_AXIS_THRESHOLD = {
30335 mouse: 0,
30336 touch: 0,
30337 pen: 8
30338};
30339const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
30340 device(_v, _k, {
30341 pointer: {
30342 touch = false,
30343 lock = false,
30344 mouse = false
30345 } = {}
30346 }) {
30347 this.pointerLock = lock && SUPPORT.pointerLock;
30348 if (SUPPORT.touch && touch) return 'touch';
30349 if (this.pointerLock) return 'mouse';
30350 if (SUPPORT.pointer && !mouse) return 'pointer';
30351 if (SUPPORT.touch) return 'touch';
30352 return 'mouse';
30353 },
30354 preventScrollAxis(value, _k, {
30355 preventScroll
30356 }) {
30357 this.preventScrollDelay = typeof preventScroll === 'number' ? preventScroll : preventScroll || preventScroll === undefined && value ? DEFAULT_PREVENT_SCROLL_DELAY : undefined;
30358 if (!SUPPORT.touchscreen || preventScroll === false) return undefined;
30359 return value ? value : preventScroll !== undefined ? 'y' : undefined;
30360 },
30361 pointerCapture(_v, _k, {
30362 pointer: {
30363 capture = true,
30364 buttons = 1,
30365 keys = true
30366 } = {}
30367 }) {
30368 this.pointerButtons = buttons;
30369 this.keys = keys;
30370 return !this.pointerLock && this.device === 'pointer' && capture;
30371 },
30372 threshold(value, _k, {
30373 filterTaps = false,
30374 tapsThreshold = 3,
30375 axis = undefined
30376 }) {
30377 const threshold = V.toVector(value, filterTaps ? tapsThreshold : axis ? 1 : 0);
30378 this.filterTaps = filterTaps;
30379 this.tapsThreshold = tapsThreshold;
30380 return threshold;
30381 },
30382 swipe({
30383 velocity = DEFAULT_SWIPE_VELOCITY,
30384 distance = DEFAULT_SWIPE_DISTANCE,
30385 duration = DEFAULT_SWIPE_DURATION
30386 } = {}) {
30387 return {
30388 velocity: this.transform(V.toVector(velocity)),
30389 distance: this.transform(V.toVector(distance)),
30390 duration
30391 };
30392 },
30393 delay(value = 0) {
30394 switch (value) {
30395 case true:
30396 return DEFAULT_DRAG_DELAY;
30397 case false:
30398 return 0;
30399 default:
30400 return value;
30401 }
30402 },
30403 axisThreshold(value) {
30404 if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD;
30405 return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
30406 },
30407 keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) {
30408 return value;
30409 }
30410});
30411if (false) {}
30412
30413function clampStateInternalMovementToBounds(state) {
30414 const [ox, oy] = state.overflow;
30415 const [dx, dy] = state._delta;
30416 const [dirx, diry] = state._direction;
30417 if (ox < 0 && dx > 0 && dirx < 0 || ox > 0 && dx < 0 && dirx > 0) {
30418 state._movement[0] = state._movementBound[0];
30419 }
30420 if (oy < 0 && dy > 0 && diry < 0 || oy > 0 && dy < 0 && diry > 0) {
30421 state._movement[1] = state._movementBound[1];
30422 }
30423}
30424
30425const SCALE_ANGLE_RATIO_INTENT_DEG = 30;
30426const PINCH_WHEEL_RATIO = 100;
30427class PinchEngine extends Engine {
30428 constructor(...args) {
30429 super(...args);
30430 _defineProperty(this, "ingKey", 'pinching');
30431 _defineProperty(this, "aliasKey", 'da');
30432 }
30433 init() {
30434 this.state.offset = [1, 0];
30435 this.state.lastOffset = [1, 0];
30436 this.state._pointerEvents = new Map();
30437 }
30438 reset() {
30439 super.reset();
30440 const state = this.state;
30441 state._touchIds = [];
30442 state.canceled = false;
30443 state.cancel = this.cancel.bind(this);
30444 state.turns = 0;
30445 }
30446 computeOffset() {
30447 const {
30448 type,
30449 movement,
30450 lastOffset
30451 } = this.state;
30452 if (type === 'wheel') {
30453 this.state.offset = V.add(movement, lastOffset);
30454 } else {
30455 this.state.offset = [(1 + movement[0]) * lastOffset[0], movement[1] + lastOffset[1]];
30456 }
30457 }
30458 computeMovement() {
30459 const {
30460 offset,
30461 lastOffset
30462 } = this.state;
30463 this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
30464 }
30465 axisIntent() {
30466 const state = this.state;
30467 const [_m0, _m1] = state._movement;
30468 if (!state.axis) {
30469 const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
30470 if (axisMovementDifference < 0) state.axis = 'angle';else if (axisMovementDifference > 0) state.axis = 'scale';
30471 }
30472 }
30473 restrictToAxis(v) {
30474 if (this.config.lockDirection) {
30475 if (this.state.axis === 'scale') v[1] = 0;else if (this.state.axis === 'angle') v[0] = 0;
30476 }
30477 }
30478 cancel() {
30479 const state = this.state;
30480 if (state.canceled) return;
30481 setTimeout(() => {
30482 state.canceled = true;
30483 state._active = false;
30484 this.compute();
30485 this.emit();
30486 }, 0);
30487 }
30488 touchStart(event) {
30489 this.ctrl.setEventIds(event);
30490 const state = this.state;
30491 const ctrlTouchIds = this.ctrl.touchIds;
30492 if (state._active) {
30493 if (state._touchIds.every(id => ctrlTouchIds.has(id))) return;
30494 }
30495 if (ctrlTouchIds.size < 2) return;
30496 this.start(event);
30497 state._touchIds = Array.from(ctrlTouchIds).slice(0, 2);
30498 const payload = touchDistanceAngle(event, state._touchIds);
30499 if (!payload) return;
30500 this.pinchStart(event, payload);
30501 }
30502 pointerStart(event) {
30503 if (event.buttons != null && event.buttons % 2 !== 1) return;
30504 this.ctrl.setEventIds(event);
30505 event.target.setPointerCapture(event.pointerId);
30506 const state = this.state;
30507 const _pointerEvents = state._pointerEvents;
30508 const ctrlPointerIds = this.ctrl.pointerIds;
30509 if (state._active) {
30510 if (Array.from(_pointerEvents.keys()).every(id => ctrlPointerIds.has(id))) return;
30511 }
30512 if (_pointerEvents.size < 2) {
30513 _pointerEvents.set(event.pointerId, event);
30514 }
30515 if (state._pointerEvents.size < 2) return;
30516 this.start(event);
30517 const payload = distanceAngle(...Array.from(_pointerEvents.values()));
30518 if (!payload) return;
30519 this.pinchStart(event, payload);
30520 }
30521 pinchStart(event, payload) {
30522 const state = this.state;
30523 state.origin = payload.origin;
30524 this.computeValues([payload.distance, payload.angle]);
30525 this.computeInitial();
30526 this.compute(event);
30527 this.emit();
30528 }
30529 touchMove(event) {
30530 if (!this.state._active) return;
30531 const payload = touchDistanceAngle(event, this.state._touchIds);
30532 if (!payload) return;
30533 this.pinchMove(event, payload);
30534 }
30535 pointerMove(event) {
30536 const _pointerEvents = this.state._pointerEvents;
30537 if (_pointerEvents.has(event.pointerId)) {
30538 _pointerEvents.set(event.pointerId, event);
30539 }
30540 if (!this.state._active) return;
30541 const payload = distanceAngle(...Array.from(_pointerEvents.values()));
30542 if (!payload) return;
30543 this.pinchMove(event, payload);
30544 }
30545 pinchMove(event, payload) {
30546 const state = this.state;
30547 const prev_a = state._values[1];
30548 const delta_a = payload.angle - prev_a;
30549 let delta_turns = 0;
30550 if (Math.abs(delta_a) > 270) delta_turns += Math.sign(delta_a);
30551 this.computeValues([payload.distance, payload.angle - 360 * delta_turns]);
30552 state.origin = payload.origin;
30553 state.turns = delta_turns;
30554 state._movement = [state._values[0] / state._initial[0] - 1, state._values[1] - state._initial[1]];
30555 this.compute(event);
30556 this.emit();
30557 }
30558 touchEnd(event) {
30559 this.ctrl.setEventIds(event);
30560 if (!this.state._active) return;
30561 if (this.state._touchIds.some(id => !this.ctrl.touchIds.has(id))) {
30562 this.state._active = false;
30563 this.compute(event);
30564 this.emit();
30565 }
30566 }
30567 pointerEnd(event) {
30568 const state = this.state;
30569 this.ctrl.setEventIds(event);
30570 try {
30571 event.target.releasePointerCapture(event.pointerId);
30572 } catch (_unused) {}
30573 if (state._pointerEvents.has(event.pointerId)) {
30574 state._pointerEvents.delete(event.pointerId);
30575 }
30576 if (!state._active) return;
30577 if (state._pointerEvents.size < 2) {
30578 state._active = false;
30579 this.compute(event);
30580 this.emit();
30581 }
30582 }
30583 gestureStart(event) {
30584 if (event.cancelable) event.preventDefault();
30585 const state = this.state;
30586 if (state._active) return;
30587 this.start(event);
30588 this.computeValues([event.scale, event.rotation]);
30589 state.origin = [event.clientX, event.clientY];
30590 this.compute(event);
30591 this.emit();
30592 }
30593 gestureMove(event) {
30594 if (event.cancelable) event.preventDefault();
30595 if (!this.state._active) return;
30596 const state = this.state;
30597 this.computeValues([event.scale, event.rotation]);
30598 state.origin = [event.clientX, event.clientY];
30599 const _previousMovement = state._movement;
30600 state._movement = [event.scale - 1, event.rotation];
30601 state._delta = V.sub(state._movement, _previousMovement);
30602 this.compute(event);
30603 this.emit();
30604 }
30605 gestureEnd(event) {
30606 if (!this.state._active) return;
30607 this.state._active = false;
30608 this.compute(event);
30609 this.emit();
30610 }
30611 wheel(event) {
30612 const modifierKey = this.config.modifierKey;
30613 if (modifierKey && (Array.isArray(modifierKey) ? !modifierKey.find(k => event[k]) : !event[modifierKey])) return;
30614 if (!this.state._active) this.wheelStart(event);else this.wheelChange(event);
30615 this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));
30616 }
30617 wheelStart(event) {
30618 this.start(event);
30619 this.wheelChange(event);
30620 }
30621 wheelChange(event) {
30622 const isR3f = ('uv' in event);
30623 if (!isR3f) {
30624 if (event.cancelable) {
30625 event.preventDefault();
30626 }
30627 if (false) {}
30628 }
30629 const state = this.state;
30630 state._delta = [-wheelValues(event)[1] / PINCH_WHEEL_RATIO * state.offset[0], 0];
30631 V.addTo(state._movement, state._delta);
30632 clampStateInternalMovementToBounds(state);
30633 this.state.origin = [event.clientX, event.clientY];
30634 this.compute(event);
30635 this.emit();
30636 }
30637 wheelEnd() {
30638 if (!this.state._active) return;
30639 this.state._active = false;
30640 this.compute();
30641 this.emit();
30642 }
30643 bind(bindFunction) {
30644 const device = this.config.device;
30645 if (!!device) {
30646 bindFunction(device, 'start', this[device + 'Start'].bind(this));
30647 bindFunction(device, 'change', this[device + 'Move'].bind(this));
30648 bindFunction(device, 'end', this[device + 'End'].bind(this));
30649 bindFunction(device, 'cancel', this[device + 'End'].bind(this));
30650 bindFunction('lostPointerCapture', '', this[device + 'End'].bind(this));
30651 }
30652 if (this.config.pinchOnWheel) {
30653 bindFunction('wheel', '', this.wheel.bind(this), {
30654 passive: false
30655 });
30656 }
30657 }
30658}
30659
30660const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
30661 device(_v, _k, {
30662 shared,
30663 pointer: {
30664 touch = false
30665 } = {}
30666 }) {
30667 const sharedConfig = shared;
30668 if (sharedConfig.target && !SUPPORT.touch && SUPPORT.gesture) return 'gesture';
30669 if (SUPPORT.touch && touch) return 'touch';
30670 if (SUPPORT.touchscreen) {
30671 if (SUPPORT.pointer) return 'pointer';
30672 if (SUPPORT.touch) return 'touch';
30673 }
30674 },
30675 bounds(_v, _k, {
30676 scaleBounds = {},
30677 angleBounds = {}
30678 }) {
30679 const _scaleBounds = state => {
30680 const D = assignDefault(call(scaleBounds, state), {
30681 min: -Infinity,
30682 max: Infinity
30683 });
30684 return [D.min, D.max];
30685 };
30686 const _angleBounds = state => {
30687 const A = assignDefault(call(angleBounds, state), {
30688 min: -Infinity,
30689 max: Infinity
30690 });
30691 return [A.min, A.max];
30692 };
30693 if (typeof scaleBounds !== 'function' && typeof angleBounds !== 'function') return [_scaleBounds(), _angleBounds()];
30694 return state => [_scaleBounds(state), _angleBounds(state)];
30695 },
30696 threshold(value, _k, config) {
30697 this.lockDirection = config.axis === 'lock';
30698 const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);
30699 return threshold;
30700 },
30701 modifierKey(value) {
30702 if (value === undefined) return 'ctrlKey';
30703 return value;
30704 },
30705 pinchOnWheel(value = true) {
30706 return value;
30707 }
30708});
30709
30710class MoveEngine extends CoordinatesEngine {
30711 constructor(...args) {
30712 super(...args);
30713 _defineProperty(this, "ingKey", 'moving');
30714 }
30715 move(event) {
30716 if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
30717 if (!this.state._active) this.moveStart(event);else this.moveChange(event);
30718 this.timeoutStore.add('moveEnd', this.moveEnd.bind(this));
30719 }
30720 moveStart(event) {
30721 this.start(event);
30722 this.computeValues(pointerValues(event));
30723 this.compute(event);
30724 this.computeInitial();
30725 this.emit();
30726 }
30727 moveChange(event) {
30728 if (!this.state._active) return;
30729 const values = pointerValues(event);
30730 const state = this.state;
30731 state._delta = V.sub(values, state._values);
30732 V.addTo(state._movement, state._delta);
30733 this.computeValues(values);
30734 this.compute(event);
30735 this.emit();
30736 }
30737 moveEnd(event) {
30738 if (!this.state._active) return;
30739 this.state._active = false;
30740 this.compute(event);
30741 this.emit();
30742 }
30743 bind(bindFunction) {
30744 bindFunction('pointer', 'change', this.move.bind(this));
30745 bindFunction('pointer', 'leave', this.moveEnd.bind(this));
30746 }
30747}
30748
30749const moveConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
30750 mouseOnly: (value = true) => value
30751});
30752
30753class ScrollEngine extends CoordinatesEngine {
30754 constructor(...args) {
30755 super(...args);
30756 _defineProperty(this, "ingKey", 'scrolling');
30757 }
30758 scroll(event) {
30759 if (!this.state._active) this.start(event);
30760 this.scrollChange(event);
30761 this.timeoutStore.add('scrollEnd', this.scrollEnd.bind(this));
30762 }
30763 scrollChange(event) {
30764 if (event.cancelable) event.preventDefault();
30765 const state = this.state;
30766 const values = scrollValues(event);
30767 state._delta = V.sub(values, state._values);
30768 V.addTo(state._movement, state._delta);
30769 this.computeValues(values);
30770 this.compute(event);
30771 this.emit();
30772 }
30773 scrollEnd() {
30774 if (!this.state._active) return;
30775 this.state._active = false;
30776 this.compute();
30777 this.emit();
30778 }
30779 bind(bindFunction) {
30780 bindFunction('scroll', '', this.scroll.bind(this));
30781 }
30782}
30783
30784const scrollConfigResolver = coordinatesConfigResolver;
30785
30786class WheelEngine extends CoordinatesEngine {
30787 constructor(...args) {
30788 super(...args);
30789 _defineProperty(this, "ingKey", 'wheeling');
30790 }
30791 wheel(event) {
30792 if (!this.state._active) this.start(event);
30793 this.wheelChange(event);
30794 this.timeoutStore.add('wheelEnd', this.wheelEnd.bind(this));
30795 }
30796 wheelChange(event) {
30797 const state = this.state;
30798 state._delta = wheelValues(event);
30799 V.addTo(state._movement, state._delta);
30800 clampStateInternalMovementToBounds(state);
30801 this.compute(event);
30802 this.emit();
30803 }
30804 wheelEnd() {
30805 if (!this.state._active) return;
30806 this.state._active = false;
30807 this.compute();
30808 this.emit();
30809 }
30810 bind(bindFunction) {
30811 bindFunction('wheel', '', this.wheel.bind(this));
30812 }
30813}
30814
30815const wheelConfigResolver = coordinatesConfigResolver;
30816
30817class HoverEngine extends CoordinatesEngine {
30818 constructor(...args) {
30819 super(...args);
30820 _defineProperty(this, "ingKey", 'hovering');
30821 }
30822 enter(event) {
30823 if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
30824 this.start(event);
30825 this.computeValues(pointerValues(event));
30826 this.compute(event);
30827 this.emit();
30828 }
30829 leave(event) {
30830 if (this.config.mouseOnly && event.pointerType !== 'mouse') return;
30831 const state = this.state;
30832 if (!state._active) return;
30833 state._active = false;
30834 const values = pointerValues(event);
30835 state._movement = state._delta = V.sub(values, state._values);
30836 this.computeValues(values);
30837 this.compute(event);
30838 state.delta = state.movement;
30839 this.emit();
30840 }
30841 bind(bindFunction) {
30842 bindFunction('pointer', 'enter', this.enter.bind(this));
30843 bindFunction('pointer', 'leave', this.leave.bind(this));
30844 }
30845}
30846
30847const hoverConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
30848 mouseOnly: (value = true) => value
30849});
30850
30851const actions_fe213e88_esm_EngineMap = new Map();
30852const ConfigResolverMap = new Map();
30853function actions_fe213e88_esm_registerAction(action) {
30854 actions_fe213e88_esm_EngineMap.set(action.key, action.engine);
30855 ConfigResolverMap.set(action.key, action.resolver);
30856}
30857const actions_fe213e88_esm_dragAction = {
30858 key: 'drag',
30859 engine: DragEngine,
30860 resolver: dragConfigResolver
30861};
30862const actions_fe213e88_esm_hoverAction = {
30863 key: 'hover',
30864 engine: HoverEngine,
30865 resolver: hoverConfigResolver
30866};
30867const actions_fe213e88_esm_moveAction = {
30868 key: 'move',
30869 engine: MoveEngine,
30870 resolver: moveConfigResolver
30871};
30872const actions_fe213e88_esm_pinchAction = {
30873 key: 'pinch',
30874 engine: PinchEngine,
30875 resolver: pinchConfigResolver
30876};
30877const actions_fe213e88_esm_scrollAction = {
30878 key: 'scroll',
30879 engine: ScrollEngine,
30880 resolver: scrollConfigResolver
30881};
30882const actions_fe213e88_esm_wheelAction = {
30883 key: 'wheel',
30884 engine: WheelEngine,
30885 resolver: wheelConfigResolver
30886};
30887
30888
30889
30890;// ./node_modules/@use-gesture/core/dist/use-gesture-core.esm.js
30891
30892
30893
30894function _objectWithoutPropertiesLoose(source, excluded) {
30895 if (source == null) return {};
30896 var target = {};
30897 var sourceKeys = Object.keys(source);
30898 var key, i;
30899 for (i = 0; i < sourceKeys.length; i++) {
30900 key = sourceKeys[i];
30901 if (excluded.indexOf(key) >= 0) continue;
30902 target[key] = source[key];
30903 }
30904 return target;
30905}
30906
30907function _objectWithoutProperties(source, excluded) {
30908 if (source == null) return {};
30909 var target = _objectWithoutPropertiesLoose(source, excluded);
30910 var key, i;
30911 if (Object.getOwnPropertySymbols) {
30912 var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
30913 for (i = 0; i < sourceSymbolKeys.length; i++) {
30914 key = sourceSymbolKeys[i];
30915 if (excluded.indexOf(key) >= 0) continue;
30916 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
30917 target[key] = source[key];
30918 }
30919 }
30920 return target;
30921}
30922
30923const sharedConfigResolver = {
30924 target(value) {
30925 if (value) {
30926 return () => 'current' in value ? value.current : value;
30927 }
30928 return undefined;
30929 },
30930 enabled(value = true) {
30931 return value;
30932 },
30933 window(value = SUPPORT.isBrowser ? window : undefined) {
30934 return value;
30935 },
30936 eventOptions({
30937 passive = true,
30938 capture = false
30939 } = {}) {
30940 return {
30941 passive,
30942 capture
30943 };
30944 },
30945 transform(value) {
30946 return value;
30947 }
30948};
30949
30950const _excluded = ["target", "eventOptions", "window", "enabled", "transform"];
30951function resolveWith(config = {}, resolvers) {
30952 const result = {};
30953 for (const [key, resolver] of Object.entries(resolvers)) {
30954 switch (typeof resolver) {
30955 case 'function':
30956 if (false) {} else {
30957 result[key] = resolver.call(result, config[key], key, config);
30958 }
30959 break;
30960 case 'object':
30961 result[key] = resolveWith(config[key], resolver);
30962 break;
30963 case 'boolean':
30964 if (resolver) result[key] = config[key];
30965 break;
30966 }
30967 }
30968 return result;
30969}
30970function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) {
30971 const _ref = newConfig,
30972 {
30973 target,
30974 eventOptions,
30975 window,
30976 enabled,
30977 transform
30978 } = _ref,
30979 rest = _objectWithoutProperties(_ref, _excluded);
30980 _config.shared = resolveWith({
30981 target,
30982 eventOptions,
30983 window,
30984 enabled,
30985 transform
30986 }, sharedConfigResolver);
30987 if (gestureKey) {
30988 const resolver = ConfigResolverMap.get(gestureKey);
30989 _config[gestureKey] = resolveWith(_objectSpread2({
30990 shared: _config.shared
30991 }, rest), resolver);
30992 } else {
30993 for (const key in rest) {
30994 const resolver = ConfigResolverMap.get(key);
30995 if (resolver) {
30996 _config[key] = resolveWith(_objectSpread2({
30997 shared: _config.shared
30998 }, rest[key]), resolver);
30999 } else if (false) {}
31000 }
31001 }
31002 return _config;
31003}
31004
31005class EventStore {
31006 constructor(ctrl, gestureKey) {
31007 _defineProperty(this, "_listeners", new Set());
31008 this._ctrl = ctrl;
31009 this._gestureKey = gestureKey;
31010 }
31011 add(element, device, action, handler, options) {
31012 const listeners = this._listeners;
31013 const type = toDomEventType(device, action);
31014 const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
31015 const eventOptions = _objectSpread2(_objectSpread2({}, _options), options);
31016 element.addEventListener(type, handler, eventOptions);
31017 const remove = () => {
31018 element.removeEventListener(type, handler, eventOptions);
31019 listeners.delete(remove);
31020 };
31021 listeners.add(remove);
31022 return remove;
31023 }
31024 clean() {
31025 this._listeners.forEach(remove => remove());
31026 this._listeners.clear();
31027 }
31028}
31029
31030class TimeoutStore {
31031 constructor() {
31032 _defineProperty(this, "_timeouts", new Map());
31033 }
31034 add(key, callback, ms = 140, ...args) {
31035 this.remove(key);
31036 this._timeouts.set(key, window.setTimeout(callback, ms, ...args));
31037 }
31038 remove(key) {
31039 const timeout = this._timeouts.get(key);
31040 if (timeout) window.clearTimeout(timeout);
31041 }
31042 clean() {
31043 this._timeouts.forEach(timeout => void window.clearTimeout(timeout));
31044 this._timeouts.clear();
31045 }
31046}
31047
31048class Controller {
31049 constructor(handlers) {
31050 _defineProperty(this, "gestures", new Set());
31051 _defineProperty(this, "_targetEventStore", new EventStore(this));
31052 _defineProperty(this, "gestureEventStores", {});
31053 _defineProperty(this, "gestureTimeoutStores", {});
31054 _defineProperty(this, "handlers", {});
31055 _defineProperty(this, "config", {});
31056 _defineProperty(this, "pointerIds", new Set());
31057 _defineProperty(this, "touchIds", new Set());
31058 _defineProperty(this, "state", {
31059 shared: {
31060 shiftKey: false,
31061 metaKey: false,
31062 ctrlKey: false,
31063 altKey: false
31064 }
31065 });
31066 resolveGestures(this, handlers);
31067 }
31068 setEventIds(event) {
31069 if (isTouch(event)) {
31070 this.touchIds = new Set(touchIds(event));
31071 return this.touchIds;
31072 } else if ('pointerId' in event) {
31073 if (event.type === 'pointerup' || event.type === 'pointercancel') this.pointerIds.delete(event.pointerId);else if (event.type === 'pointerdown') this.pointerIds.add(event.pointerId);
31074 return this.pointerIds;
31075 }
31076 }
31077 applyHandlers(handlers, nativeHandlers) {
31078 this.handlers = handlers;
31079 this.nativeHandlers = nativeHandlers;
31080 }
31081 applyConfig(config, gestureKey) {
31082 this.config = use_gesture_core_esm_parse(config, gestureKey, this.config);
31083 }
31084 clean() {
31085 this._targetEventStore.clean();
31086 for (const key of this.gestures) {
31087 this.gestureEventStores[key].clean();
31088 this.gestureTimeoutStores[key].clean();
31089 }
31090 }
31091 effect() {
31092 if (this.config.shared.target) this.bind();
31093 return () => this._targetEventStore.clean();
31094 }
31095 bind(...args) {
31096 const sharedConfig = this.config.shared;
31097 const props = {};
31098 let target;
31099 if (sharedConfig.target) {
31100 target = sharedConfig.target();
31101 if (!target) return;
31102 }
31103 if (sharedConfig.enabled) {
31104 for (const gestureKey of this.gestures) {
31105 const gestureConfig = this.config[gestureKey];
31106 const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
31107 if (gestureConfig.enabled) {
31108 const Engine = actions_fe213e88_esm_EngineMap.get(gestureKey);
31109 new Engine(this, args, gestureKey).bind(bindFunction);
31110 }
31111 }
31112 const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
31113 for (const eventKey in this.nativeHandlers) {
31114 nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
31115 event,
31116 args
31117 })), undefined, true);
31118 }
31119 }
31120 for (const handlerProp in props) {
31121 props[handlerProp] = actions_fe213e88_esm_chain(...props[handlerProp]);
31122 }
31123 if (!target) return props;
31124 for (const handlerProp in props) {
31125 const {
31126 device,
31127 capture,
31128 passive
31129 } = parseProp(handlerProp);
31130 this._targetEventStore.add(target, device, '', props[handlerProp], {
31131 capture,
31132 passive
31133 });
31134 }
31135 }
31136}
31137function use_gesture_core_esm_setupGesture(ctrl, gestureKey) {
31138 ctrl.gestures.add(gestureKey);
31139 ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
31140 ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
31141}
31142function resolveGestures(ctrl, internalHandlers) {
31143 if (internalHandlers.drag) use_gesture_core_esm_setupGesture(ctrl, 'drag');
31144 if (internalHandlers.wheel) use_gesture_core_esm_setupGesture(ctrl, 'wheel');
31145 if (internalHandlers.scroll) use_gesture_core_esm_setupGesture(ctrl, 'scroll');
31146 if (internalHandlers.move) use_gesture_core_esm_setupGesture(ctrl, 'move');
31147 if (internalHandlers.pinch) use_gesture_core_esm_setupGesture(ctrl, 'pinch');
31148 if (internalHandlers.hover) use_gesture_core_esm_setupGesture(ctrl, 'hover');
31149}
31150const bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => {
31151 var _options$capture, _options$passive;
31152 const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture;
31153 const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive;
31154 let handlerProp = isNative ? device : toHandlerProp(device, action, capture);
31155 if (withPassiveOption && passive) handlerProp += 'Passive';
31156 props[handlerProp] = props[handlerProp] || [];
31157 props[handlerProp].push(handler);
31158};
31159
31160const RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
31161function sortHandlers(_handlers) {
31162 const native = {};
31163 const handlers = {};
31164 const actions = new Set();
31165 for (let key in _handlers) {
31166 if (RE_NOT_NATIVE.test(key)) {
31167 actions.add(RegExp.lastMatch);
31168 handlers[key] = _handlers[key];
31169 } else {
31170 native[key] = _handlers[key];
31171 }
31172 }
31173 return [handlers, native, actions];
31174}
31175function registerGesture(actions, handlers, handlerKey, key, internalHandlers, config) {
31176 if (!actions.has(handlerKey)) return;
31177 if (!EngineMap.has(key)) {
31178 if (false) {}
31179 return;
31180 }
31181 const startKey = handlerKey + 'Start';
31182 const endKey = handlerKey + 'End';
31183 const fn = state => {
31184 let memo = undefined;
31185 if (state.first && startKey in handlers) handlers[startKey](state);
31186 if (handlerKey in handlers) memo = handlers[handlerKey](state);
31187 if (state.last && endKey in handlers) handlers[endKey](state);
31188 return memo;
31189 };
31190 internalHandlers[key] = fn;
31191 config[key] = config[key] || {};
31192}
31193function use_gesture_core_esm_parseMergedHandlers(mergedHandlers, mergedConfig) {
31194 const [handlers, nativeHandlers, actions] = sortHandlers(mergedHandlers);
31195 const internalHandlers = {};
31196 registerGesture(actions, handlers, 'onDrag', 'drag', internalHandlers, mergedConfig);
31197 registerGesture(actions, handlers, 'onWheel', 'wheel', internalHandlers, mergedConfig);
31198 registerGesture(actions, handlers, 'onScroll', 'scroll', internalHandlers, mergedConfig);
31199 registerGesture(actions, handlers, 'onPinch', 'pinch', internalHandlers, mergedConfig);
31200 registerGesture(actions, handlers, 'onMove', 'move', internalHandlers, mergedConfig);
31201 registerGesture(actions, handlers, 'onHover', 'hover', internalHandlers, mergedConfig);
31202 return {
31203 handlers: internalHandlers,
31204 config: mergedConfig,
31205 nativeHandlers
31206 };
31207}
31208
31209
31210
31211;// ./node_modules/@use-gesture/react/dist/use-gesture-react.esm.js
31212
31213
31214
31215
31216
31217
31218
31219function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
31220 const ctrl = external_React_default().useMemo(() => new Controller(handlers), []);
31221 ctrl.applyHandlers(handlers, nativeHandlers);
31222 ctrl.applyConfig(config, gestureKey);
31223 external_React_default().useEffect(ctrl.effect.bind(ctrl));
31224 external_React_default().useEffect(() => {
31225 return ctrl.clean.bind(ctrl);
31226 }, []);
31227 if (config.target === undefined) {
31228 return ctrl.bind.bind(ctrl);
31229 }
31230 return undefined;
31231}
31232
31233function useDrag(handler, config) {
31234 actions_fe213e88_esm_registerAction(actions_fe213e88_esm_dragAction);
31235 return useRecognizers({
31236 drag: handler
31237 }, config || {}, 'drag');
31238}
31239
31240function usePinch(handler, config) {
31241 registerAction(pinchAction);
31242 return useRecognizers({
31243 pinch: handler
31244 }, config || {}, 'pinch');
31245}
31246
31247function useWheel(handler, config) {
31248 registerAction(wheelAction);
31249 return useRecognizers({
31250 wheel: handler
31251 }, config || {}, 'wheel');
31252}
31253
31254function useScroll(handler, config) {
31255 registerAction(scrollAction);
31256 return useRecognizers({
31257 scroll: handler
31258 }, config || {}, 'scroll');
31259}
31260
31261function useMove(handler, config) {
31262 registerAction(moveAction);
31263 return useRecognizers({
31264 move: handler
31265 }, config || {}, 'move');
31266}
31267
31268function useHover(handler, config) {
31269 registerAction(hoverAction);
31270 return useRecognizers({
31271 hover: handler
31272 }, config || {}, 'hover');
31273}
31274
31275function createUseGesture(actions) {
31276 actions.forEach(registerAction);
31277 return function useGesture(_handlers, _config) {
31278 const {
31279 handlers,
31280 nativeHandlers,
31281 config
31282 } = parseMergedHandlers(_handlers, _config || {});
31283 return useRecognizers(handlers, config, undefined, nativeHandlers);
31284 };
31285}
31286
31287function useGesture(handlers, config) {
31288 const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
31289 return hook(handlers, config || {});
31290}
31291
31292
31293
31294;// ./node_modules/@wordpress/components/build-module/input-control/utils.js
31295
31296function getDragCursor(dragDirection) {
31297 let dragCursor = "ns-resize";
31298 switch (dragDirection) {
31299 case "n":
31300 case "s":
31301 dragCursor = "ns-resize";
31302 break;
31303 case "e":
31304 case "w":
31305 dragCursor = "ew-resize";
31306 break;
31307 }
31308 return dragCursor;
31309}
31310function useDragCursor(isDragging, dragDirection) {
31311 const dragCursor = getDragCursor(dragDirection);
31312 (0,external_wp_element_namespaceObject.useEffect)(() => {
31313 if (isDragging) {
31314 document.documentElement.style.cursor = dragCursor;
31315 } else {
31316 document.documentElement.style.cursor = null;
31317 }
31318 }, [isDragging, dragCursor]);
31319 return dragCursor;
31320}
31321function useDraft(props) {
31322 const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(props.value);
31323 const [draft, setDraft] = (0,external_wp_element_namespaceObject.useState)({});
31324 const value = draft.value !== void 0 ? draft.value : props.value;
31325 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
31326 const {
31327 current: previousValue
31328 } = previousValueRef;
31329 previousValueRef.current = props.value;
31330 if (draft.value !== void 0 && !draft.isStale) {
31331 setDraft({
31332 ...draft,
31333 isStale: true
31334 });
31335 } else if (draft.isStale && props.value !== previousValue) {
31336 setDraft({});
31337 }
31338 }, [props.value, draft]);
31339 const onChange = (nextValue, extra) => {
31340 setDraft((current) => Object.assign(current, {
31341 value: nextValue,
31342 isStale: false
31343 }));
31344 props.onChange(nextValue, extra);
31345 };
31346 const onBlur = (event) => {
31347 setDraft({});
31348 props.onBlur?.(event);
31349 };
31350 return {
31351 value,
31352 onBlur,
31353 onChange
31354 };
31355}
31356
31357
31358;// ./node_modules/@wordpress/components/build-module/input-control/reducer/state.js
31359const initialStateReducer = (state) => state;
31360const initialInputControlState = {
31361 error: null,
31362 initialValue: "",
31363 isDirty: false,
31364 isDragEnabled: false,
31365 isDragging: false,
31366 isPressEnterToChange: false,
31367 value: ""
31368};
31369
31370
31371;// ./node_modules/@wordpress/components/build-module/input-control/reducer/actions.js
31372const CHANGE = "CHANGE";
31373const COMMIT = "COMMIT";
31374const CONTROL = "CONTROL";
31375const DRAG_END = "DRAG_END";
31376const DRAG_START = "DRAG_START";
31377const DRAG = "DRAG";
31378const INVALIDATE = "INVALIDATE";
31379const PRESS_DOWN = "PRESS_DOWN";
31380const PRESS_ENTER = "PRESS_ENTER";
31381const PRESS_UP = "PRESS_UP";
31382const RESET = "RESET";
31383
31384
31385;// ./node_modules/@wordpress/components/build-module/input-control/reducer/reducer.js
31386
31387
31388
31389function mergeInitialState(initialState = initialInputControlState) {
31390 const {
31391 value
31392 } = initialState;
31393 return {
31394 ...initialInputControlState,
31395 ...initialState,
31396 initialValue: value
31397 };
31398}
31399function inputControlStateReducer(composedStateReducers) {
31400 return (state, action) => {
31401 const nextState = {
31402 ...state
31403 };
31404 switch (action.type) {
31405 /*
31406 * Controlled updates
31407 */
31408 case CONTROL:
31409 nextState.value = action.payload.value;
31410 nextState.isDirty = false;
31411 nextState._event = void 0;
31412 return nextState;
31413 /**
31414 * Keyboard events
31415 */
31416 case PRESS_UP:
31417 nextState.isDirty = false;
31418 break;
31419 case PRESS_DOWN:
31420 nextState.isDirty = false;
31421 break;
31422 /**
31423 * Drag events
31424 */
31425 case DRAG_START:
31426 nextState.isDragging = true;
31427 break;
31428 case DRAG_END:
31429 nextState.isDragging = false;
31430 break;
31431 /**
31432 * Input events
31433 */
31434 case CHANGE:
31435 nextState.error = null;
31436 nextState.value = action.payload.value;
31437 if (state.isPressEnterToChange) {
31438 nextState.isDirty = true;
31439 }
31440 break;
31441 case COMMIT:
31442 nextState.value = action.payload.value;
31443 nextState.isDirty = false;
31444 break;
31445 case RESET:
31446 nextState.error = null;
31447 nextState.isDirty = false;
31448 nextState.value = action.payload.value || state.initialValue;
31449 break;
31450 /**
31451 * Validation
31452 */
31453 case INVALIDATE:
31454 nextState.error = action.payload.error;
31455 break;
31456 }
31457 nextState._event = action.payload.event;
31458 return composedStateReducers(nextState, action);
31459 };
31460}
31461function useInputControlStateReducer(stateReducer = initialStateReducer, initialState = initialInputControlState, onChangeHandler) {
31462 const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(inputControlStateReducer(stateReducer), mergeInitialState(initialState));
31463 const createChangeEvent = (type) => (nextValue, event) => {
31464 dispatch({
31465 type,
31466 payload: {
31467 value: nextValue,
31468 event
31469 }
31470 });
31471 };
31472 const createKeyEvent = (type) => (event) => {
31473 dispatch({
31474 type,
31475 payload: {
31476 event
31477 }
31478 });
31479 };
31480 const createDragEvent = (type) => (payload) => {
31481 dispatch({
31482 type,
31483 payload
31484 });
31485 };
31486 const change = createChangeEvent(CHANGE);
31487 const invalidate = (error, event) => dispatch({
31488 type: INVALIDATE,
31489 payload: {
31490 error,
31491 event
31492 }
31493 });
31494 const reset = createChangeEvent(RESET);
31495 const commit = createChangeEvent(COMMIT);
31496 const dragStart = createDragEvent(DRAG_START);
31497 const drag = createDragEvent(DRAG);
31498 const dragEnd = createDragEvent(DRAG_END);
31499 const pressUp = createKeyEvent(PRESS_UP);
31500 const pressDown = createKeyEvent(PRESS_DOWN);
31501 const pressEnter = createKeyEvent(PRESS_ENTER);
31502 const currentStateRef = (0,external_wp_element_namespaceObject.useRef)(state);
31503 const refPropsRef = (0,external_wp_element_namespaceObject.useRef)({
31504 value: initialState.value,
31505 onChangeHandler
31506 });
31507 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
31508 currentStateRef.current = state;
31509 refPropsRef.current = {
31510 value: initialState.value,
31511 onChangeHandler
31512 };
31513 });
31514 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
31515 if (currentStateRef.current._event !== void 0 && state.value !== refPropsRef.current.value && !state.isDirty) {
31516 var _state$value;
31517 refPropsRef.current.onChangeHandler((_state$value = state.value) !== null && _state$value !== void 0 ? _state$value : "", {
31518 event: currentStateRef.current._event
31519 });
31520 }
31521 }, [state.value, state.isDirty]);
31522 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
31523 if (initialState.value !== currentStateRef.current.value && !currentStateRef.current.isDirty) {
31524 var _initialState$value;
31525 dispatch({
31526 type: CONTROL,
31527 payload: {
31528 value: (_initialState$value = initialState.value) !== null && _initialState$value !== void 0 ? _initialState$value : ""
31529 }
31530 });
31531 }
31532 }, [initialState.value]);
31533 return {
31534 change,
31535 commit,
31536 dispatch,
31537 drag,
31538 dragEnd,
31539 dragStart,
31540 invalidate,
31541 pressDown,
31542 pressEnter,
31543 pressUp,
31544 reset,
31545 state
31546 };
31547}
31548
31549
31550;// ./node_modules/@wordpress/components/build-module/utils/with-ignore-ime-events.js
31551function withIgnoreIMEEvents(handler) {
31552 return (event) => {
31553 const {
31554 isComposing
31555 } = "nativeEvent" in event ? event.nativeEvent : event;
31556 if (isComposing || // Workaround for Mac Safari where the final Enter/Backspace of an IME composition
31557 // is `isComposing=false`, even though it's technically still part of the composition.
31558 // These can only be detected by keyCode.
31559 event.keyCode === 229) {
31560 return;
31561 }
31562 handler(event);
31563 };
31564}
31565
31566
31567;// ./node_modules/@wordpress/components/build-module/input-control/input-field.js
31568
31569
31570
31571
31572
31573
31574
31575const input_field_noop = () => {
31576};
31577function InputField({
31578 disabled = false,
31579 dragDirection = "n",
31580 dragThreshold = 10,
31581 id,
31582 isDragEnabled = false,
31583 isPressEnterToChange = false,
31584 onBlur = input_field_noop,
31585 onChange = input_field_noop,
31586 onDrag = input_field_noop,
31587 onDragEnd = input_field_noop,
31588 onDragStart = input_field_noop,
31589 onKeyDown = input_field_noop,
31590 onValidate = input_field_noop,
31591 size = "default",
31592 stateReducer = (state) => state,
31593 value: valueProp,
31594 type,
31595 ...props
31596}, ref) {
31597 const {
31598 // State.
31599 state,
31600 // Actions.
31601 change,
31602 commit,
31603 drag,
31604 dragEnd,
31605 dragStart,
31606 invalidate,
31607 pressDown,
31608 pressEnter,
31609 pressUp,
31610 reset
31611 } = useInputControlStateReducer(stateReducer, {
31612 isDragEnabled,
31613 value: valueProp,
31614 isPressEnterToChange
31615 }, onChange);
31616 const {
31617 value,
31618 isDragging,
31619 isDirty
31620 } = state;
31621 const wasDirtyOnBlur = (0,external_wp_element_namespaceObject.useRef)(false);
31622 const dragCursor = useDragCursor(isDragging, dragDirection);
31623 const handleOnBlur = (event) => {
31624 onBlur(event);
31625 if (isDirty || !event.target.validity.valid) {
31626 wasDirtyOnBlur.current = true;
31627 handleOnCommit(event);
31628 }
31629 };
31630 const handleOnChange = (event) => {
31631 const nextValue = event.target.value;
31632 change(nextValue, event);
31633 };
31634 const handleOnCommit = (event) => {
31635 const nextValue = event.currentTarget.value;
31636 try {
31637 onValidate(nextValue);
31638 commit(nextValue, event);
31639 } catch (err) {
31640 invalidate(err, event);
31641 }
31642 };
31643 const handleOnKeyDown = (event) => {
31644 const {
31645 key
31646 } = event;
31647 onKeyDown(event);
31648 switch (key) {
31649 case "ArrowUp":
31650 pressUp(event);
31651 break;
31652 case "ArrowDown":
31653 pressDown(event);
31654 break;
31655 case "Enter":
31656 pressEnter(event);
31657 if (isPressEnterToChange) {
31658 event.preventDefault();
31659 handleOnCommit(event);
31660 }
31661 break;
31662 case "Escape":
31663 if (isPressEnterToChange && isDirty) {
31664 event.preventDefault();
31665 reset(valueProp, event);
31666 }
31667 break;
31668 }
31669 };
31670 const dragGestureProps = useDrag((dragProps2) => {
31671 const {
31672 distance,
31673 dragging,
31674 event,
31675 target
31676 } = dragProps2;
31677 dragProps2.event = {
31678 ...dragProps2.event,
31679 target
31680 };
31681 if (!distance) {
31682 return;
31683 }
31684 event.stopPropagation();
31685 if (!dragging) {
31686 onDragEnd(dragProps2);
31687 dragEnd(dragProps2);
31688 return;
31689 }
31690 onDrag(dragProps2);
31691 drag(dragProps2);
31692 if (!isDragging) {
31693 onDragStart(dragProps2);
31694 dragStart(dragProps2);
31695 }
31696 }, {
31697 axis: dragDirection === "e" || dragDirection === "w" ? "x" : "y",
31698 threshold: dragThreshold,
31699 enabled: isDragEnabled,
31700 pointer: {
31701 capture: false
31702 }
31703 });
31704 const dragProps = isDragEnabled ? dragGestureProps() : {};
31705 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Input, {
31706 ...props,
31707 ...dragProps,
31708 className: "components-input-control__input",
31709 disabled,
31710 dragCursor,
31711 isDragging,
31712 id,
31713 onBlur: handleOnBlur,
31714 onChange: handleOnChange,
31715 onKeyDown: withIgnoreIMEEvents(handleOnKeyDown),
31716 ref,
31717 inputSize: size,
31718 value: value !== null && value !== void 0 ? value : "",
31719 type
31720 });
31721}
31722const ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(InputField);
31723var input_field_default = ForwardedComponent;
31724
31725
31726;// ./node_modules/@wordpress/components/build-module/utils/font-values.js
31727var font_values_default = {
31728 "default.fontFamily": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
31729 "default.fontSize": "13px",
31730 "helpText.fontSize": "12px",
31731 mobileTextMinFontSize: "16px"
31732};
31733
31734
31735;// ./node_modules/@wordpress/components/build-module/utils/font.js
31736
31737function font(value) {
31738 var _FONT$value;
31739 return (_FONT$value = font_values_default[value]) !== null && _FONT$value !== void 0 ? _FONT$value : "";
31740}
31741
31742
31743;// ./node_modules/@wordpress/components/build-module/utils/box-sizing.js
31744function box_sizing_EMOTION_STRINGIFIED_CSS_ERROR_() {
31745 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
31746}
31747
31748const boxSizingReset = true ? {
31749 name: "kv6lnz",
31750 styles: "box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"
31751} : 0;
31752
31753
31754;// ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js
31755
31756function base_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
31757 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
31758}
31759
31760
31761
31762const Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
31763 target: "ej5x27r4"
31764} : 0)("font-family:", font("default.fontFamily"), ";font-size:", font("default.fontSize"), ";", boxSizingReset, ";" + ( true ? "" : 0));
31765const deprecatedMarginField = ({
31766 __nextHasNoMarginBottom = false
31767}) => {
31768 return !__nextHasNoMarginBottom && /* @__PURE__ */ emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0);
31769};
31770const StyledField = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
31771 target: "ej5x27r3"
31772} : 0)(deprecatedMarginField, " .components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : 0));
31773const labelStyles = /* @__PURE__ */ emotion_react_browser_esm_css(baseLabelTypography, ";display:block;margin-bottom:", space(2), ";padding:0;" + ( true ? "" : 0), true ? "" : 0);
31774const StyledLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("label", true ? {
31775 target: "ej5x27r2"
31776} : 0)(labelStyles, ";" + ( true ? "" : 0));
31777var base_control_styles_ref = true ? {
31778 name: "11yad0w",
31779 styles: "margin-bottom:revert"
31780} : 0;
31781const deprecatedMarginHelp = ({
31782 __nextHasNoMarginBottom = false
31783}) => {
31784 return !__nextHasNoMarginBottom && base_control_styles_ref;
31785};
31786const StyledHelp = /* @__PURE__ */ emotion_styled_base_browser_esm("p", true ? {
31787 target: "ej5x27r1"
31788} : 0)("margin-top:", space(2), ";margin-bottom:0;font-size:", font("helpText.fontSize"), ";font-style:normal;color:", COLORS.gray[700], ";", deprecatedMarginHelp, ";" + ( true ? "" : 0));
31789const StyledVisualLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
31790 target: "ej5x27r0"
31791} : 0)(labelStyles, ";" + ( true ? "" : 0));
31792
31793
31794;// ./node_modules/@wordpress/components/build-module/base-control/index.js
31795
31796
31797
31798
31799
31800
31801
31802
31803const UnconnectedBaseControl = (props) => {
31804 const {
31805 __nextHasNoMarginBottom = false,
31806 __associatedWPComponentName = "BaseControl",
31807 id,
31808 label,
31809 hideLabelFromVision = false,
31810 help,
31811 className,
31812 children
31813 } = useContextSystem(props, "BaseControl");
31814 if (!__nextHasNoMarginBottom) {
31815 external_wp_deprecated_default()(`Bottom margin styles for wp.components.${__associatedWPComponentName}`, {
31816 since: "6.7",
31817 version: "7.0",
31818 hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
31819 });
31820 }
31821 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
31822 className,
31823 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(StyledField, {
31824 className: "components-base-control__field",
31825 __nextHasNoMarginBottom,
31826 children: [label && id && (hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
31827 as: "label",
31828 htmlFor: id,
31829 children: label
31830 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
31831 className: "components-base-control__label",
31832 htmlFor: id,
31833 children: label
31834 })), label && !id && (hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
31835 as: "label",
31836 children: label
31837 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabel, {
31838 children: label
31839 })), children]
31840 }), !!help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
31841 id: id ? id + "__help" : void 0,
31842 className: "components-base-control__help",
31843 __nextHasNoMarginBottom,
31844 children: help
31845 })]
31846 });
31847};
31848const UnforwardedVisualLabel = (props, ref) => {
31849 const {
31850 className,
31851 children,
31852 ...restProps
31853 } = props;
31854 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledVisualLabel, {
31855 ref,
31856 ...restProps,
31857 className: dist_clsx("components-base-control__label", className),
31858 children
31859 });
31860};
31861const VisualLabel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedVisualLabel);
31862const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, "BaseControl"), {
31863 /**
31864 * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
31865 *
31866 * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,
31867 * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would
31868 * otherwise use if the `label` prop was passed.
31869 *
31870 * ```jsx
31871 * import { BaseControl } from '@wordpress/components';
31872 *
31873 * const MyBaseControl = () => (
31874 * <BaseControl
31875 * __nextHasNoMarginBottom
31876 * help="This button is already accessibly labeled."
31877 * >
31878 * <BaseControl.VisualLabel>Author</BaseControl.VisualLabel>
31879 * <Button>Select an author</Button>
31880 * </BaseControl>
31881 * );
31882 * ```
31883 */
31884 VisualLabel
31885});
31886var base_control_default = BaseControl;
31887
31888
31889;// ./node_modules/@wordpress/components/build-module/utils/deprecated-36px-size.js
31890
31891function maybeWarnDeprecated36pxSize({
31892 componentName,
31893 __next40pxDefaultSize,
31894 size,
31895 __shouldNotWarnDeprecated36pxSize
31896}) {
31897 if (__shouldNotWarnDeprecated36pxSize || __next40pxDefaultSize || size !== void 0 && size !== "default") {
31898 return;
31899 }
31900 external_wp_deprecated_default()(`36px default size for wp.components.${componentName}`, {
31901 since: "6.8",
31902 version: "7.1",
31903 hint: "Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."
31904 });
31905}
31906
31907
31908;// ./node_modules/@wordpress/components/build-module/input-control/index.js
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920const input_control_noop = () => {
31921};
31922function input_control_useUniqueId(idProp) {
31923 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputControl);
31924 const id = `inspector-input-control-${instanceId}`;
31925 return idProp || id;
31926}
31927function UnforwardedInputControl(props, ref) {
31928 const {
31929 __next40pxDefaultSize,
31930 __shouldNotWarnDeprecated36pxSize,
31931 __unstableStateReducer: stateReducer = (state) => state,
31932 __unstableInputWidth,
31933 className,
31934 disabled = false,
31935 help,
31936 hideLabelFromVision = false,
31937 id: idProp,
31938 isPressEnterToChange = false,
31939 label,
31940 labelPosition = "top",
31941 onChange = input_control_noop,
31942 onValidate = input_control_noop,
31943 onKeyDown = input_control_noop,
31944 prefix,
31945 size = "default",
31946 style,
31947 suffix,
31948 value,
31949 ...restProps
31950 } = useDeprecated36pxDefaultSizeProp(props);
31951 const id = input_control_useUniqueId(idProp);
31952 const classes = dist_clsx("components-input-control", className);
31953 const draftHookProps = useDraft({
31954 value,
31955 onBlur: restProps.onBlur,
31956 onChange
31957 });
31958 const helpProp = !!help ? {
31959 "aria-describedby": `${id}__help`
31960 } : {};
31961 maybeWarnDeprecated36pxSize({
31962 componentName: "InputControl",
31963 __next40pxDefaultSize,
31964 size,
31965 __shouldNotWarnDeprecated36pxSize
31966 });
31967 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
31968 className: classes,
31969 help,
31970 id,
31971 __nextHasNoMarginBottom: true,
31972 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_base_default, {
31973 __next40pxDefaultSize,
31974 __unstableInputWidth,
31975 disabled,
31976 gap: 3,
31977 hideLabelFromVision,
31978 id,
31979 justify: "left",
31980 label,
31981 labelPosition,
31982 prefix,
31983 size,
31984 style,
31985 suffix,
31986 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_field_default, {
31987 ...restProps,
31988 ...helpProp,
31989 __next40pxDefaultSize,
31990 className: "components-input-control__input",
31991 disabled,
31992 id,
31993 isPressEnterToChange,
31994 onKeyDown,
31995 onValidate,
31996 paddingInlineStart: prefix ? space(1) : void 0,
31997 paddingInlineEnd: suffix ? space(1) : void 0,
31998 ref,
31999 size,
32000 stateReducer,
32001 ...draftHookProps
32002 })
32003 })
32004 });
32005}
32006const InputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedInputControl);
32007var input_control_default = InputControl;
32008
32009
32010;// ./node_modules/@wordpress/components/build-module/dashicon/index.js
32011
32012function Dashicon({
32013 icon,
32014 className,
32015 size = 20,
32016 style = {},
32017 ...extraProps
32018}) {
32019 const iconClass = ["dashicon", "dashicons", "dashicons-" + icon, className].filter(Boolean).join(" ");
32020 const sizeStyles = (
32021 // using `!=` to catch both 20 and "20"
32022 // eslint-disable-next-line eqeqeq
32023 20 != size ? {
32024 fontSize: `${size}px`,
32025 width: `${size}px`,
32026 height: `${size}px`
32027 } : {}
32028 );
32029 const styles = {
32030 ...sizeStyles,
32031 ...style
32032 };
32033 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
32034 className: iconClass,
32035 style: styles,
32036 ...extraProps
32037 });
32038}
32039var dashicon_default = Dashicon;
32040
32041
32042;// ./node_modules/@wordpress/components/build-module/icon/index.js
32043
32044
32045
32046
32047function Icon({
32048 icon = null,
32049 size = "string" === typeof icon ? 20 : 24,
32050 ...additionalProps
32051}) {
32052 if ("string" === typeof icon) {
32053 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dashicon_default, {
32054 icon,
32055 size,
32056 ...additionalProps
32057 });
32058 }
32059 if ((0,external_wp_element_namespaceObject.isValidElement)(icon) && dashicon_default === icon.type) {
32060 return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
32061 ...additionalProps
32062 });
32063 }
32064 if ("function" === typeof icon) {
32065 return (0,external_wp_element_namespaceObject.createElement)(icon, {
32066 size,
32067 ...additionalProps
32068 });
32069 }
32070 if (icon && (icon.type === "svg" || icon.type === external_wp_primitives_namespaceObject.SVG)) {
32071 const appliedProps = {
32072 ...icon.props,
32073 width: size,
32074 height: size,
32075 ...additionalProps
32076 };
32077 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
32078 ...appliedProps
32079 });
32080 }
32081 if ((0,external_wp_element_namespaceObject.isValidElement)(icon)) {
32082 return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
32083 // @ts-ignore Just forwarding the size prop along
32084 size,
32085 width: size,
32086 height: size,
32087 ...additionalProps
32088 });
32089 }
32090 return icon;
32091}
32092var icon_icon_default = Icon;
32093
32094
32095;// ./node_modules/@wordpress/components/build-module/button/index.js
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105const disabledEventsOnDisabledButton = ["onMouseDown", "onClick"];
32106function button_useDeprecatedProps({
32107 __experimentalIsFocusable,
32108 isDefault,
32109 isPrimary,
32110 isSecondary,
32111 isTertiary,
32112 isLink,
32113 isPressed,
32114 isSmall,
32115 size,
32116 variant,
32117 describedBy,
32118 ...otherProps
32119}) {
32120 let computedSize = size;
32121 let computedVariant = variant;
32122 const newProps = {
32123 accessibleWhenDisabled: __experimentalIsFocusable,
32124 // @todo Mark `isPressed` as deprecated
32125 "aria-pressed": isPressed,
32126 description: describedBy
32127 };
32128 if (isSmall) {
32129 var _computedSize;
32130 (_computedSize = computedSize) !== null && _computedSize !== void 0 ? _computedSize : computedSize = "small";
32131 }
32132 if (isPrimary) {
32133 var _computedVariant;
32134 (_computedVariant = computedVariant) !== null && _computedVariant !== void 0 ? _computedVariant : computedVariant = "primary";
32135 }
32136 if (isTertiary) {
32137 var _computedVariant2;
32138 (_computedVariant2 = computedVariant) !== null && _computedVariant2 !== void 0 ? _computedVariant2 : computedVariant = "tertiary";
32139 }
32140 if (isSecondary) {
32141 var _computedVariant3;
32142 (_computedVariant3 = computedVariant) !== null && _computedVariant3 !== void 0 ? _computedVariant3 : computedVariant = "secondary";
32143 }
32144 if (isDefault) {
32145 var _computedVariant4;
32146 external_wp_deprecated_default()("wp.components.Button `isDefault` prop", {
32147 since: "5.4",
32148 alternative: 'variant="secondary"'
32149 });
32150 (_computedVariant4 = computedVariant) !== null && _computedVariant4 !== void 0 ? _computedVariant4 : computedVariant = "secondary";
32151 }
32152 if (isLink) {
32153 var _computedVariant5;
32154 (_computedVariant5 = computedVariant) !== null && _computedVariant5 !== void 0 ? _computedVariant5 : computedVariant = "link";
32155 }
32156 return {
32157 ...newProps,
32158 ...otherProps,
32159 size: computedSize,
32160 variant: computedVariant
32161 };
32162}
32163function UnforwardedButton(props, ref) {
32164 const {
32165 __next40pxDefaultSize,
32166 accessibleWhenDisabled,
32167 isBusy,
32168 isDestructive,
32169 className,
32170 disabled,
32171 icon,
32172 iconPosition = "left",
32173 iconSize,
32174 showTooltip,
32175 tooltipPosition,
32176 shortcut,
32177 label,
32178 children,
32179 size = "default",
32180 text,
32181 variant,
32182 description,
32183 ...buttonOrAnchorProps
32184 } = button_useDeprecatedProps(props);
32185 const {
32186 href,
32187 target,
32188 "aria-checked": ariaChecked,
32189 "aria-pressed": ariaPressed,
32190 "aria-selected": ariaSelected,
32191 ...additionalProps
32192 } = "href" in buttonOrAnchorProps ? buttonOrAnchorProps : {
32193 href: void 0,
32194 target: void 0,
32195 ...buttonOrAnchorProps
32196 };
32197 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Button, "components-button__description");
32198 const hasChildren = "string" === typeof children && !!children || Array.isArray(children) && children?.[0] && children[0] !== null && // Tooltip should not considered as a child
32199 children?.[0]?.props?.className !== "components-tooltip";
32200 const truthyAriaPressedValues = [true, "true", "mixed"];
32201 const classes = dist_clsx("components-button", className, {
32202 "is-next-40px-default-size": __next40pxDefaultSize,
32203 "is-secondary": variant === "secondary",
32204 "is-primary": variant === "primary",
32205 "is-small": size === "small",
32206 "is-compact": size === "compact",
32207 "is-tertiary": variant === "tertiary",
32208 "is-pressed": truthyAriaPressedValues.includes(ariaPressed),
32209 "is-pressed-mixed": ariaPressed === "mixed",
32210 "is-busy": isBusy,
32211 "is-link": variant === "link",
32212 "is-destructive": isDestructive,
32213 "has-text": !!icon && (hasChildren || text),
32214 "has-icon": !!icon,
32215 "has-icon-right": iconPosition === "right"
32216 });
32217 const trulyDisabled = disabled && !accessibleWhenDisabled;
32218 const Tag = href !== void 0 && !disabled ? "a" : "button";
32219 const buttonProps = Tag === "button" ? {
32220 type: "button",
32221 disabled: trulyDisabled,
32222 "aria-checked": ariaChecked,
32223 "aria-pressed": ariaPressed,
32224 "aria-selected": ariaSelected
32225 } : {};
32226 const anchorProps = Tag === "a" ? {
32227 href,
32228 target
32229 } : {};
32230 const disableEventProps = {};
32231 if (disabled && accessibleWhenDisabled) {
32232 buttonProps["aria-disabled"] = true;
32233 anchorProps["aria-disabled"] = true;
32234 for (const disabledEvent of disabledEventsOnDisabledButton) {
32235 disableEventProps[disabledEvent] = (event) => {
32236 if (event) {
32237 event.stopPropagation();
32238 event.preventDefault();
32239 }
32240 };
32241 }
32242 }
32243 const shouldShowTooltip = !trulyDisabled && // An explicit tooltip is passed or...
32244 (showTooltip && !!label || // There's a shortcut or...
32245 !!shortcut || // There's a label and...
32246 !!label && // The children are empty and...
32247 !children?.length && // The tooltip is not explicitly disabled.
32248 false !== showTooltip);
32249 const descriptionId = description ? instanceId : void 0;
32250 const describedById = additionalProps["aria-describedby"] || descriptionId;
32251 const commonProps = {
32252 className: classes,
32253 "aria-label": additionalProps["aria-label"] || label,
32254 "aria-describedby": describedById,
32255 ref
32256 };
32257 const elementChildren = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32258 children: [icon && iconPosition === "left" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
32259 icon,
32260 size: iconSize
32261 }), text && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32262 children: text
32263 }), children, icon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
32264 icon,
32265 size: iconSize
32266 })]
32267 });
32268 const element = Tag === "a" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
32269 ...anchorProps,
32270 ...additionalProps,
32271 ...disableEventProps,
32272 ...commonProps,
32273 children: elementChildren
32274 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
32275 ...buttonProps,
32276 ...additionalProps,
32277 ...disableEventProps,
32278 ...commonProps,
32279 children: elementChildren
32280 });
32281 const tooltipProps = shouldShowTooltip ? {
32282 text: children?.length && description ? description : label,
32283 shortcut,
32284 placement: tooltipPosition && // Convert legacy `position` values to be used with the new `placement` prop
32285 positionToPlacement(tooltipPosition)
32286 } : {};
32287 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32288 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
32289 ...tooltipProps,
32290 children: element
32291 }), description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
32292 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
32293 id: descriptionId,
32294 children: description
32295 })
32296 })]
32297 });
32298}
32299const Button = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButton);
32300var button_default = Button;
32301
32302
32303;// ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js
32304
32305function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
32306 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
32307}
32308
32309
32310
32311
32312
32313var number_control_styles_ref = true ? {
32314 name: "euqsgg",
32315 styles: "input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"
32316} : 0;
32317const htmlArrowStyles = ({
32318 hideHTMLArrows
32319}) => {
32320 if (!hideHTMLArrows) {
32321 return ``;
32322 }
32323 return number_control_styles_ref;
32324};
32325const number_control_styles_Input = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
32326 target: "ep09it41"
32327} : 0)(htmlArrowStyles, ";" + ( true ? "" : 0));
32328const SpinButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
32329 target: "ep09it40"
32330} : 0)("&&&&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0));
32331const smallSpinButtons = /* @__PURE__ */ emotion_react_browser_esm_css("width:", space(5), ";min-width:", space(5), ";height:", space(5), ";" + ( true ? "" : 0), true ? "" : 0);
32332const styles = {
32333 smallSpinButtons
32334};
32335
32336
32337;// ./node_modules/@wordpress/components/build-module/utils/math.js
32338function getNumber(value) {
32339 const number = Number(value);
32340 return isNaN(number) ? 0 : number;
32341}
32342function add(...args) {
32343 return args.reduce(
32344 /** @type {(sum:number, arg: number|string) => number} */
32345 (sum, arg) => sum + getNumber(arg),
32346 0
32347 );
32348}
32349function subtract(...args) {
32350 return args.reduce(
32351 /** @type {(diff:number, arg: number|string, index:number) => number} */
32352 (diff, arg, index) => {
32353 const value = getNumber(arg);
32354 return index === 0 ? value : diff - value;
32355 },
32356 0
32357 );
32358}
32359function getPrecision(value) {
32360 const split = (value + "").split(".");
32361 return split[1] !== void 0 ? split[1].length : 0;
32362}
32363function math_clamp(value, min, max) {
32364 const baseValue = getNumber(value);
32365 return Math.max(min, Math.min(baseValue, max));
32366}
32367function ensureValidStep(value, min, step) {
32368 const baseValue = getNumber(value);
32369 const minValue = getNumber(min);
32370 const stepValue = getNumber(step);
32371 const precision = Math.max(getPrecision(step), getPrecision(min));
32372 const tare = minValue % stepValue ? minValue : 0;
32373 const rounded = Math.round((baseValue - tare) / stepValue) * stepValue;
32374 const fromMin = rounded + tare;
32375 return precision ? getNumber(fromMin.toFixed(precision)) : fromMin;
32376}
32377
32378
32379;// ./node_modules/@wordpress/components/build-module/h-stack/utils.js
32380
32381const H_ALIGNMENTS = {
32382 bottom: {
32383 align: "flex-end",
32384 justify: "center"
32385 },
32386 bottomLeft: {
32387 align: "flex-end",
32388 justify: "flex-start"
32389 },
32390 bottomRight: {
32391 align: "flex-end",
32392 justify: "flex-end"
32393 },
32394 center: {
32395 align: "center",
32396 justify: "center"
32397 },
32398 edge: {
32399 align: "center",
32400 justify: "space-between"
32401 },
32402 left: {
32403 align: "center",
32404 justify: "flex-start"
32405 },
32406 right: {
32407 align: "center",
32408 justify: "flex-end"
32409 },
32410 stretch: {
32411 align: "stretch"
32412 },
32413 top: {
32414 align: "flex-start",
32415 justify: "center"
32416 },
32417 topLeft: {
32418 align: "flex-start",
32419 justify: "flex-start"
32420 },
32421 topRight: {
32422 align: "flex-start",
32423 justify: "flex-end"
32424 }
32425};
32426const V_ALIGNMENTS = {
32427 bottom: {
32428 justify: "flex-end",
32429 align: "center"
32430 },
32431 bottomLeft: {
32432 justify: "flex-end",
32433 align: "flex-start"
32434 },
32435 bottomRight: {
32436 justify: "flex-end",
32437 align: "flex-end"
32438 },
32439 center: {
32440 justify: "center",
32441 align: "center"
32442 },
32443 edge: {
32444 justify: "space-between",
32445 align: "center"
32446 },
32447 left: {
32448 justify: "center",
32449 align: "flex-start"
32450 },
32451 right: {
32452 justify: "center",
32453 align: "flex-end"
32454 },
32455 stretch: {
32456 align: "stretch"
32457 },
32458 top: {
32459 justify: "flex-start",
32460 align: "center"
32461 },
32462 topLeft: {
32463 justify: "flex-start",
32464 align: "flex-start"
32465 },
32466 topRight: {
32467 justify: "flex-start",
32468 align: "flex-end"
32469 }
32470};
32471function getAlignmentProps(alignment, direction = "row") {
32472 if (!isValueDefined(alignment)) {
32473 return {};
32474 }
32475 const isVertical = direction === "column";
32476 const props = isVertical ? V_ALIGNMENTS : H_ALIGNMENTS;
32477 const alignmentProps = alignment in props ? props[alignment] : {
32478 align: alignment
32479 };
32480 return alignmentProps;
32481}
32482
32483
32484;// ./node_modules/@wordpress/components/build-module/utils/get-valid-children.js
32485
32486function getValidChildren(children) {
32487 if (typeof children === "string") {
32488 return [children];
32489 }
32490 return external_wp_element_namespaceObject.Children.toArray(children).filter((child) => (0,external_wp_element_namespaceObject.isValidElement)(child));
32491}
32492
32493
32494;// ./node_modules/@wordpress/components/build-module/h-stack/hook.js
32495
32496
32497
32498
32499
32500function useHStack(props) {
32501 const {
32502 alignment = "edge",
32503 children,
32504 direction,
32505 spacing = 2,
32506 ...otherProps
32507 } = useContextSystem(props, "HStack");
32508 const align = getAlignmentProps(alignment, direction);
32509 const validChildren = getValidChildren(children);
32510 const clonedChildren = validChildren.map((child, index) => {
32511 const _isSpacer = hasConnectNamespace(child, ["Spacer"]);
32512 if (_isSpacer) {
32513 const childElement = child;
32514 const _key = childElement.key || `hstack-${index}`;
32515 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
32516 isBlock: true,
32517 ...childElement.props
32518 }, _key);
32519 }
32520 return child;
32521 });
32522 const propsForFlex = {
32523 children: clonedChildren,
32524 direction,
32525 justify: "center",
32526 ...align,
32527 ...otherProps,
32528 gap: spacing
32529 };
32530 const {
32531 isColumn,
32532 ...flexProps
32533 } = useFlex(propsForFlex);
32534 return flexProps;
32535}
32536
32537
32538;// ./node_modules/@wordpress/components/build-module/h-stack/component.js
32539
32540
32541
32542
32543function UnconnectedHStack(props, forwardedRef) {
32544 const hStackProps = useHStack(props);
32545 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
32546 ...hStackProps,
32547 ref: forwardedRef
32548 });
32549}
32550const HStack = contextConnect(UnconnectedHStack, "HStack");
32551var h_stack_component_component_default = HStack;
32552
32553
32554;// ./node_modules/@wordpress/components/build-module/number-control/index.js
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571const number_control_noop = () => {
32572};
32573function UnforwardedNumberControl(props, forwardedRef) {
32574 const {
32575 __unstableStateReducer: stateReducerProp,
32576 className,
32577 dragDirection = "n",
32578 hideHTMLArrows = false,
32579 spinControls = hideHTMLArrows ? "none" : "native",
32580 isDragEnabled = true,
32581 isShiftStepEnabled = true,
32582 label,
32583 max = Infinity,
32584 min = -Infinity,
32585 required = false,
32586 shiftStep = 10,
32587 step = 1,
32588 spinFactor = 1,
32589 type: typeProp = "number",
32590 value: valueProp,
32591 size = "default",
32592 suffix,
32593 onChange = number_control_noop,
32594 __shouldNotWarnDeprecated36pxSize,
32595 ...restProps
32596 } = useDeprecated36pxDefaultSizeProp(props);
32597 maybeWarnDeprecated36pxSize({
32598 componentName: "NumberControl",
32599 size,
32600 __next40pxDefaultSize: restProps.__next40pxDefaultSize,
32601 __shouldNotWarnDeprecated36pxSize
32602 });
32603 if (hideHTMLArrows) {
32604 external_wp_deprecated_default()("wp.components.NumberControl hideHTMLArrows prop ", {
32605 alternative: 'spinControls="none"',
32606 since: "6.2",
32607 version: "6.3"
32608 });
32609 }
32610 const inputRef = (0,external_wp_element_namespaceObject.useRef)();
32611 const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]);
32612 const isStepAny = step === "any";
32613 const baseStep = isStepAny ? 1 : ensureNumber(step);
32614 const baseSpin = ensureNumber(spinFactor) * baseStep;
32615 const constrainValue = (value, stepOverride) => {
32616 if (!isStepAny) {
32617 value = ensureValidStep(value, min, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
32618 }
32619 return `${math_clamp(value, min, max)}`;
32620 };
32621 const baseValue = constrainValue(0);
32622 const autoComplete = typeProp === "number" ? "off" : void 0;
32623 const classes = dist_clsx("components-number-control", className);
32624 const cx = useCx();
32625 const spinButtonClasses = cx(size === "small" && styles.smallSpinButtons);
32626 const spinValue = (value, direction, event) => {
32627 event?.preventDefault();
32628 const shift = event?.shiftKey && isShiftStepEnabled;
32629 const delta = shift ? ensureNumber(shiftStep) * baseSpin : baseSpin;
32630 let nextValue = isValueEmpty(value) ? baseValue : value;
32631 if (direction === "up") {
32632 nextValue = add(nextValue, delta);
32633 } else if (direction === "down") {
32634 nextValue = subtract(nextValue, delta);
32635 }
32636 return constrainValue(nextValue, shift ? delta : void 0);
32637 };
32638 const numberControlStateReducer = (state, action) => {
32639 const nextState = {
32640 ...state
32641 };
32642 const {
32643 type,
32644 payload
32645 } = action;
32646 const event = payload.event;
32647 const currentValue = nextState.value;
32648 if (type === PRESS_UP || type === PRESS_DOWN) {
32649 nextState.value = spinValue(currentValue, type === PRESS_UP ? "up" : "down", event);
32650 }
32651 if (type === DRAG && isDragEnabled) {
32652 const [x, y] = payload.delta;
32653 const enableShift = payload.shiftKey && isShiftStepEnabled;
32654 const modifier = enableShift ? ensureNumber(shiftStep) * baseSpin : baseSpin;
32655 let directionModifier;
32656 let delta;
32657 switch (dragDirection) {
32658 case "n":
32659 delta = y;
32660 directionModifier = -1;
32661 break;
32662 case "e":
32663 delta = x;
32664 directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1;
32665 break;
32666 case "s":
32667 delta = y;
32668 directionModifier = 1;
32669 break;
32670 case "w":
32671 delta = x;
32672 directionModifier = (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1;
32673 break;
32674 }
32675 if (delta !== 0) {
32676 delta = Math.ceil(Math.abs(delta)) * Math.sign(delta);
32677 const distance = delta * modifier * directionModifier;
32678 nextState.value = constrainValue(
32679 // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
32680 add(currentValue, distance),
32681 enableShift ? modifier : void 0
32682 );
32683 }
32684 }
32685 if (type === PRESS_ENTER || type === COMMIT) {
32686 const applyEmptyValue = required === false && currentValue === "";
32687 nextState.value = applyEmptyValue ? currentValue : (
32688 // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
32689 constrainValue(currentValue)
32690 );
32691 }
32692 return nextState;
32693 };
32694 const buildSpinButtonClickHandler = (direction) => (event) => onChange(String(spinValue(valueProp, direction, event)), {
32695 // Set event.target to the <input> so that consumers can use
32696 // e.g. event.target.validity.
32697 event: {
32698 ...event,
32699 target: inputRef.current
32700 }
32701 });
32702 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_styles_Input, {
32703 autoComplete,
32704 inputMode: "numeric",
32705 ...restProps,
32706 className: classes,
32707 dragDirection,
32708 hideHTMLArrows: spinControls !== "native",
32709 isDragEnabled,
32710 label,
32711 max: max === Infinity ? void 0 : max,
32712 min: min === -Infinity ? void 0 : min,
32713 ref: mergedRef,
32714 required,
32715 step,
32716 type: typeProp,
32717 value: valueProp,
32718 __unstableStateReducer: (state, action) => {
32719 var _stateReducerProp;
32720 const baseState = numberControlStateReducer(state, action);
32721 return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;
32722 },
32723 size,
32724 __shouldNotWarnDeprecated36pxSize: true,
32725 suffix: spinControls === "custom" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32726 children: [suffix, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
32727 marginBottom: 0,
32728 marginRight: 2,
32729 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
32730 spacing: 1,
32731 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, {
32732 className: spinButtonClasses,
32733 icon: plus_default,
32734 size: "small",
32735 label: (0,external_wp_i18n_namespaceObject.__)("Increment"),
32736 onClick: buildSpinButtonClickHandler("up")
32737 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinButton, {
32738 className: spinButtonClasses,
32739 icon: reset_default,
32740 size: "small",
32741 label: (0,external_wp_i18n_namespaceObject.__)("Decrement"),
32742 onClick: buildSpinButtonClickHandler("down")
32743 })]
32744 })
32745 })]
32746 }) : suffix,
32747 onChange
32748 });
32749}
32750const NumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNumberControl);
32751var number_control_default = NumberControl;
32752
32753
32754;// ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js
32755
32756function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
32757 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
32758}
32759
32760
32761
32762
32763const CIRCLE_SIZE = 32;
32764const INNER_CIRCLE_SIZE = 6;
32765const CircleRoot = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
32766 target: "eln3bjz3"
32767} : 0)("border-radius:", config_values_default.radiusRound, ";border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;:active{cursor:grabbing;}" + ( true ? "" : 0));
32768const CircleIndicatorWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
32769 target: "eln3bjz2"
32770} : 0)( true ? {
32771 name: "1r307gh",
32772 styles: "box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"
32773} : 0);
32774const CircleIndicator = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
32775 target: "eln3bjz1"
32776} : 0)("background:", COLORS.theme.accent, ";border-radius:", config_values_default.radiusRound, ";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:", INNER_CIRCLE_SIZE, "px;height:", INNER_CIRCLE_SIZE, "px;" + ( true ? "" : 0));
32777const UnitText = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
32778 target: "eln3bjz0"
32779} : 0)("color:", COLORS.theme.accent, ";margin-right:", space(3), ";" + ( true ? "" : 0));
32780
32781
32782;// ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js
32783
32784
32785
32786
32787function AngleCircle({
32788 value,
32789 onChange,
32790 ...props
32791}) {
32792 const angleCircleRef = (0,external_wp_element_namespaceObject.useRef)(null);
32793 const angleCircleCenterRef = (0,external_wp_element_namespaceObject.useRef)();
32794 const previousCursorValueRef = (0,external_wp_element_namespaceObject.useRef)();
32795 const setAngleCircleCenter = () => {
32796 if (angleCircleRef.current === null) {
32797 return;
32798 }
32799 const rect = angleCircleRef.current.getBoundingClientRect();
32800 angleCircleCenterRef.current = {
32801 x: rect.x + rect.width / 2,
32802 y: rect.y + rect.height / 2
32803 };
32804 };
32805 const changeAngleToPosition = (event) => {
32806 if (event === void 0) {
32807 return;
32808 }
32809 event.preventDefault();
32810 event.target?.focus();
32811 if (angleCircleCenterRef.current !== void 0 && onChange !== void 0) {
32812 const {
32813 x: centerX,
32814 y: centerY
32815 } = angleCircleCenterRef.current;
32816 onChange(getAngle(centerX, centerY, event.clientX, event.clientY));
32817 }
32818 };
32819 const {
32820 startDrag,
32821 isDragging
32822 } = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({
32823 onDragStart: (event) => {
32824 setAngleCircleCenter();
32825 changeAngleToPosition(event);
32826 },
32827 onDragMove: changeAngleToPosition,
32828 onDragEnd: changeAngleToPosition
32829 });
32830 (0,external_wp_element_namespaceObject.useEffect)(() => {
32831 if (isDragging) {
32832 if (previousCursorValueRef.current === void 0) {
32833 previousCursorValueRef.current = document.body.style.cursor;
32834 }
32835 document.body.style.cursor = "grabbing";
32836 } else {
32837 document.body.style.cursor = previousCursorValueRef.current || "";
32838 previousCursorValueRef.current = void 0;
32839 }
32840 }, [isDragging]);
32841 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleRoot, {
32842 ref: angleCircleRef,
32843 onMouseDown: startDrag,
32844 className: "components-angle-picker-control__angle-circle",
32845 ...props,
32846 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicatorWrapper, {
32847 style: value ? {
32848 transform: `rotate(${value}deg)`
32849 } : void 0,
32850 className: "components-angle-picker-control__angle-circle-indicator-wrapper",
32851 tabIndex: -1,
32852 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CircleIndicator, {
32853 className: "components-angle-picker-control__angle-circle-indicator"
32854 })
32855 })
32856 });
32857}
32858function getAngle(centerX, centerY, pointX, pointY) {
32859 const y = pointY - centerY;
32860 const x = pointX - centerX;
32861 const angleInRadians = Math.atan2(y, x);
32862 const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90;
32863 if (angleInDeg < 0) {
32864 return 360 + angleInDeg;
32865 }
32866 return angleInDeg;
32867}
32868var angle_circle_default = AngleCircle;
32869
32870
32871;// ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881function UnforwardedAnglePickerControl(props, ref) {
32882 const {
32883 className,
32884 label = (0,external_wp_i18n_namespaceObject.__)("Angle"),
32885 onChange,
32886 value,
32887 ...restProps
32888 } = props;
32889 const handleOnNumberChange = (unprocessedValue) => {
32890 if (onChange === void 0) {
32891 return;
32892 }
32893 const inputValue = unprocessedValue !== void 0 && unprocessedValue !== "" ? parseInt(unprocessedValue, 10) : 0;
32894 onChange(inputValue);
32895 };
32896 const classes = dist_clsx("components-angle-picker-control", className);
32897 const unitText = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitText, {
32898 children: "\xB0"
32899 });
32900 const [prefixedUnitText, suffixedUnitText] = (0,external_wp_i18n_namespaceObject.isRTL)() ? [unitText, null] : [null, unitText];
32901 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
32902 ...restProps,
32903 ref,
32904 className: classes,
32905 gap: 2,
32906 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
32907 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_default, {
32908 __next40pxDefaultSize: true,
32909 label,
32910 className: "components-angle-picker-control__input-field",
32911 max: 360,
32912 min: 0,
32913 onChange: handleOnNumberChange,
32914 step: "1",
32915 value,
32916 spinControls: "none",
32917 prefix: prefixedUnitText,
32918 suffix: suffixedUnitText
32919 })
32920 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
32921 marginBottom: "1",
32922 marginTop: "auto",
32923 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(angle_circle_default, {
32924 "aria-hidden": "true",
32925 value,
32926 onChange
32927 })
32928 })]
32929 });
32930}
32931const AnglePickerControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedAnglePickerControl);
32932var angle_picker_control_default = AnglePickerControl;
32933
32934
32935// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
32936var remove_accents = __webpack_require__(9681);
32937var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
32938;// external ["wp","richText"]
32939const external_wp_richText_namespaceObject = window["wp"]["richText"];
32940;// external ["wp","a11y"]
32941const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
32942;// external ["wp","keycodes"]
32943const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
32944;// ./node_modules/@wordpress/components/build-module/utils/strings.js
32945
32946
32947const ALL_UNICODE_DASH_CHARACTERS = new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu);
32948const normalizeTextString = (value) => {
32949 return remove_accents_default()(value).normalize("NFKC").toLocaleLowerCase().replace(ALL_UNICODE_DASH_CHARACTERS, "-");
32950};
32951function kebabCase(str) {
32952 var _str$toString;
32953 let input = (_str$toString = str?.toString?.()) !== null && _str$toString !== void 0 ? _str$toString : "";
32954 input = input.replace(/['\u2019]/, "");
32955 return paramCase(input, {
32956 splitRegexp: [
32957 /(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,
32958 // fooBar => foo-bar, 3Bar => 3-bar
32959 /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,
32960 // 3bar => 3-bar
32961 /([A-Za-z])([0-9])/g,
32962 // Foo3 => foo-3, foo3 => foo-3
32963 /([A-Z])([A-Z][a-z])/g
32964 // FOOBar => foo-bar
32965 ]
32966 });
32967}
32968function escapeRegExp(string) {
32969 return string.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
32970}
32971
32972
32973;// ./node_modules/@wordpress/components/build-module/autocomplete/get-default-use-items.js
32974
32975
32976
32977
32978function filterOptions(search, options = [], maxResults = 10) {
32979 const filtered = [];
32980 for (let i = 0; i < options.length; i++) {
32981 const option = options[i];
32982 let {
32983 keywords = []
32984 } = option;
32985 if ("string" === typeof option.label) {
32986 keywords = [...keywords, option.label];
32987 }
32988 const isMatch = keywords.some((keyword) => search.test(remove_accents_default()(keyword)));
32989 if (!isMatch) {
32990 continue;
32991 }
32992 filtered.push(option);
32993 if (filtered.length === maxResults) {
32994 break;
32995 }
32996 }
32997 return filtered;
32998}
32999function getDefaultUseItems(autocompleter) {
33000 return (filterValue) => {
33001 const [items, setItems] = (0,external_wp_element_namespaceObject.useState)([]);
33002 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33003 const {
33004 options,
33005 isDebounced
33006 } = autocompleter;
33007 const loadOptions = (0,external_wp_compose_namespaceObject.debounce)(() => {
33008 const promise2 = Promise.resolve(typeof options === "function" ? options(filterValue) : options).then((optionsData) => {
33009 if (promise2.canceled) {
33010 return;
33011 }
33012 const keyedOptions = optionsData.map((optionData, optionIndex) => ({
33013 key: `${autocompleter.name}-${optionIndex}`,
33014 value: optionData,
33015 label: autocompleter.getOptionLabel(optionData),
33016 keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [],
33017 isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false
33018 }));
33019 const search = new RegExp("(?:\\b|\\s|^)" + escapeRegExp(filterValue), "i");
33020 setItems(filterOptions(search, keyedOptions));
33021 });
33022 return promise2;
33023 }, isDebounced ? 250 : 0);
33024 const promise = loadOptions();
33025 return () => {
33026 loadOptions.cancel();
33027 if (promise) {
33028 promise.canceled = true;
33029 }
33030 };
33031 }, [filterValue]);
33032 return [items];
33033 };
33034}
33035
33036
33037;// ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
33038
33039
33040
33041
33042
33043
33044/**
33045 * Provides data to position an inner element of the floating element so that it
33046 * appears centered to the reference element.
33047 * This wraps the core `arrow` middleware to allow React refs as the element.
33048 * @see https://floating-ui.com/docs/arrow
33049 */
33050const floating_ui_react_dom_arrow = options => {
33051 function isRef(value) {
33052 return {}.hasOwnProperty.call(value, 'current');
33053 }
33054 return {
33055 name: 'arrow',
33056 options,
33057 fn(state) {
33058 const {
33059 element,
33060 padding
33061 } = typeof options === 'function' ? options(state) : options;
33062 if (element && isRef(element)) {
33063 if (element.current != null) {
33064 return floating_ui_dom_arrow({
33065 element: element.current,
33066 padding
33067 }).fn(state);
33068 }
33069 return {};
33070 }
33071 if (element) {
33072 return floating_ui_dom_arrow({
33073 element,
33074 padding
33075 }).fn(state);
33076 }
33077 return {};
33078 }
33079 };
33080};
33081
33082var index = typeof document !== 'undefined' ? external_React_.useLayoutEffect : external_React_.useEffect;
33083
33084// Fork of `fast-deep-equal` that only does the comparisons we need and compares
33085// functions
33086function deepEqual(a, b) {
33087 if (a === b) {
33088 return true;
33089 }
33090 if (typeof a !== typeof b) {
33091 return false;
33092 }
33093 if (typeof a === 'function' && a.toString() === b.toString()) {
33094 return true;
33095 }
33096 let length;
33097 let i;
33098 let keys;
33099 if (a && b && typeof a === 'object') {
33100 if (Array.isArray(a)) {
33101 length = a.length;
33102 if (length !== b.length) return false;
33103 for (i = length; i-- !== 0;) {
33104 if (!deepEqual(a[i], b[i])) {
33105 return false;
33106 }
33107 }
33108 return true;
33109 }
33110 keys = Object.keys(a);
33111 length = keys.length;
33112 if (length !== Object.keys(b).length) {
33113 return false;
33114 }
33115 for (i = length; i-- !== 0;) {
33116 if (!{}.hasOwnProperty.call(b, keys[i])) {
33117 return false;
33118 }
33119 }
33120 for (i = length; i-- !== 0;) {
33121 const key = keys[i];
33122 if (key === '_owner' && a.$$typeof) {
33123 continue;
33124 }
33125 if (!deepEqual(a[key], b[key])) {
33126 return false;
33127 }
33128 }
33129 return true;
33130 }
33131
33132 // biome-ignore lint/suspicious/noSelfCompare: in source
33133 return a !== a && b !== b;
33134}
33135
33136function getDPR(element) {
33137 if (typeof window === 'undefined') {
33138 return 1;
33139 }
33140 const win = element.ownerDocument.defaultView || window;
33141 return win.devicePixelRatio || 1;
33142}
33143
33144function floating_ui_react_dom_roundByDPR(element, value) {
33145 const dpr = getDPR(element);
33146 return Math.round(value * dpr) / dpr;
33147}
33148
33149function useLatestRef(value) {
33150 const ref = external_React_.useRef(value);
33151 index(() => {
33152 ref.current = value;
33153 });
33154 return ref;
33155}
33156
33157/**
33158 * Provides data to position a floating element.
33159 * @see https://floating-ui.com/docs/useFloating
33160 */
33161function useFloating(options) {
33162 if (options === void 0) {
33163 options = {};
33164 }
33165 const {
33166 placement = 'bottom',
33167 strategy = 'absolute',
33168 middleware = [],
33169 platform,
33170 elements: {
33171 reference: externalReference,
33172 floating: externalFloating
33173 } = {},
33174 transform = true,
33175 whileElementsMounted,
33176 open
33177 } = options;
33178 const [data, setData] = external_React_.useState({
33179 x: 0,
33180 y: 0,
33181 strategy,
33182 placement,
33183 middlewareData: {},
33184 isPositioned: false
33185 });
33186 const [latestMiddleware, setLatestMiddleware] = external_React_.useState(middleware);
33187 if (!deepEqual(latestMiddleware, middleware)) {
33188 setLatestMiddleware(middleware);
33189 }
33190 const [_reference, _setReference] = external_React_.useState(null);
33191 const [_floating, _setFloating] = external_React_.useState(null);
33192 const setReference = external_React_.useCallback(node => {
33193 if (node !== referenceRef.current) {
33194 referenceRef.current = node;
33195 _setReference(node);
33196 }
33197 }, []);
33198 const setFloating = external_React_.useCallback(node => {
33199 if (node !== floatingRef.current) {
33200 floatingRef.current = node;
33201 _setFloating(node);
33202 }
33203 }, []);
33204 const referenceEl = externalReference || _reference;
33205 const floatingEl = externalFloating || _floating;
33206 const referenceRef = external_React_.useRef(null);
33207 const floatingRef = external_React_.useRef(null);
33208 const dataRef = external_React_.useRef(data);
33209 const hasWhileElementsMounted = whileElementsMounted != null;
33210 const whileElementsMountedRef = useLatestRef(whileElementsMounted);
33211 const platformRef = useLatestRef(platform);
33212 const update = external_React_.useCallback(() => {
33213 if (!referenceRef.current || !floatingRef.current) {
33214 return;
33215 }
33216 const config = {
33217 placement,
33218 strategy,
33219 middleware: latestMiddleware
33220 };
33221 if (platformRef.current) {
33222 config.platform = platformRef.current;
33223 }
33224 floating_ui_dom_computePosition(referenceRef.current, floatingRef.current, config).then(data => {
33225 const fullData = {
33226 ...data,
33227 isPositioned: true
33228 };
33229 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
33230 dataRef.current = fullData;
33231 external_ReactDOM_namespaceObject.flushSync(() => {
33232 setData(fullData);
33233 });
33234 }
33235 });
33236 }, [latestMiddleware, placement, strategy, platformRef]);
33237 index(() => {
33238 if (open === false && dataRef.current.isPositioned) {
33239 dataRef.current.isPositioned = false;
33240 setData(data => ({
33241 ...data,
33242 isPositioned: false
33243 }));
33244 }
33245 }, [open]);
33246 const isMountedRef = external_React_.useRef(false);
33247 index(() => {
33248 isMountedRef.current = true;
33249 return () => {
33250 isMountedRef.current = false;
33251 };
33252 }, []);
33253
33254 // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included.
33255 index(() => {
33256 if (referenceEl) referenceRef.current = referenceEl;
33257 if (floatingEl) floatingRef.current = floatingEl;
33258 if (referenceEl && floatingEl) {
33259 if (whileElementsMountedRef.current) {
33260 return whileElementsMountedRef.current(referenceEl, floatingEl, update);
33261 }
33262 update();
33263 }
33264 }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
33265 const refs = external_React_.useMemo(() => ({
33266 reference: referenceRef,
33267 floating: floatingRef,
33268 setReference,
33269 setFloating
33270 }), [setReference, setFloating]);
33271 const elements = external_React_.useMemo(() => ({
33272 reference: referenceEl,
33273 floating: floatingEl
33274 }), [referenceEl, floatingEl]);
33275 const floatingStyles = external_React_.useMemo(() => {
33276 const initialStyles = {
33277 position: strategy,
33278 left: 0,
33279 top: 0
33280 };
33281 if (!elements.floating) {
33282 return initialStyles;
33283 }
33284 const x = floating_ui_react_dom_roundByDPR(elements.floating, data.x);
33285 const y = floating_ui_react_dom_roundByDPR(elements.floating, data.y);
33286 if (transform) {
33287 return {
33288 ...initialStyles,
33289 transform: "translate(" + x + "px, " + y + "px)",
33290 ...(getDPR(elements.floating) >= 1.5 && {
33291 willChange: 'transform'
33292 })
33293 };
33294 }
33295 return {
33296 position: strategy,
33297 left: x,
33298 top: y
33299 };
33300 }, [strategy, transform, elements.floating, data.x, data.y]);
33301 return external_React_.useMemo(() => ({
33302 ...data,
33303 update,
33304 refs,
33305 elements,
33306 floatingStyles
33307 }), [data, update, refs, elements, floatingStyles]);
33308}
33309
33310
33311
33312;// ./node_modules/@wordpress/icons/build-module/library/close.js
33313
33314
33315var close_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
33316
33317
33318;// ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
33319
33320let previousScrollTop = 0;
33321function setLocked(locked) {
33322 const scrollingElement = document.scrollingElement || document.body;
33323 if (locked) {
33324 previousScrollTop = scrollingElement.scrollTop;
33325 }
33326 const methodName = locked ? "add" : "remove";
33327 scrollingElement.classList[methodName]("lockscroll");
33328 document.documentElement.classList[methodName]("lockscroll");
33329 if (!locked) {
33330 scrollingElement.scrollTop = previousScrollTop;
33331 }
33332}
33333let lockCounter = 0;
33334function ScrollLock() {
33335 (0,external_wp_element_namespaceObject.useEffect)(() => {
33336 if (lockCounter === 0) {
33337 setLocked(true);
33338 }
33339 ++lockCounter;
33340 return () => {
33341 if (lockCounter === 1) {
33342 setLocked(false);
33343 }
33344 --lockCounter;
33345 };
33346 }, []);
33347 return null;
33348}
33349var scroll_lock_default = ScrollLock;
33350
33351
33352;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
33353
33354
33355
33356const initialContextValue = {
33357 slots: (0,external_wp_compose_namespaceObject.observableMap)(),
33358 fills: (0,external_wp_compose_namespaceObject.observableMap)(),
33359 registerSlot: () => {
33360 true ? external_wp_warning_default()("Components must be wrapped within `SlotFillProvider`. See https://developer.wordpress.org/block-editor/components/slot-fill/") : 0;
33361 },
33362 updateSlot: () => {
33363 },
33364 unregisterSlot: () => {
33365 },
33366 registerFill: () => {
33367 },
33368 unregisterFill: () => {
33369 },
33370 // This helps the provider know if it's using the default context value or not.
33371 isDefault: true
33372};
33373const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialContextValue);
33374SlotFillContext.displayName = "SlotFillContext";
33375var slot_fill_context_default = SlotFillContext;
33376
33377
33378;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
33379
33380
33381
33382function useSlot(name) {
33383 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
33384 const slot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
33385 return {
33386 ...slot
33387 };
33388}
33389
33390
33391;// ./node_modules/@wordpress/components/build-module/slot-fill/context.js
33392
33393
33394const initialValue = {
33395 slots: (0,external_wp_compose_namespaceObject.observableMap)(),
33396 fills: (0,external_wp_compose_namespaceObject.observableMap)(),
33397 registerSlot: () => {
33398 },
33399 unregisterSlot: () => {
33400 },
33401 registerFill: () => {
33402 },
33403 unregisterFill: () => {
33404 },
33405 updateFill: () => {
33406 }
33407};
33408const context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialValue);
33409context_SlotFillContext.displayName = "SlotFillContext";
33410var context_default = context_SlotFillContext;
33411
33412
33413;// ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
33414
33415
33416function Fill({
33417 name,
33418 children
33419}) {
33420 const registry = (0,external_wp_element_namespaceObject.useContext)(context_default);
33421 const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
33422 const childrenRef = (0,external_wp_element_namespaceObject.useRef)(children);
33423 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33424 childrenRef.current = children;
33425 }, [children]);
33426 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33427 const instance = instanceRef.current;
33428 registry.registerFill(name, instance, childrenRef.current);
33429 return () => registry.unregisterFill(name, instance);
33430 }, [registry, name]);
33431 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33432 registry.updateFill(name, instanceRef.current, childrenRef.current);
33433 });
33434 return null;
33435}
33436
33437
33438;// ./node_modules/@wordpress/components/build-module/slot-fill/slot.js
33439
33440
33441
33442
33443function isFunction(maybeFunc) {
33444 return typeof maybeFunc === "function";
33445}
33446function addKeysToChildren(children) {
33447 return external_wp_element_namespaceObject.Children.map(children, (child, childIndex) => {
33448 if (!child || typeof child === "string") {
33449 return child;
33450 }
33451 let childKey = childIndex;
33452 if (typeof child === "object" && "key" in child && child?.key) {
33453 childKey = child.key;
33454 }
33455 return (0,external_wp_element_namespaceObject.cloneElement)(child, {
33456 key: childKey
33457 });
33458 });
33459}
33460function Slot(props) {
33461 var _useObservableValue;
33462 const registry = (0,external_wp_element_namespaceObject.useContext)(context_default);
33463 const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
33464 const {
33465 name,
33466 children,
33467 fillProps = {}
33468 } = props;
33469 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33470 const instance = instanceRef.current;
33471 registry.registerSlot(name, instance);
33472 return () => registry.unregisterSlot(name, instance);
33473 }, [registry, name]);
33474 let fills = (_useObservableValue = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.fills, name)) !== null && _useObservableValue !== void 0 ? _useObservableValue : [];
33475 const currentSlot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
33476 if (currentSlot !== instanceRef.current) {
33477 fills = [];
33478 }
33479 const renderedFills = fills.map((fill) => {
33480 const fillChildren = isFunction(fill.children) ? fill.children(fillProps) : fill.children;
33481 return addKeysToChildren(fillChildren);
33482 }).filter(
33483 // In some cases fills are rendered only when some conditions apply.
33484 // This ensures that we only use non-empty fills when rendering, i.e.,
33485 // it allows us to render wrappers only when the fills are actually present.
33486 (element) => !(0,external_wp_element_namespaceObject.isEmptyElement)(element)
33487 );
33488 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33489 children: isFunction(children) ? children(renderedFills) : renderedFills
33490 });
33491}
33492var slot_default = Slot;
33493
33494
33495;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/native.js
33496const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
33497/* harmony default export */ const esm_browser_native = ({
33498 randomUUID
33499});
33500;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/rng.js
33501// Unique ID creation requires a high quality random # generator. In the browser we therefore
33502// require the crypto API and do not support built-in fallback to lower quality random number
33503// generators (like Math.random()).
33504let getRandomValues;
33505const rnds8 = new Uint8Array(16);
33506function rng() {
33507 // lazy load so that environments that need to polyfill have a chance to do so
33508 if (!getRandomValues) {
33509 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
33510 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
33511
33512 if (!getRandomValues) {
33513 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
33514 }
33515 }
33516
33517 return getRandomValues(rnds8);
33518}
33519;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/stringify.js
33520
33521/**
33522 * Convert array of 16 byte values to UUID string format of the form:
33523 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
33524 */
33525
33526const byteToHex = [];
33527
33528for (let i = 0; i < 256; ++i) {
33529 byteToHex.push((i + 0x100).toString(16).slice(1));
33530}
33531
33532function unsafeStringify(arr, offset = 0) {
33533 // Note: Be careful editing this code! It's been tuned for performance
33534 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
33535 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
33536}
33537
33538function stringify_stringify(arr, offset = 0) {
33539 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
33540 // of the following:
33541 // - One or more input array values don't map to a hex octet (leading to
33542 // "undefined" in the uuid)
33543 // - Invalid input values for the RFC `version` or `variant` fields
33544
33545 if (!validate(uuid)) {
33546 throw TypeError('Stringified UUID is invalid');
33547 }
33548
33549 return uuid;
33550}
33551
33552/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify_stringify)));
33553;// ./node_modules/@wordpress/components/node_modules/uuid/dist/esm-browser/v4.js
33554
33555
33556
33557
33558function v4(options, buf, offset) {
33559 if (esm_browser_native.randomUUID && !buf && !options) {
33560 return esm_browser_native.randomUUID();
33561 }
33562
33563 options = options || {};
33564 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
33565
33566 rnds[6] = rnds[6] & 0x0f | 0x40;
33567 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
33568
33569 if (buf) {
33570 offset = offset || 0;
33571
33572 for (let i = 0; i < 16; ++i) {
33573 buf[offset + i] = rnds[i];
33574 }
33575
33576 return buf;
33577 }
33578
33579 return unsafeStringify(rnds);
33580}
33581
33582/* harmony default export */ const esm_browser_v4 = (v4);
33583;// ./node_modules/@wordpress/components/build-module/style-provider/index.js
33584
33585
33586
33587
33588const uuidCache = /* @__PURE__ */ new Set();
33589const containerCacheMap = /* @__PURE__ */ new WeakMap();
33590const memoizedCreateCacheWithContainer = (container) => {
33591 if (containerCacheMap.has(container)) {
33592 return containerCacheMap.get(container);
33593 }
33594 let key = esm_browser_v4().replace(/[0-9]/g, "");
33595 while (uuidCache.has(key)) {
33596 key = esm_browser_v4().replace(/[0-9]/g, "");
33597 }
33598 uuidCache.add(key);
33599 const cache = emotion_cache_browser_esm({
33600 container,
33601 key
33602 });
33603 containerCacheMap.set(container, cache);
33604 return cache;
33605};
33606function StyleProvider(props) {
33607 const {
33608 children,
33609 document
33610 } = props;
33611 if (!document) {
33612 return null;
33613 }
33614 const cache = memoizedCreateCacheWithContainer(document.head);
33615 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CacheProvider, {
33616 value: cache,
33617 children
33618 });
33619}
33620var style_provider_default = StyleProvider;
33621
33622
33623;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
33624
33625
33626
33627
33628
33629function fill_Fill({
33630 name,
33631 children
33632}) {
33633 var _slot$fillProps;
33634 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
33635 const slot = (0,external_wp_compose_namespaceObject.useObservableValue)(registry.slots, name);
33636 const instanceRef = (0,external_wp_element_namespaceObject.useRef)({});
33637 (0,external_wp_element_namespaceObject.useEffect)(() => {
33638 const instance = instanceRef.current;
33639 registry.registerFill(name, instance);
33640 return () => registry.unregisterFill(name, instance);
33641 }, [registry, name]);
33642 if (!slot || !slot.ref.current) {
33643 return null;
33644 }
33645 const wrappedChildren = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider_default, {
33646 document: slot.ref.current.ownerDocument,
33647 children: typeof children === "function" ? children((_slot$fillProps = slot.fillProps) !== null && _slot$fillProps !== void 0 ? _slot$fillProps : {}) : children
33648 });
33649 return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current);
33650}
33651
33652
33653;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
33654
33655
33656
33657
33658
33659function slot_Slot(props, forwardedRef) {
33660 const {
33661 name,
33662 fillProps = {},
33663 as,
33664 // `children` is not allowed. However, if it is passed,
33665 // it will be displayed as is, so remove `children`.
33666 children,
33667 ...restProps
33668 } = props;
33669 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
33670 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
33671 const fillPropsRef = (0,external_wp_element_namespaceObject.useRef)(fillProps);
33672 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33673 fillPropsRef.current = fillProps;
33674 }, [fillProps]);
33675 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33676 registry.registerSlot(name, ref, fillPropsRef.current);
33677 return () => registry.unregisterSlot(name, ref);
33678 }, [registry, name]);
33679 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
33680 registry.updateSlot(name, ref, fillPropsRef.current);
33681 });
33682 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
33683 as,
33684 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]),
33685 ...restProps
33686 });
33687}
33688var slot_slot_default = (0,external_wp_element_namespaceObject.forwardRef)(slot_Slot);
33689
33690
33691;// external ["wp","isShallowEqual"]
33692const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
33693var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
33694;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
33695
33696
33697
33698
33699
33700function createSlotRegistry() {
33701 const slots = (0,external_wp_compose_namespaceObject.observableMap)();
33702 const fills = (0,external_wp_compose_namespaceObject.observableMap)();
33703 const registerSlot = (name, ref, fillProps) => {
33704 slots.set(name, {
33705 ref,
33706 fillProps
33707 });
33708 };
33709 const unregisterSlot = (name, ref) => {
33710 const slot = slots.get(name);
33711 if (!slot) {
33712 return;
33713 }
33714 if (slot.ref !== ref) {
33715 return;
33716 }
33717 slots.delete(name);
33718 };
33719 const updateSlot = (name, ref, fillProps) => {
33720 const slot = slots.get(name);
33721 if (!slot) {
33722 return;
33723 }
33724 if (slot.ref !== ref) {
33725 return;
33726 }
33727 if (external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) {
33728 return;
33729 }
33730 slots.set(name, {
33731 ref,
33732 fillProps
33733 });
33734 };
33735 const registerFill = (name, ref) => {
33736 fills.set(name, [...fills.get(name) || [], ref]);
33737 };
33738 const unregisterFill = (name, ref) => {
33739 const fillsForName = fills.get(name);
33740 if (!fillsForName) {
33741 return;
33742 }
33743 fills.set(name, fillsForName.filter((fillRef) => fillRef !== ref));
33744 };
33745 return {
33746 slots,
33747 fills,
33748 registerSlot,
33749 updateSlot,
33750 unregisterSlot,
33751 registerFill,
33752 unregisterFill
33753 };
33754}
33755function SlotFillProvider({
33756 children
33757}) {
33758 const [registry] = (0,external_wp_element_namespaceObject.useState)(createSlotRegistry);
33759 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_context_default.Provider, {
33760 value: registry,
33761 children
33762 });
33763}
33764
33765
33766;// ./node_modules/@wordpress/components/build-module/slot-fill/provider.js
33767
33768
33769
33770
33771function provider_createSlotRegistry() {
33772 const slots = (0,external_wp_compose_namespaceObject.observableMap)();
33773 const fills = (0,external_wp_compose_namespaceObject.observableMap)();
33774 function registerSlot(name, instance) {
33775 slots.set(name, instance);
33776 }
33777 function unregisterSlot(name, instance) {
33778 if (slots.get(name) !== instance) {
33779 return;
33780 }
33781 slots.delete(name);
33782 }
33783 function registerFill(name, instance, children) {
33784 fills.set(name, [...fills.get(name) || [], {
33785 instance,
33786 children
33787 }]);
33788 }
33789 function unregisterFill(name, instance) {
33790 const fillsForName = fills.get(name);
33791 if (!fillsForName) {
33792 return;
33793 }
33794 fills.set(name, fillsForName.filter((fill) => fill.instance !== instance));
33795 }
33796 function updateFill(name, instance, children) {
33797 const fillsForName = fills.get(name);
33798 if (!fillsForName) {
33799 return;
33800 }
33801 const fillForInstance = fillsForName.find((f) => f.instance === instance);
33802 if (!fillForInstance) {
33803 return;
33804 }
33805 if (fillForInstance.children === children) {
33806 return;
33807 }
33808 fills.set(name, fillsForName.map((f) => {
33809 if (f.instance === instance) {
33810 return {
33811 instance,
33812 children
33813 };
33814 }
33815 return f;
33816 }));
33817 }
33818 return {
33819 slots,
33820 fills,
33821 registerSlot,
33822 unregisterSlot,
33823 registerFill,
33824 unregisterFill,
33825 updateFill
33826 };
33827}
33828function provider_SlotFillProvider({
33829 children
33830}) {
33831 const [contextValue] = (0,external_wp_element_namespaceObject.useState)(provider_createSlotRegistry);
33832 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_default.Provider, {
33833 value: contextValue,
33834 children
33835 });
33836}
33837var provider_default = provider_SlotFillProvider;
33838
33839
33840;// ./node_modules/@wordpress/components/build-module/slot-fill/index.js
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852function slot_fill_Fill(props) {
33853 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33854 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
33855 ...props
33856 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(fill_Fill, {
33857 ...props
33858 })]
33859 });
33860}
33861function UnforwardedSlot(props, ref) {
33862 const {
33863 bubblesVirtually,
33864 ...restProps
33865 } = props;
33866 if (bubblesVirtually) {
33867 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_slot_default, {
33868 ...restProps,
33869 ref
33870 });
33871 }
33872 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_default, {
33873 ...restProps
33874 });
33875}
33876const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSlot);
33877function Provider({
33878 children,
33879 passthrough = false
33880}) {
33881 const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
33882 if (!parent.isDefault && passthrough) {
33883 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33884 children
33885 });
33886 }
33887 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(provider_default, {
33888 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SlotFillProvider, {
33889 children
33890 })
33891 });
33892}
33893Provider.displayName = "SlotFillProvider";
33894function createSlotFill(key) {
33895 const baseName = typeof key === "symbol" ? key.description : key;
33896 const FillComponent = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, {
33897 name: key,
33898 ...props
33899 });
33900 FillComponent.displayName = `${baseName}Fill`;
33901 const SlotComponent = (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, {
33902 name: key,
33903 ...props
33904 });
33905 SlotComponent.displayName = `${baseName}Slot`;
33906 SlotComponent.__unstableName = key;
33907 return {
33908 name: key,
33909 Fill: FillComponent,
33910 Slot: SlotComponent
33911 };
33912}
33913
33914
33915;// ./node_modules/@wordpress/components/build-module/popover/overlay-middlewares.js
33916
33917function overlayMiddlewares() {
33918 return [{
33919 name: "overlay",
33920 fn({
33921 rects
33922 }) {
33923 return rects.reference;
33924 }
33925 }, floating_ui_dom_size({
33926 apply({
33927 rects,
33928 elements
33929 }) {
33930 var _elements$floating;
33931 const {
33932 firstElementChild
33933 } = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};
33934 if (!(firstElementChild instanceof HTMLElement)) {
33935 return;
33936 }
33937 Object.assign(firstElementChild.style, {
33938 width: `${rects.reference.width}px`,
33939 height: `${rects.reference.height}px`
33940 });
33941 }
33942 })];
33943}
33944
33945
33946;// ./node_modules/@wordpress/components/build-module/popover/index.js
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964const SLOT_NAME = "Popover";
33965const OVERFLOW_PADDING = 8;
33966const ArrowTriangle = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
33967 xmlns: "http://www.w3.org/2000/svg",
33968 viewBox: "0 0 100 100",
33969 className: "components-popover__triangle",
33970 role: "presentation",
33971 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
33972 className: "components-popover__triangle-bg",
33973 d: "M 0 0 L 50 50 L 100 0"
33974 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
33975 className: "components-popover__triangle-border",
33976 d: "M 0 0 L 50 50 L 100 0",
33977 vectorEffect: "non-scaling-stroke"
33978 })]
33979});
33980const slotNameContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
33981slotNameContext.displayName = "__unstableSlotNameContext";
33982const fallbackContainerClassname = "components-popover__fallback-container";
33983const getPopoverFallbackContainer = () => {
33984 let container = document.body.querySelector("." + fallbackContainerClassname);
33985 if (!container) {
33986 container = document.createElement("div");
33987 container.className = fallbackContainerClassname;
33988 document.body.append(container);
33989 }
33990 return container;
33991};
33992const UnforwardedPopover = (props, forwardedRef) => {
33993 const {
33994 animate = true,
33995 headerTitle,
33996 constrainTabbing,
33997 onClose,
33998 children,
33999 className,
34000 noArrow = true,
34001 position,
34002 placement: placementProp = "bottom-start",
34003 offset: offsetProp = 0,
34004 focusOnMount = "firstElement",
34005 anchor,
34006 expandOnMobile,
34007 onFocusOutside,
34008 __unstableSlotName = SLOT_NAME,
34009 flip = true,
34010 resize = true,
34011 shift = false,
34012 inline = false,
34013 variant,
34014 style: contentStyle,
34015 // Deprecated props
34016 __unstableForcePosition,
34017 anchorRef,
34018 anchorRect,
34019 getAnchorRect,
34020 isAlternate,
34021 // Rest
34022 ...contentProps
34023 } = useContextSystem(props, "Popover");
34024 let computedFlipProp = flip;
34025 let computedResizeProp = resize;
34026 if (__unstableForcePosition !== void 0) {
34027 external_wp_deprecated_default()("`__unstableForcePosition` prop in wp.components.Popover", {
34028 since: "6.1",
34029 version: "6.3",
34030 alternative: "`flip={ false }` and `resize={ false }`"
34031 });
34032 computedFlipProp = !__unstableForcePosition;
34033 computedResizeProp = !__unstableForcePosition;
34034 }
34035 if (anchorRef !== void 0) {
34036 external_wp_deprecated_default()("`anchorRef` prop in wp.components.Popover", {
34037 since: "6.1",
34038 alternative: "`anchor` prop"
34039 });
34040 }
34041 if (anchorRect !== void 0) {
34042 external_wp_deprecated_default()("`anchorRect` prop in wp.components.Popover", {
34043 since: "6.1",
34044 alternative: "`anchor` prop"
34045 });
34046 }
34047 if (getAnchorRect !== void 0) {
34048 external_wp_deprecated_default()("`getAnchorRect` prop in wp.components.Popover", {
34049 since: "6.1",
34050 alternative: "`anchor` prop"
34051 });
34052 }
34053 const computedVariant = isAlternate ? "toolbar" : variant;
34054 if (isAlternate !== void 0) {
34055 external_wp_deprecated_default()("`isAlternate` prop in wp.components.Popover", {
34056 since: "6.2",
34057 alternative: "`variant` prop with the `'toolbar'` value"
34058 });
34059 }
34060 const arrowRef = (0,external_wp_element_namespaceObject.useRef)(null);
34061 const [fallbackReferenceElement, setFallbackReferenceElement] = (0,external_wp_element_namespaceObject.useState)(null);
34062 const anchorRefFallback = (0,external_wp_element_namespaceObject.useCallback)((node) => {
34063 setFallbackReferenceElement(node);
34064 }, []);
34065 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
34066 const isExpanded = expandOnMobile && isMobileViewport;
34067 const hasArrow = !isExpanded && !noArrow;
34068 const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp;
34069 const middleware = [...placementProp === "overlay" ? overlayMiddlewares() : [], offset(offsetProp), computedFlipProp && floating_ui_dom_flip(), computedResizeProp && floating_ui_dom_size({
34070 padding: OVERFLOW_PADDING,
34071 apply(sizeProps) {
34072 var _refs$floating$curren;
34073 const {
34074 firstElementChild
34075 } = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {};
34076 if (!(firstElementChild instanceof HTMLElement)) {
34077 return;
34078 }
34079 Object.assign(firstElementChild.style, {
34080 maxHeight: `${Math.max(0, sizeProps.availableHeight)}px`,
34081 overflow: "auto"
34082 });
34083 }
34084 }), shift && floating_ui_dom_shift({
34085 crossAxis: true,
34086 limiter: floating_ui_dom_limitShift(),
34087 padding: 1
34088 // Necessary to avoid flickering at the edge of the viewport.
34089 }), floating_ui_react_dom_arrow({
34090 element: arrowRef
34091 })];
34092 const slotName = (0,external_wp_element_namespaceObject.useContext)(slotNameContext) || __unstableSlotName;
34093 const slot = useSlot(slotName);
34094 let onDialogClose;
34095 if (onClose || onFocusOutside) {
34096 onDialogClose = (type, event) => {
34097 if (type === "focus-outside") {
34098 const blurTarget = event?.target;
34099 const referenceElement = refs.reference.current;
34100 const floatingElement = refs.floating.current;
34101 const isBlurFromThisPopover = referenceElement && "contains" in referenceElement && referenceElement.contains(blurTarget) || floatingElement?.contains(blurTarget);
34102 const ownerDocument = floatingElement?.ownerDocument;
34103 if (!isBlurFromThisPopover && !("relatedTarget" in event && event.relatedTarget) && ownerDocument?.activeElement === ownerDocument?.body) {
34104 return;
34105 }
34106 if (onFocusOutside) {
34107 onFocusOutside(event);
34108 } else if (onClose) {
34109 onClose();
34110 }
34111 } else if (onClose) {
34112 onClose();
34113 }
34114 };
34115 }
34116 const [dialogRef, dialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
34117 constrainTabbing,
34118 focusOnMount,
34119 __unstableOnClose: onDialogClose,
34120 // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)
34121 onClose: onDialogClose
34122 });
34123 const {
34124 // Positioning coordinates
34125 x,
34126 y,
34127 // Object with "regular" refs to both "reference" and "floating"
34128 refs,
34129 // Type of CSS position property to use (absolute or fixed)
34130 strategy,
34131 update,
34132 placement: computedPlacement,
34133 middlewareData: {
34134 arrow: arrowData
34135 }
34136 } = useFloating({
34137 placement: normalizedPlacementFromProps === "overlay" ? void 0 : normalizedPlacementFromProps,
34138 middleware,
34139 whileElementsMounted: (referenceParam, floatingParam, updateParam) => autoUpdate(referenceParam, floatingParam, updateParam, {
34140 layoutShift: false,
34141 animationFrame: true
34142 })
34143 });
34144 const arrowCallbackRef = (0,external_wp_element_namespaceObject.useCallback)((node) => {
34145 arrowRef.current = node;
34146 update();
34147 }, [update]);
34148 const anchorRefTop = anchorRef?.top;
34149 const anchorRefBottom = anchorRef?.bottom;
34150 const anchorRefStartContainer = anchorRef?.startContainer;
34151 const anchorRefCurrent = anchorRef?.current;
34152 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
34153 const resultingReferenceElement = getReferenceElement({
34154 anchor,
34155 anchorRef,
34156 anchorRect,
34157 getAnchorRect,
34158 fallbackReferenceElement
34159 });
34160 refs.setReference(resultingReferenceElement);
34161 }, [anchor, anchorRef, anchorRefTop, anchorRefBottom, anchorRefStartContainer, anchorRefCurrent, anchorRect, getAnchorRect, fallbackReferenceElement, refs]);
34162 const mergedFloatingRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([refs.setFloating, dialogRef, forwardedRef]);
34163 const style = isExpanded ? void 0 : {
34164 position: strategy,
34165 top: 0,
34166 left: 0,
34167 // `x` and `y` are framer-motion specific props and are shorthands
34168 // for `translateX` and `translateY`. Currently it is not possible
34169 // to use `translateX` and `translateY` because those values would
34170 // be overridden by the return value of the
34171 // `placementToMotionAnimationProps` function.
34172 x: computePopoverPosition(x),
34173 y: computePopoverPosition(y)
34174 };
34175 const shouldReduceMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
34176 const shouldAnimate = animate && !isExpanded && !shouldReduceMotion;
34177 const [animationFinished, setAnimationFinished] = (0,external_wp_element_namespaceObject.useState)(false);
34178 const {
34179 style: motionInlineStyles,
34180 ...otherMotionProps
34181 } = (0,external_wp_element_namespaceObject.useMemo)(() => placementToMotionAnimationProps(computedPlacement), [computedPlacement]);
34182 const animationProps = shouldAnimate ? {
34183 style: {
34184 ...contentStyle,
34185 ...motionInlineStyles,
34186 ...style
34187 },
34188 onAnimationComplete: () => setAnimationFinished(true),
34189 ...otherMotionProps
34190 } : {
34191 animate: false,
34192 style: {
34193 ...contentStyle,
34194 ...style
34195 }
34196 };
34197 const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null;
34198 let content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(motion.div, {
34199 className: dist_clsx(className, {
34200 "is-expanded": isExpanded,
34201 "is-positioned": isPositioned,
34202 // Use the 'alternate' classname for 'toolbar' variant for back compat.
34203 [`is-${computedVariant === "toolbar" ? "alternate" : computedVariant}`]: computedVariant
34204 }),
34205 ...animationProps,
34206 ...contentProps,
34207 ref: mergedFloatingRef,
34208 ...dialogProps,
34209 tabIndex: -1,
34210 children: [isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scroll_lock_default, {}), isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
34211 className: "components-popover__header",
34212 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
34213 className: "components-popover__header-title",
34214 children: headerTitle
34215 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
34216 className: "components-popover__close",
34217 size: "small",
34218 icon: close_default,
34219 onClick: onClose,
34220 label: (0,external_wp_i18n_namespaceObject.__)("Close")
34221 })]
34222 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
34223 className: "components-popover__content",
34224 children
34225 }), hasArrow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
34226 ref: arrowCallbackRef,
34227 className: ["components-popover__arrow", `is-${computedPlacement.split("-")[0]}`].join(" "),
34228 style: {
34229 left: typeof arrowData?.x !== "undefined" && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : "",
34230 top: typeof arrowData?.y !== "undefined" && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : ""
34231 },
34232 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ArrowTriangle, {})
34233 })]
34234 });
34235 const shouldRenderWithinSlot = slot.ref && !inline;
34236 const hasAnchor = anchorRef || anchorRect || anchor;
34237 if (shouldRenderWithinSlot) {
34238 content = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, {
34239 name: slotName,
34240 children: content
34241 });
34242 } else if (!inline) {
34243 content = (0,external_wp_element_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleProvider, {
34244 document,
34245 children: content
34246 }), getPopoverFallbackContainer());
34247 }
34248 if (hasAnchor) {
34249 return content;
34250 }
34251 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
34252 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
34253 ref: anchorRefFallback
34254 }), content]
34255 });
34256};
34257const PopoverSlot = (0,external_wp_element_namespaceObject.forwardRef)(({
34258 name = SLOT_NAME
34259}, ref) => {
34260 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, {
34261 bubblesVirtually: true,
34262 name,
34263 className: "popover-slot",
34264 ref
34265 });
34266});
34267const popover_Popover = Object.assign(contextConnect(UnforwardedPopover, "Popover"), {
34268 /**
34269 * Renders a slot that is used internally by Popover for rendering content.
34270 */
34271 Slot: Object.assign(PopoverSlot, {
34272 displayName: "Popover.Slot"
34273 }),
34274 /**
34275 * Provides a context to manage popover slot names.
34276 *
34277 * This is marked as unstable and should not be used directly.
34278 */
34279 __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {
34280 displayName: "Popover.__unstableSlotNameProvider"
34281 })
34282});
34283var popover_default = popover_Popover;
34284
34285
34286;// ./node_modules/@wordpress/components/build-module/autocomplete/autocompleter-ui.js
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299function ListBox({
34300 items,
34301 onSelect,
34302 selectedIndex,
34303 instanceId,
34304 listBoxId,
34305 className,
34306 Component = "div"
34307}) {
34308 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
34309 id: listBoxId,
34310 role: "listbox",
34311 className: "components-autocomplete__results",
34312 children: items.map((option, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
34313 id: `components-autocomplete-item-${instanceId}-${option.key}`,
34314 role: "option",
34315 __next40pxDefaultSize: true,
34316 "aria-selected": index === selectedIndex,
34317 accessibleWhenDisabled: true,
34318 disabled: option.isDisabled,
34319 className: dist_clsx("components-autocomplete__result", className, {
34320 // Unused, for backwards compatibility.
34321 "is-selected": index === selectedIndex
34322 }),
34323 variant: index === selectedIndex ? "primary" : void 0,
34324 onClick: () => onSelect(option),
34325 children: option.label
34326 }, option.key))
34327 });
34328}
34329function getAutoCompleterUI(autocompleter) {
34330 var _autocompleter$useIte;
34331 const useItems = (_autocompleter$useIte = autocompleter.useItems) !== null && _autocompleter$useIte !== void 0 ? _autocompleter$useIte : getDefaultUseItems(autocompleter);
34332 function AutocompleterUI({
34333 filterValue,
34334 instanceId,
34335 listBoxId,
34336 className,
34337 selectedIndex,
34338 onChangeOptions,
34339 onSelect,
34340 onReset,
34341 reset,
34342 contentRef
34343 }) {
34344 const [items] = useItems(filterValue);
34345 const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
34346 editableContentElement: contentRef.current
34347 });
34348 const [needsA11yCompat, setNeedsA11yCompat] = (0,external_wp_element_namespaceObject.useState)(false);
34349 const popoverRef = (0,external_wp_element_namespaceObject.useRef)(null);
34350 const popoverRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([popoverRef, (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
34351 if (!contentRef.current) {
34352 return;
34353 }
34354 setNeedsA11yCompat(node.ownerDocument !== contentRef.current.ownerDocument);
34355 }, [contentRef])]);
34356 useOnClickOutside(popoverRef, reset);
34357 const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
34358 function announce(options) {
34359 if (!debouncedSpeak) {
34360 return;
34361 }
34362 if (!!options.length) {
34363 if (filterValue) {
34364 debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)(
34365 /* translators: %d: number of results. */
34366 (0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", options.length),
34367 options.length
34368 ), "assertive");
34369 } else {
34370 debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)(
34371 /* translators: %d: number of results. */
34372 (0,external_wp_i18n_namespaceObject._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.", "Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.", options.length),
34373 options.length
34374 ), "assertive");
34375 }
34376 } else {
34377 debouncedSpeak((0,external_wp_i18n_namespaceObject.__)("No results."), "assertive");
34378 }
34379 }
34380 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
34381 onChangeOptions(items);
34382 announce(items);
34383 }, [items]);
34384 if (items.length === 0) {
34385 return null;
34386 }
34387 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
34388 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(popover_default, {
34389 focusOnMount: false,
34390 onClose: onReset,
34391 placement: "top-start",
34392 className: "components-autocomplete__popover",
34393 anchor: popoverAnchor,
34394 ref: popoverRefs,
34395 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, {
34396 items,
34397 onSelect,
34398 selectedIndex,
34399 instanceId,
34400 listBoxId,
34401 className
34402 })
34403 }), contentRef.current && needsA11yCompat && (0,external_ReactDOM_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListBox, {
34404 items,
34405 onSelect,
34406 selectedIndex,
34407 instanceId,
34408 listBoxId,
34409 className,
34410 Component: component_component_default
34411 }), contentRef.current.ownerDocument.body)]
34412 });
34413 }
34414 return AutocompleterUI;
34415}
34416function useOnClickOutside(ref, handler) {
34417 (0,external_wp_element_namespaceObject.useEffect)(() => {
34418 const listener = (event) => {
34419 if (!ref.current || ref.current.contains(event.target)) {
34420 return;
34421 }
34422 handler(event);
34423 };
34424 document.addEventListener("mousedown", listener);
34425 document.addEventListener("touchstart", listener);
34426 return () => {
34427 document.removeEventListener("mousedown", listener);
34428 document.removeEventListener("touchstart", listener);
34429 };
34430 }, [handler, ref]);
34431}
34432
34433
34434;// ./node_modules/@wordpress/components/build-module/utils/get-node-text.js
34435const getNodeText = (node) => {
34436 if (node === null) {
34437 return "";
34438 }
34439 switch (typeof node) {
34440 case "string":
34441 case "number":
34442 return node.toString();
34443 case "object": {
34444 if (node instanceof Array) {
34445 return node.map(getNodeText).join("");
34446 }
34447 if ("props" in node) {
34448 return getNodeText(node.props.children);
34449 }
34450 return "";
34451 }
34452 default:
34453 return "";
34454 }
34455};
34456var get_node_text_default = getNodeText;
34457
34458
34459;// ./node_modules/@wordpress/components/build-module/autocomplete/index.js
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471const EMPTY_FILTERED_OPTIONS = [];
34472const AUTOCOMPLETE_HOOK_REFERENCE = {};
34473function useAutocomplete({
34474 record,
34475 onChange,
34476 onReplace,
34477 completers,
34478 contentRef
34479}) {
34480 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(AUTOCOMPLETE_HOOK_REFERENCE);
34481 const [selectedIndex, setSelectedIndex] = (0,external_wp_element_namespaceObject.useState)(0);
34482 const [filteredOptions, setFilteredOptions] = (0,external_wp_element_namespaceObject.useState)(EMPTY_FILTERED_OPTIONS);
34483 const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)("");
34484 const [autocompleter, setAutocompleter] = (0,external_wp_element_namespaceObject.useState)(null);
34485 const [AutocompleterUI, setAutocompleterUI] = (0,external_wp_element_namespaceObject.useState)(null);
34486 const backspacingRef = (0,external_wp_element_namespaceObject.useRef)(false);
34487 function insertCompletion(replacement) {
34488 if (autocompleter === null) {
34489 return;
34490 }
34491 const end = record.start;
34492 const start = end - autocompleter.triggerPrefix.length - filterValue.length;
34493 const toInsert = (0,external_wp_richText_namespaceObject.create)({
34494 html: (0,external_wp_element_namespaceObject.renderToString)(replacement)
34495 });
34496 onChange((0,external_wp_richText_namespaceObject.insert)(record, toInsert, start, end));
34497 }
34498 function select(option) {
34499 const {
34500 getOptionCompletion
34501 } = autocompleter || {};
34502 if (option.isDisabled) {
34503 return;
34504 }
34505 if (getOptionCompletion) {
34506 const completion = getOptionCompletion(option.value, filterValue);
34507 const isCompletionObject = (obj) => {
34508 return obj !== null && typeof obj === "object" && "action" in obj && obj.action !== void 0 && "value" in obj && obj.value !== void 0;
34509 };
34510 const completionObject = isCompletionObject(completion) ? completion : {
34511 action: "insert-at-caret",
34512 value: completion
34513 };
34514 if ("replace" === completionObject.action) {
34515 onReplace([completionObject.value]);
34516 return;
34517 } else if ("insert-at-caret" === completionObject.action) {
34518 insertCompletion(completionObject.value);
34519 }
34520 }
34521 reset();
34522 contentRef.current?.focus();
34523 }
34524 function reset() {
34525 setSelectedIndex(0);
34526 setFilteredOptions(EMPTY_FILTERED_OPTIONS);
34527 setFilterValue("");
34528 setAutocompleter(null);
34529 setAutocompleterUI(null);
34530 }
34531 function onChangeOptions(options) {
34532 setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0);
34533 setFilteredOptions(options);
34534 }
34535 function handleKeyDown(event) {
34536 backspacingRef.current = event.key === "Backspace";
34537 if (!autocompleter) {
34538 return;
34539 }
34540 if (filteredOptions.length === 0) {
34541 return;
34542 }
34543 if (event.defaultPrevented) {
34544 return;
34545 }
34546 switch (event.key) {
34547 case "ArrowUp": {
34548 const newIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1;
34549 setSelectedIndex(newIndex);
34550 if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) {
34551 (0,external_wp_a11y_namespaceObject.speak)(get_node_text_default(filteredOptions[newIndex].label), "assertive");
34552 }
34553 break;
34554 }
34555 case "ArrowDown": {
34556 const newIndex = (selectedIndex + 1) % filteredOptions.length;
34557 setSelectedIndex(newIndex);
34558 if ((0,external_wp_keycodes_namespaceObject.isAppleOS)()) {
34559 (0,external_wp_a11y_namespaceObject.speak)(get_node_text_default(filteredOptions[newIndex].label), "assertive");
34560 }
34561 break;
34562 }
34563 case "Escape":
34564 setAutocompleter(null);
34565 setAutocompleterUI(null);
34566 event.preventDefault();
34567 break;
34568 case "Enter":
34569 select(filteredOptions[selectedIndex]);
34570 break;
34571 case "ArrowLeft":
34572 case "ArrowRight":
34573 reset();
34574 return;
34575 default:
34576 return;
34577 }
34578 event.preventDefault();
34579 }
34580 const textContent = (0,external_wp_element_namespaceObject.useMemo)(() => {
34581 if ((0,external_wp_richText_namespaceObject.isCollapsed)(record)) {
34582 return (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, 0));
34583 }
34584 return "";
34585 }, [record]);
34586 (0,external_wp_element_namespaceObject.useEffect)(() => {
34587 if (!textContent) {
34588 if (autocompleter) {
34589 reset();
34590 }
34591 return;
34592 }
34593 const completer = completers.reduce((lastTrigger, currentCompleter) => {
34594 const triggerIndex2 = textContent.lastIndexOf(currentCompleter.triggerPrefix);
34595 const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1;
34596 return triggerIndex2 > lastTriggerIndex ? currentCompleter : lastTrigger;
34597 }, null);
34598 if (!completer) {
34599 if (autocompleter) {
34600 reset();
34601 }
34602 return;
34603 }
34604 const {
34605 allowContext,
34606 triggerPrefix
34607 } = completer;
34608 const triggerIndex = textContent.lastIndexOf(triggerPrefix);
34609 const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length);
34610 const tooDistantFromTrigger = textWithoutTrigger.length > 50;
34611 if (tooDistantFromTrigger) {
34612 return;
34613 }
34614 const mismatch = filteredOptions.length === 0;
34615 const wordsFromTrigger = textWithoutTrigger.split(/\s/);
34616 const hasOneTriggerWord = wordsFromTrigger.length === 1;
34617 const matchingWhileBackspacing = backspacingRef.current && wordsFromTrigger.length <= 3;
34618 if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
34619 if (autocompleter) {
34620 reset();
34621 }
34622 return;
34623 }
34624 const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, void 0, (0,external_wp_richText_namespaceObject.getTextContent)(record).length));
34625 if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) {
34626 if (autocompleter) {
34627 reset();
34628 }
34629 return;
34630 }
34631 if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
34632 if (autocompleter) {
34633 reset();
34634 }
34635 return;
34636 }
34637 if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) {
34638 if (autocompleter) {
34639 reset();
34640 }
34641 return;
34642 }
34643 const safeTrigger = escapeRegExp(completer.triggerPrefix);
34644 const text = remove_accents_default()(textContent);
34645 const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\0-\uFFFF]*)$`));
34646 const query = match && match[1];
34647 setAutocompleter(completer);
34648 setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI);
34649 setFilterValue(query === null ? "" : query);
34650 }, [textContent]);
34651 const {
34652 key: selectedKey = ""
34653 } = filteredOptions[selectedIndex] || {};
34654 const {
34655 className
34656 } = autocompleter || {};
34657 const isExpanded = !!autocompleter && filteredOptions.length > 0;
34658 const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : void 0;
34659 const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null;
34660 const hasSelection = record.start !== void 0;
34661 const showPopover = !!textContent && hasSelection && !!AutocompleterUI;
34662 return {
34663 listBoxId,
34664 activeId,
34665 onKeyDown: withIgnoreIMEEvents(handleKeyDown),
34666 popover: showPopover && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AutocompleterUI, {
34667 className,
34668 filterValue,
34669 instanceId,
34670 listBoxId,
34671 selectedIndex,
34672 onChangeOptions,
34673 onSelect: select,
34674 value: record,
34675 contentRef,
34676 reset
34677 })
34678 };
34679}
34680function useLastDifferentValue(value) {
34681 const history = (0,external_wp_element_namespaceObject.useRef)(/* @__PURE__ */ new Set());
34682 history.current.add(value);
34683 if (history.current.size > 2) {
34684 history.current.delete(Array.from(history.current)[0]);
34685 }
34686 return Array.from(history.current)[0];
34687}
34688function useAutocompleteProps(options) {
34689 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
34690 const onKeyDownRef = (0,external_wp_element_namespaceObject.useRef)();
34691 const {
34692 record
34693 } = options;
34694 const previousRecord = useLastDifferentValue(record);
34695 const {
34696 popover,
34697 listBoxId,
34698 activeId,
34699 onKeyDown
34700 } = useAutocomplete({
34701 ...options,
34702 contentRef: ref
34703 });
34704 onKeyDownRef.current = onKeyDown;
34705 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
34706 function _onKeyDown(event) {
34707 onKeyDownRef.current?.(event);
34708 }
34709 element.addEventListener("keydown", _onKeyDown);
34710 return () => {
34711 element.removeEventListener("keydown", _onKeyDown);
34712 };
34713 }, [])]);
34714 const didUserInput = record.text !== previousRecord?.text;
34715 if (!didUserInput) {
34716 return {
34717 ref: mergedRefs
34718 };
34719 }
34720 return {
34721 ref: mergedRefs,
34722 children: popover,
34723 "aria-autocomplete": listBoxId ? "list" : void 0,
34724 "aria-owns": listBoxId,
34725 "aria-activedescendant": activeId
34726 };
34727}
34728function Autocomplete({
34729 children,
34730 isSelected,
34731 ...options
34732}) {
34733 const {
34734 popover,
34735 ...props
34736 } = useAutocomplete(options);
34737 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
34738 children: [children(props), isSelected && popover]
34739 });
34740}
34741
34742
34743;// ./node_modules/@wordpress/components/build-module/base-control/hooks.js
34744
34745
34746function useBaseControlProps(props) {
34747 const {
34748 help,
34749 id: preferredId,
34750 ...restProps
34751 } = props;
34752 const uniqueId = (0,external_wp_compose_namespaceObject.useInstanceId)(base_control_default, "wp-components-base-control", preferredId);
34753 return {
34754 baseControlProps: {
34755 id: uniqueId,
34756 help,
34757 ...restProps
34758 },
34759 controlProps: {
34760 id: uniqueId,
34761 ...!!help ? {
34762 "aria-describedby": `${uniqueId}__help`
34763 } : {}
34764 }
34765 };
34766}
34767
34768
34769;// ./node_modules/@wordpress/icons/build-module/library/link.js
34770
34771
34772var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
34773
34774
34775;// ./node_modules/@wordpress/icons/build-module/library/link-off.js
34776
34777
34778var link_off_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) });
34779
34780
34781;// ./node_modules/@wordpress/components/build-module/border-box-control/styles.js
34782function border_box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
34783 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
34784}
34785
34786
34787const borderBoxControl = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
34788const linkedBorderControl = () => /* @__PURE__ */ emotion_react_browser_esm_css("flex:1;", rtl({
34789 marginRight: "24px"
34790})(), ";" + ( true ? "" : 0), true ? "" : 0);
34791const wrapper = true ? {
34792 name: "bjn8wh",
34793 styles: "position:relative"
34794} : 0;
34795const borderBoxControlLinkedButton = (size) => {
34796 return /* @__PURE__ */ emotion_react_browser_esm_css("position:absolute;top:", size === "__unstable-large" ? "8px" : "3px", ";", rtl({
34797 right: 0
34798 })(), " line-height:0;" + ( true ? "" : 0), true ? "" : 0);
34799};
34800const borderBoxStyleWithFallback = (border) => {
34801 const {
34802 color = COLORS.gray[200],
34803 style = "solid",
34804 width = config_values_default.borderWidth
34805 } = border || {};
34806 const clampedWidth = width !== config_values_default.borderWidth ? `clamp(1px, ${width}, 10px)` : width;
34807 const hasVisibleBorder = !!width && width !== "0" || !!color;
34808 const borderStyle = hasVisibleBorder ? style || "solid" : style;
34809 return `${color} ${borderStyle} ${clampedWidth}`;
34810};
34811const borderBoxControlVisualizer = (borders, size) => {
34812 return /* @__PURE__ */ emotion_react_browser_esm_css("position:absolute;top:", size === "__unstable-large" ? "20px" : "15px", ";right:", size === "__unstable-large" ? "39px" : "29px", ";bottom:", size === "__unstable-large" ? "20px" : "15px", ";left:", size === "__unstable-large" ? "39px" : "29px", ";border-top:", borderBoxStyleWithFallback(borders?.top), ";border-bottom:", borderBoxStyleWithFallback(borders?.bottom), ";", rtl({
34813 borderLeft: borderBoxStyleWithFallback(borders?.left)
34814 })(), " ", rtl({
34815 borderRight: borderBoxStyleWithFallback(borders?.right)
34816 })(), ";" + ( true ? "" : 0), true ? "" : 0);
34817};
34818const borderBoxControlSplitControls = (size) => /* @__PURE__ */ emotion_react_browser_esm_css("position:relative;flex:1;width:", size === "__unstable-large" ? void 0 : "80%", ";" + ( true ? "" : 0), true ? "" : 0);
34819const centeredBorderControl = true ? {
34820 name: "1nwbfnf",
34821 styles: "grid-column:span 2;margin:0 auto"
34822} : 0;
34823const rightBorderControl = () => /* @__PURE__ */ emotion_react_browser_esm_css(rtl({
34824 marginLeft: "auto"
34825})(), ";" + ( true ? "" : 0), true ? "" : 0);
34826
34827
34828;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/hook.js
34829
34830
34831
34832
34833function useBorderBoxControlLinkedButton(props) {
34834 const {
34835 className,
34836 size = "default",
34837 ...otherProps
34838 } = useContextSystem(props, "BorderBoxControlLinkedButton");
34839 const cx = useCx();
34840 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
34841 return cx(borderBoxControlLinkedButton(size), className);
34842 }, [className, cx, size]);
34843 return {
34844 ...otherProps,
34845 className: classes
34846 };
34847}
34848
34849
34850;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-linked-button/component.js
34851
34852
34853
34854
34855
34856
34857const BorderBoxControlLinkedButton = (props, forwardedRef) => {
34858 const {
34859 className,
34860 isLinked,
34861 ...buttonProps
34862 } = useBorderBoxControlLinkedButton(props);
34863 const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink sides") : (0,external_wp_i18n_namespaceObject.__)("Link sides");
34864 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
34865 ...buttonProps,
34866 size: "small",
34867 icon: isLinked ? link_default : link_off_default,
34868 iconSize: 24,
34869 label,
34870 ref: forwardedRef,
34871 className
34872 });
34873};
34874const ConnectedBorderBoxControlLinkedButton = contextConnect(BorderBoxControlLinkedButton, "BorderBoxControlLinkedButton");
34875var border_box_control_linked_button_component_component_default = ConnectedBorderBoxControlLinkedButton;
34876
34877
34878;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/hook.js
34879
34880
34881
34882
34883function useBorderBoxControlVisualizer(props) {
34884 const {
34885 className,
34886 value,
34887 size = "default",
34888 ...otherProps
34889 } = useContextSystem(props, "BorderBoxControlVisualizer");
34890 const cx = useCx();
34891 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
34892 return cx(borderBoxControlVisualizer(value, size), className);
34893 }, [cx, className, value, size]);
34894 return {
34895 ...otherProps,
34896 className: classes,
34897 value
34898 };
34899}
34900
34901
34902;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/component.js
34903
34904
34905
34906
34907const BorderBoxControlVisualizer = (props, forwardedRef) => {
34908 const {
34909 value,
34910 ...otherProps
34911 } = useBorderBoxControlVisualizer(props);
34912 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
34913 ...otherProps,
34914 ref: forwardedRef
34915 });
34916};
34917const ConnectedBorderBoxControlVisualizer = contextConnect(BorderBoxControlVisualizer, "BorderBoxControlVisualizer");
34918var border_box_control_visualizer_component_component_default = ConnectedBorderBoxControlVisualizer;
34919
34920
34921;// ./node_modules/@wordpress/icons/build-module/library/line-solid.js
34922
34923
34924var line_solid_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 11.25h14v1.5H5z" }) });
34925
34926
34927;// ./node_modules/@wordpress/icons/build-module/library/line-dashed.js
34928
34929
34930var line_dashed_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
34931 external_wp_primitives_namespaceObject.Path,
34932 {
34933 fillRule: "evenodd",
34934 d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",
34935 clipRule: "evenodd"
34936 }
34937) });
34938
34939
34940;// ./node_modules/@wordpress/icons/build-module/library/line-dotted.js
34941
34942
34943var line_dotted_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
34944 external_wp_primitives_namespaceObject.Path,
34945 {
34946 fillRule: "evenodd",
34947 d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",
34948 clipRule: "evenodd"
34949 }
34950) });
34951
34952
34953;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/styles.js
34954
34955function toggle_group_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
34956 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
34957}
34958
34959
34960const toggleGroupControl = ({
34961 isBlock,
34962 isDeselectable,
34963 size
34964}) => /* @__PURE__ */ emotion_react_browser_esm_css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", config_values_default.radiusSmall, ";display:inline-flex;min-width:0;position:relative;", toggleGroupControlSize(size), " ", !isDeselectable && enclosingBorders(isBlock), "@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;background:", COLORS.theme.foreground, ";outline:2px solid transparent;outline-offset:-3px;--antialiasing-factor:100;border-radius:calc(\n ", config_values_default.radiusXSmall, " /\n (\n var( --selected-width, 0 ) /\n var( --antialiasing-factor )\n )\n )/", config_values_default.radiusXSmall, ";left:-1px;width:calc( var( --antialiasing-factor ) * 1px );height:calc( var( --selected-height, 0 ) * 1px );transform-origin:left top;transform:translateX( calc( var( --selected-left, 0 ) * 1px ) ) scaleX(\n calc(\n var( --selected-width, 0 ) / var( --antialiasing-factor )\n )\n );}" + ( true ? "" : 0), true ? "" : 0);
34965const enclosingBorders = (isBlock) => {
34966 const enclosingBorder = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", COLORS.ui.border, ";" + ( true ? "" : 0), true ? "" : 0);
34967 return /* @__PURE__ */ emotion_react_browser_esm_css(isBlock && enclosingBorder, " &:hover{border-color:", COLORS.ui.borderHover, ";}&:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values_default.controlBoxShadowFocus, ";z-index:1;outline:2px solid transparent;outline-offset:-2px;}" + ( true ? "" : 0), true ? "" : 0);
34968};
34969var styles_ref = true ? {
34970 name: "1aqh2c7",
34971 styles: "min-height:40px;padding:3px"
34972} : 0;
34973var _ref2 = true ? {
34974 name: "1ndywgm",
34975 styles: "min-height:36px;padding:2px"
34976} : 0;
34977const toggleGroupControlSize = (size) => {
34978 const styles = {
34979 default: _ref2,
34980 "__unstable-large": styles_ref
34981 };
34982 return styles[size];
34983};
34984const toggle_group_control_styles_block = true ? {
34985 name: "7whenc",
34986 styles: "display:flex;width:100%"
34987} : 0;
34988const VisualLabelWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
34989 target: "eakva830"
34990} : 0)( true ? {
34991 name: "zjik7",
34992 styles: "display:flex"
34993} : 0);
34994
34995
34996;// ./node_modules/@ariakit/core/esm/radio/radio-store.js
34997"use client";
34998
34999
35000
35001
35002
35003
35004
35005
35006// src/radio/radio-store.ts
35007function createRadioStore(_a = {}) {
35008 var props = _3YLGPPWQ_objRest(_a, []);
35009 var _a2;
35010 const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
35011 const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
35012 focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
35013 }));
35014 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), {
35015 value: defaultValue(
35016 props.value,
35017 syncState == null ? void 0 : syncState.value,
35018 props.defaultValue,
35019 null
35020 )
35021 });
35022 const radio = createStore(initialState, composite, props.store);
35023 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), radio), {
35024 setValue: (value) => radio.setState("value", value)
35025 });
35026}
35027
35028
35029;// ./node_modules/@ariakit/react-core/esm/__chunks/4BXJGRNH.js
35030"use client";
35031
35032
35033
35034// src/radio/radio-store.ts
35035
35036function useRadioStoreProps(store, update, props) {
35037 store = useCompositeStoreProps(store, update, props);
35038 useStoreProps(store, props, "value", "setValue");
35039 return store;
35040}
35041function useRadioStore(props = {}) {
35042 const [store, update] = YV4JVR4I_useStore(createRadioStore, props);
35043 return useRadioStoreProps(store, update, props);
35044}
35045
35046
35047
35048;// ./node_modules/@ariakit/react-core/esm/__chunks/UVUMR3WP.js
35049"use client";
35050
35051
35052
35053// src/radio/radio-context.tsx
35054var UVUMR3WP_ctx = createStoreContext(
35055 [CompositeContextProvider],
35056 [CompositeScopedContextProvider]
35057);
35058var useRadioContext = UVUMR3WP_ctx.useContext;
35059var useRadioScopedContext = UVUMR3WP_ctx.useScopedContext;
35060var useRadioProviderContext = UVUMR3WP_ctx.useProviderContext;
35061var RadioContextProvider = UVUMR3WP_ctx.ContextProvider;
35062var RadioScopedContextProvider = UVUMR3WP_ctx.ScopedContextProvider;
35063
35064
35065
35066;// ./node_modules/@ariakit/react-core/esm/radio/radio-group.js
35067"use client";
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080// src/radio/radio-group.tsx
35081
35082
35083var radio_group_TagName = "div";
35084var useRadioGroup = createHook(
35085 function useRadioGroup2(_a) {
35086 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
35087 const context = useRadioProviderContext();
35088 store = store || context;
35089 invariant(
35090 store,
35091 false && 0
35092 );
35093 props = useWrapElement(
35094 props,
35095 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioScopedContextProvider, { value: store, children: element }),
35096 [store]
35097 );
35098 props = _3YLGPPWQ_spreadValues({
35099 role: "radiogroup"
35100 }, props);
35101 props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
35102 return props;
35103 }
35104);
35105var RadioGroup = forwardRef2(function RadioGroup2(props) {
35106 const htmlProps = useRadioGroup(props);
35107 return LMDWO4NN_createElement(radio_group_TagName, htmlProps);
35108});
35109
35110
35111;// ./node_modules/@wordpress/components/build-module/toggle-group-control/context.js
35112
35113const ToggleGroupControlContext = (0,external_wp_element_namespaceObject.createContext)({});
35114ToggleGroupControlContext.displayName = "ToggleGroupControlContext";
35115const useToggleGroupControlContext = () => (0,external_wp_element_namespaceObject.useContext)(ToggleGroupControlContext);
35116var context_context_default = ToggleGroupControlContext;
35117
35118
35119;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/utils.js
35120
35121
35122function useComputeControlledOrUncontrolledValue(valueProp) {
35123 const isInitialRenderRef = (0,external_wp_element_namespaceObject.useRef)(true);
35124 const prevValueProp = (0,external_wp_compose_namespaceObject.usePrevious)(valueProp);
35125 const prevIsControlledRef = (0,external_wp_element_namespaceObject.useRef)(false);
35126 (0,external_wp_element_namespaceObject.useEffect)(() => {
35127 if (isInitialRenderRef.current) {
35128 isInitialRenderRef.current = false;
35129 }
35130 }, []);
35131 const isControlled = prevIsControlledRef.current || !isInitialRenderRef.current && prevValueProp !== valueProp;
35132 (0,external_wp_element_namespaceObject.useEffect)(() => {
35133 prevIsControlledRef.current = isControlled;
35134 }, [isControlled]);
35135 if (isControlled) {
35136 return {
35137 value: valueProp !== null && valueProp !== void 0 ? valueProp : "",
35138 defaultValue: void 0
35139 };
35140 }
35141 return {
35142 value: void 0,
35143 defaultValue: valueProp
35144 };
35145}
35146
35147
35148;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-radio-group.js
35149
35150
35151
35152
35153
35154
35155
35156
35157function UnforwardedToggleGroupControlAsRadioGroup({
35158 children,
35159 isAdaptiveWidth,
35160 label,
35161 onChange: onChangeProp,
35162 size,
35163 value: valueProp,
35164 id: idProp,
35165 setSelectedElement,
35166 ...otherProps
35167}, forwardedRef) {
35168 const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, "toggle-group-control-as-radio-group");
35169 const baseId = idProp || generatedId;
35170 const {
35171 value,
35172 defaultValue
35173 } = useComputeControlledOrUncontrolledValue(valueProp);
35174 const wrappedOnChangeProp = onChangeProp ? (v) => {
35175 onChangeProp(v !== null && v !== void 0 ? v : void 0);
35176 } : void 0;
35177 const radio = useRadioStore({
35178 defaultValue,
35179 value,
35180 setValue: wrappedOnChangeProp,
35181 rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
35182 });
35183 const selectedValue = useStoreState(radio, "value");
35184 const setValue = radio.setValue;
35185 (0,external_wp_element_namespaceObject.useEffect)(() => {
35186 if (selectedValue === "") {
35187 radio.setActiveId(void 0);
35188 }
35189 }, [radio, selectedValue]);
35190 const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
35191 activeItemIsNotFirstItem: () => radio.getState().activeId !== radio.first(),
35192 baseId,
35193 isBlock: !isAdaptiveWidth,
35194 size,
35195 // @ts-expect-error - This is wrong and we should fix it.
35196 value: selectedValue,
35197 // @ts-expect-error - This is wrong and we should fix it.
35198 setValue,
35199 setSelectedElement
35200 }), [baseId, isAdaptiveWidth, radio, selectedValue, setSelectedElement, setValue, size]);
35201 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_context_default.Provider, {
35202 value: groupContextValue,
35203 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, {
35204 store: radio,
35205 "aria-label": label,
35206 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {}),
35207 ...otherProps,
35208 id: baseId,
35209 ref: forwardedRef,
35210 children
35211 })
35212 });
35213}
35214const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup);
35215
35216
35217;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js
35218
35219function useControlledValue({
35220 defaultValue,
35221 onChange,
35222 value: valueProp
35223}) {
35224 const hasValue = typeof valueProp !== "undefined";
35225 const initialValue = hasValue ? valueProp : defaultValue;
35226 const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue);
35227 const value = hasValue ? valueProp : state;
35228 const uncontrolledSetValue = (0,external_wp_element_namespaceObject.useCallback)((nextValue, ...args) => {
35229 setState(nextValue);
35230 onChange?.(nextValue, ...args);
35231 }, [onChange]);
35232 let setValue;
35233 if (hasValue && typeof onChange === "function") {
35234 setValue = onChange;
35235 } else if (!hasValue && typeof onChange === "function") {
35236 setValue = uncontrolledSetValue;
35237 } else {
35238 setValue = setState;
35239 }
35240 return [value, setValue];
35241}
35242
35243
35244;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js
35245
35246
35247
35248
35249
35250
35251
35252function UnforwardedToggleGroupControlAsButtonGroup({
35253 children,
35254 isAdaptiveWidth,
35255 label,
35256 onChange,
35257 size,
35258 value: valueProp,
35259 id: idProp,
35260 setSelectedElement,
35261 ...otherProps
35262}, forwardedRef) {
35263 const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, "toggle-group-control-as-button-group");
35264 const baseId = idProp || generatedId;
35265 const {
35266 value,
35267 defaultValue
35268 } = useComputeControlledOrUncontrolledValue(valueProp);
35269 const [selectedValue, setSelectedValue] = useControlledValue({
35270 defaultValue,
35271 value,
35272 onChange
35273 });
35274 const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
35275 baseId,
35276 value: selectedValue,
35277 setValue: setSelectedValue,
35278 isBlock: !isAdaptiveWidth,
35279 isDeselectable: true,
35280 size,
35281 setSelectedElement
35282 }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size, setSelectedElement]);
35283 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_context_default.Provider, {
35284 value: groupContextValue,
35285 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
35286 "aria-label": label,
35287 ...otherProps,
35288 ref: forwardedRef,
35289 role: "group",
35290 children
35291 })
35292 });
35293}
35294const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup);
35295
35296
35297;// ./node_modules/@wordpress/components/build-module/utils/element-rect.js
35298
35299
35300const NULL_ELEMENT_OFFSET_RECT = {
35301 element: void 0,
35302 top: 0,
35303 right: 0,
35304 bottom: 0,
35305 left: 0,
35306 width: 0,
35307 height: 0
35308};
35309function getElementOffsetRect(element) {
35310 var _offsetParent$getBoun, _offsetParent$scrollL, _offsetParent$scrollT;
35311 const rect = element.getBoundingClientRect();
35312 if (rect.width === 0 || rect.height === 0) {
35313 return;
35314 }
35315 const offsetParent = element.offsetParent;
35316 const offsetParentRect = (_offsetParent$getBoun = offsetParent?.getBoundingClientRect()) !== null && _offsetParent$getBoun !== void 0 ? _offsetParent$getBoun : NULL_ELEMENT_OFFSET_RECT;
35317 const offsetParentScrollX = (_offsetParent$scrollL = offsetParent?.scrollLeft) !== null && _offsetParent$scrollL !== void 0 ? _offsetParent$scrollL : 0;
35318 const offsetParentScrollY = (_offsetParent$scrollT = offsetParent?.scrollTop) !== null && _offsetParent$scrollT !== void 0 ? _offsetParent$scrollT : 0;
35319 const computedWidth = parseFloat(getComputedStyle(element).width);
35320 const computedHeight = parseFloat(getComputedStyle(element).height);
35321 const scaleX = computedWidth / rect.width;
35322 const scaleY = computedHeight / rect.height;
35323 return {
35324 element,
35325 // To obtain the adjusted values for the position:
35326 // 1. Compute the element's position relative to the offset parent.
35327 // 2. Correct for the scale factor.
35328 // 3. Adjust for the scroll position of the offset parent.
35329 top: (rect.top - offsetParentRect?.top) * scaleY + offsetParentScrollY,
35330 right: (offsetParentRect?.right - rect.right) * scaleX - offsetParentScrollX,
35331 bottom: (offsetParentRect?.bottom - rect.bottom) * scaleY - offsetParentScrollY,
35332 left: (rect.left - offsetParentRect?.left) * scaleX + offsetParentScrollX,
35333 // Computed dimensions don't need any adjustments.
35334 width: computedWidth,
35335 height: computedHeight
35336 };
35337}
35338const POLL_RATE = 100;
35339function useTrackElementOffsetRect(targetElement, deps = []) {
35340 const [indicatorPosition, setIndicatorPosition] = (0,external_wp_element_namespaceObject.useState)(NULL_ELEMENT_OFFSET_RECT);
35341 const intervalRef = (0,external_wp_element_namespaceObject.useRef)();
35342 const measure = (0,external_wp_compose_namespaceObject.useEvent)(() => {
35343 if (targetElement && targetElement.isConnected) {
35344 const elementOffsetRect = getElementOffsetRect(targetElement);
35345 if (elementOffsetRect) {
35346 setIndicatorPosition(elementOffsetRect);
35347 clearInterval(intervalRef.current);
35348 return true;
35349 }
35350 } else {
35351 clearInterval(intervalRef.current);
35352 }
35353 return false;
35354 });
35355 const setElement = (0,external_wp_compose_namespaceObject.useResizeObserver)(() => {
35356 if (!measure()) {
35357 requestAnimationFrame(() => {
35358 if (!measure()) {
35359 intervalRef.current = setInterval(measure, POLL_RATE);
35360 }
35361 });
35362 }
35363 });
35364 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35365 setElement(targetElement);
35366 if (!targetElement) {
35367 setIndicatorPosition(NULL_ELEMENT_OFFSET_RECT);
35368 }
35369 }, [setElement, targetElement]);
35370 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35371 measure();
35372 }, deps);
35373 return indicatorPosition;
35374}
35375
35376
35377;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-on-value-update.js
35378
35379
35380function useOnValueUpdate(value, onUpdate) {
35381 const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(value);
35382 const updateCallbackEvent = (0,external_wp_compose_namespaceObject.useEvent)(onUpdate);
35383 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35384 if (previousValueRef.current !== value) {
35385 updateCallbackEvent({
35386 previousValue: previousValueRef.current
35387 });
35388 previousValueRef.current = value;
35389 }
35390 }, [updateCallbackEvent, value]);
35391}
35392
35393
35394;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-animated-offset-rect.js
35395
35396
35397
35398function useAnimatedOffsetRect(container, rect, {
35399 prefix = "subelement",
35400 dataAttribute = `${prefix}-animated`,
35401 transitionEndFilter = () => true,
35402 roundRect = false
35403} = {}) {
35404 const setProperties = (0,external_wp_compose_namespaceObject.useEvent)(() => {
35405 Object.keys(rect).forEach((property) => property !== "element" && container?.style.setProperty(`--${prefix}-${property}`, String(roundRect ? Math.floor(rect[property]) : rect[property])));
35406 });
35407 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35408 setProperties();
35409 }, [rect, setProperties]);
35410 useOnValueUpdate(rect.element, ({
35411 previousValue
35412 }) => {
35413 if (rect.element && previousValue) {
35414 container?.setAttribute(`data-${dataAttribute}`, "");
35415 }
35416 });
35417 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35418 function onTransitionEnd(event) {
35419 if (transitionEndFilter(event)) {
35420 container?.removeAttribute(`data-${dataAttribute}`);
35421 }
35422 }
35423 container?.addEventListener("transitionend", onTransitionEnd);
35424 return () => container?.removeEventListener("transitionend", onTransitionEnd);
35425 }, [dataAttribute, container, transitionEndFilter]);
35426}
35427
35428
35429;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443function UnconnectedToggleGroupControl(props, forwardedRef) {
35444 const {
35445 __nextHasNoMarginBottom = false,
35446 __next40pxDefaultSize = false,
35447 __shouldNotWarnDeprecated36pxSize,
35448 className,
35449 isAdaptiveWidth = false,
35450 isBlock = false,
35451 isDeselectable = false,
35452 label,
35453 hideLabelFromVision = false,
35454 help,
35455 onChange,
35456 size = "default",
35457 value,
35458 children,
35459 ...otherProps
35460 } = useContextSystem(props, "ToggleGroupControl");
35461 const normalizedSize = __next40pxDefaultSize && size === "default" ? "__unstable-large" : size;
35462 const [selectedElement, setSelectedElement] = (0,external_wp_element_namespaceObject.useState)();
35463 const [controlElement, setControlElement] = (0,external_wp_element_namespaceObject.useState)();
35464 const refs = (0,external_wp_compose_namespaceObject.useMergeRefs)([setControlElement, forwardedRef]);
35465 const selectedRect = useTrackElementOffsetRect(value !== null && value !== void 0 ? selectedElement : void 0);
35466 useAnimatedOffsetRect(controlElement, selectedRect, {
35467 prefix: "selected",
35468 dataAttribute: "indicator-animated",
35469 transitionEndFilter: (event) => event.pseudoElement === "::before",
35470 roundRect: true
35471 });
35472 const cx = useCx();
35473 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({
35474 isBlock,
35475 isDeselectable,
35476 size: normalizedSize
35477 }), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, normalizedSize]);
35478 const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup;
35479 maybeWarnDeprecated36pxSize({
35480 componentName: "ToggleGroupControl",
35481 size,
35482 __next40pxDefaultSize,
35483 __shouldNotWarnDeprecated36pxSize
35484 });
35485 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control_default, {
35486 help,
35487 __nextHasNoMarginBottom,
35488 __associatedWPComponentName: "ToggleGroupControl",
35489 children: [!hideLabelFromVision && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabelWrapper, {
35490 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
35491 children: label
35492 })
35493 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MainControl, {
35494 ...otherProps,
35495 setSelectedElement,
35496 className: classes,
35497 isAdaptiveWidth,
35498 label,
35499 onChange,
35500 ref: refs,
35501 size: normalizedSize,
35502 value,
35503 children
35504 })]
35505 });
35506}
35507const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, "ToggleGroupControl");
35508var toggle_group_control_component_component_default = ToggleGroupControl;
35509
35510
35511;// ./node_modules/@ariakit/react-core/esm/__chunks/NLEBE274.js
35512"use client";
35513
35514
35515
35516
35517
35518
35519
35520// src/radio/radio.tsx
35521
35522
35523var NLEBE274_TagName = "input";
35524function getIsChecked(value, storeValue) {
35525 if (storeValue === void 0) return;
35526 if (value != null && storeValue != null) {
35527 return storeValue === value;
35528 }
35529 return !!storeValue;
35530}
35531function isNativeRadio(tagName, type) {
35532 return tagName === "input" && (!type || type === "radio");
35533}
35534var useRadio = createHook(function useRadio2(_a) {
35535 var _b = _a, {
35536 store,
35537 name,
35538 value,
35539 checked
35540 } = _b, props = __objRest(_b, [
35541 "store",
35542 "name",
35543 "value",
35544 "checked"
35545 ]);
35546 const context = useRadioContext();
35547 store = store || context;
35548 const id = useId(props.id);
35549 const ref = (0,external_React_.useRef)(null);
35550 const isChecked = useStoreState(
35551 store,
35552 (state) => checked != null ? checked : getIsChecked(value, state == null ? void 0 : state.value)
35553 );
35554 (0,external_React_.useEffect)(() => {
35555 if (!id) return;
35556 if (!isChecked) return;
35557 const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id;
35558 if (isActiveItem) return;
35559 store == null ? void 0 : store.setActiveId(id);
35560 }, [store, isChecked, id]);
35561 const onChangeProp = props.onChange;
35562 const tagName = useTagName(ref, NLEBE274_TagName);
35563 const nativeRadio = isNativeRadio(tagName, props.type);
35564 const disabled = disabledFromProps(props);
35565 const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate();
35566 (0,external_React_.useEffect)(() => {
35567 const element = ref.current;
35568 if (!element) return;
35569 if (nativeRadio) return;
35570 if (isChecked !== void 0) {
35571 element.checked = isChecked;
35572 }
35573 if (name !== void 0) {
35574 element.name = name;
35575 }
35576 if (value !== void 0) {
35577 element.value = `${value}`;
35578 }
35579 }, [propertyUpdated, nativeRadio, isChecked, name, value]);
35580 const onChange = useEvent((event) => {
35581 if (disabled) {
35582 event.preventDefault();
35583 event.stopPropagation();
35584 return;
35585 }
35586 if ((store == null ? void 0 : store.getState().value) === value) return;
35587 if (!nativeRadio) {
35588 event.currentTarget.checked = true;
35589 schedulePropertyUpdate();
35590 }
35591 onChangeProp == null ? void 0 : onChangeProp(event);
35592 if (event.defaultPrevented) return;
35593 store == null ? void 0 : store.setValue(value);
35594 });
35595 const onClickProp = props.onClick;
35596 const onClick = useEvent((event) => {
35597 onClickProp == null ? void 0 : onClickProp(event);
35598 if (event.defaultPrevented) return;
35599 if (nativeRadio) return;
35600 onChange(event);
35601 });
35602 const onFocusProp = props.onFocus;
35603 const onFocus = useEvent((event) => {
35604 onFocusProp == null ? void 0 : onFocusProp(event);
35605 if (event.defaultPrevented) return;
35606 if (!nativeRadio) return;
35607 if (!store) return;
35608 const { moves, activeId } = store.getState();
35609 if (!moves) return;
35610 if (id && activeId !== id) return;
35611 onChange(event);
35612 });
35613 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
35614 id,
35615 role: !nativeRadio ? "radio" : void 0,
35616 type: nativeRadio ? "radio" : void 0,
35617 "aria-checked": isChecked
35618 }, props), {
35619 ref: useMergeRefs(ref, props.ref),
35620 onChange,
35621 onClick,
35622 onFocus
35623 });
35624 props = useCompositeItem(_3YLGPPWQ_spreadValues({
35625 store,
35626 clickOnEnter: !nativeRadio
35627 }, props));
35628 return removeUndefinedValues(_3YLGPPWQ_spreadValues({
35629 name: nativeRadio ? name : void 0,
35630 value: nativeRadio ? value : void 0,
35631 checked: isChecked
35632 }, props));
35633});
35634var Radio = memo2(
35635 forwardRef2(function Radio2(props) {
35636 const htmlProps = useRadio(props);
35637 return LMDWO4NN_createElement(NLEBE274_TagName, htmlProps);
35638 })
35639);
35640
35641
35642
35643;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js
35644
35645function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
35646 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
35647}
35648
35649
35650const LabelView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
35651 target: "et6ln9s1"
35652} : 0)( true ? {
35653 name: "sln1fl",
35654 styles: "display:inline-flex;max-width:100%;min-width:0;position:relative"
35655} : 0);
35656const labelBlock = true ? {
35657 name: "82a6rk",
35658 styles: "flex:1"
35659} : 0;
35660const buttonView = ({
35661 isDeselectable,
35662 isIcon,
35663 isPressed,
35664 size
35665}) => /* @__PURE__ */ emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values_default.radiusXSmall, ";color:", COLORS.theme.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ", config_values_default.transitionDurationFast, " linear,color ", config_values_default.transitionDurationFast, " linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:", COLORS.ui.background, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({
35666 size
35667}), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0);
35668const pressed = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foregroundInverted, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0);
35669const deselectable = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.ui.background, ",0 0 0 ", config_values_default.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0);
35670const ButtonContentView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
35671 target: "et6ln9s0"
35672} : 0)("display:flex;font-size:", config_values_default.fontSize, ";line-height:1;" + ( true ? "" : 0));
35673const isIconStyles = ({
35674 size = "default"
35675}) => {
35676 const iconButtonSizes = {
35677 default: "30px",
35678 "__unstable-large": "32px"
35679 };
35680 return /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.theme.foreground, ";height:", iconButtonSizes[size], ";aspect-ratio:1;padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0);
35681};
35682
35683
35684;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694const {
35695 /* ButtonContentView */ "Rp": component_ButtonContentView,
35696 /* LabelView */ "y0": component_LabelView
35697} = toggle_group_control_option_base_styles_namespaceObject;
35698const WithToolTip = ({
35699 showTooltip,
35700 text,
35701 children
35702}) => {
35703 if (showTooltip && text) {
35704 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
35705 text,
35706 placement: "top",
35707 children
35708 });
35709 }
35710 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
35711 children
35712 });
35713};
35714function ToggleGroupControlOptionBase(props, forwardedRef) {
35715 const toggleGroupControlContext = useToggleGroupControlContext();
35716 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlOptionBase, toggleGroupControlContext.baseId || "toggle-group-control-option-base");
35717 const buttonProps = useContextSystem({
35718 ...props,
35719 id
35720 }, "ToggleGroupControlOptionBase");
35721 const {
35722 isBlock = false,
35723 isDeselectable = false,
35724 size = "default"
35725 } = toggleGroupControlContext;
35726 const {
35727 className,
35728 isIcon = false,
35729 value,
35730 children,
35731 showTooltip = false,
35732 disabled,
35733 ...otherButtonProps
35734 } = buttonProps;
35735 const isPressed = toggleGroupControlContext.value === value;
35736 const cx = useCx();
35737 const labelViewClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(isBlock && labelBlock), [cx, isBlock]);
35738 const itemClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(buttonView({
35739 isDeselectable,
35740 isIcon,
35741 isPressed,
35742 size
35743 }), className), [cx, isDeselectable, isIcon, isPressed, size, className]);
35744 const buttonOnClick = () => {
35745 if (isDeselectable && isPressed) {
35746 toggleGroupControlContext.setValue(void 0);
35747 } else {
35748 toggleGroupControlContext.setValue(value);
35749 }
35750 };
35751 const commonProps = {
35752 ...otherButtonProps,
35753 className: itemClasses,
35754 "data-value": value,
35755 ref: forwardedRef
35756 };
35757 const labelRef = (0,external_wp_element_namespaceObject.useRef)(null);
35758 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
35759 if (isPressed && labelRef.current) {
35760 toggleGroupControlContext.setSelectedElement(labelRef.current);
35761 }
35762 }, [isPressed, toggleGroupControlContext]);
35763 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_LabelView, {
35764 ref: labelRef,
35765 className: labelViewClasses,
35766 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WithToolTip, {
35767 showTooltip,
35768 text: otherButtonProps["aria-label"],
35769 children: isDeselectable ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
35770 ...commonProps,
35771 disabled,
35772 "aria-pressed": isPressed,
35773 type: "button",
35774 onClick: buttonOnClick,
35775 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, {
35776 children
35777 })
35778 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, {
35779 disabled,
35780 onFocusVisible: () => {
35781 const selectedValueIsEmpty = toggleGroupControlContext.value === null || toggleGroupControlContext.value === "";
35782 if (!selectedValueIsEmpty || toggleGroupControlContext.activeItemIsNotFirstItem?.()) {
35783 toggleGroupControlContext.setValue(value);
35784 }
35785 },
35786 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
35787 type: "button",
35788 ...commonProps
35789 }),
35790 value,
35791 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_ButtonContentView, {
35792 children
35793 })
35794 })
35795 })
35796 });
35797}
35798const ConnectedToggleGroupControlOptionBase = contextConnect(ToggleGroupControlOptionBase, "ToggleGroupControlOptionBase");
35799var toggle_group_control_option_base_component_component_default = ConnectedToggleGroupControlOptionBase;
35800
35801
35802;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-icon/component.js
35803
35804
35805
35806
35807function UnforwardedToggleGroupControlOptionIcon(props, ref) {
35808 const {
35809 icon,
35810 label,
35811 ...restProps
35812 } = props;
35813 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_base_component_component_default, {
35814 ...restProps,
35815 isIcon: true,
35816 "aria-label": label,
35817 showTooltip: true,
35818 ref,
35819 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
35820 icon
35821 })
35822 });
35823}
35824const ToggleGroupControlOptionIcon = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOptionIcon);
35825var toggle_group_control_option_icon_component_component_default = ToggleGroupControlOptionIcon;
35826
35827
35828;// ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js
35829
35830
35831
35832
35833
35834const BORDER_STYLES = [{
35835 label: (0,external_wp_i18n_namespaceObject.__)("Solid"),
35836 icon: line_solid_default,
35837 value: "solid"
35838}, {
35839 label: (0,external_wp_i18n_namespaceObject.__)("Dashed"),
35840 icon: line_dashed_default,
35841 value: "dashed"
35842}, {
35843 label: (0,external_wp_i18n_namespaceObject.__)("Dotted"),
35844 icon: line_dotted_default,
35845 value: "dotted"
35846}];
35847function UnconnectedBorderControlStylePicker({
35848 onChange,
35849 ...restProps
35850}, forwardedRef) {
35851 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
35852 __nextHasNoMarginBottom: true,
35853 __next40pxDefaultSize: true,
35854 ref: forwardedRef,
35855 isDeselectable: true,
35856 onChange: (value) => {
35857 onChange?.(value);
35858 },
35859 ...restProps,
35860 children: BORDER_STYLES.map((borderStyle) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_icon_component_component_default, {
35861 value: borderStyle.value,
35862 icon: borderStyle.icon,
35863 label: borderStyle.label
35864 }, borderStyle.value))
35865 });
35866}
35867const BorderControlStylePicker = contextConnect(UnconnectedBorderControlStylePicker, "BorderControlStylePicker");
35868var border_control_style_picker_component_component_default = BorderControlStylePicker;
35869
35870
35871;// ./node_modules/@wordpress/components/build-module/color-indicator/index.js
35872
35873
35874
35875function UnforwardedColorIndicator(props, forwardedRef) {
35876 const {
35877 className,
35878 colorValue,
35879 ...additionalProps
35880 } = props;
35881 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
35882 className: dist_clsx("component-color-indicator", className),
35883 style: {
35884 background: colorValue
35885 },
35886 ref: forwardedRef,
35887 ...additionalProps
35888 });
35889}
35890const ColorIndicator = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorIndicator);
35891var color_indicator_default = ColorIndicator;
35892
35893
35894;// ./node_modules/colord/plugins/a11y.mjs
35895var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}}
35896
35897;// ./node_modules/@wordpress/components/build-module/dropdown/index.js
35898
35899
35900
35901
35902
35903
35904
35905
35906const UnconnectedDropdown = (props, forwardedRef) => {
35907 const {
35908 renderContent,
35909 renderToggle,
35910 className,
35911 contentClassName,
35912 expandOnMobile,
35913 headerTitle,
35914 focusOnMount,
35915 popoverProps,
35916 onClose,
35917 onToggle,
35918 style,
35919 open,
35920 defaultOpen,
35921 // Deprecated props
35922 position,
35923 // From context system
35924 variant
35925 } = useContextSystem(props, "Dropdown");
35926 if (position !== void 0) {
35927 external_wp_deprecated_default()("`position` prop in wp.components.Dropdown", {
35928 since: "6.2",
35929 alternative: "`popoverProps.placement` prop",
35930 hint: "Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."
35931 });
35932 }
35933 const [fallbackPopoverAnchor, setFallbackPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
35934 const containerRef = (0,external_wp_element_namespaceObject.useRef)();
35935 const [isOpen, setIsOpen] = useControlledValue({
35936 defaultValue: defaultOpen,
35937 value: open,
35938 onChange: onToggle
35939 });
35940 function closeIfFocusOutside() {
35941 if (!containerRef.current) {
35942 return;
35943 }
35944 const {
35945 ownerDocument
35946 } = containerRef.current;
35947 const dialog = ownerDocument?.activeElement?.closest('[role="dialog"]');
35948 if (!containerRef.current.contains(ownerDocument.activeElement) && (!dialog || dialog.contains(containerRef.current))) {
35949 close();
35950 }
35951 }
35952 function close() {
35953 onClose?.();
35954 setIsOpen(false);
35955 }
35956 const args = {
35957 isOpen: !!isOpen,
35958 onToggle: () => setIsOpen(!isOpen),
35959 onClose: close
35960 };
35961 const popoverPropsHaveAnchor = !!popoverProps?.anchor || // Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and
35962 // be removed from `Popover` from WordPress 6.3
35963 !!popoverProps?.anchorRef || !!popoverProps?.getAnchorRect || !!popoverProps?.anchorRect;
35964 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
35965 className,
35966 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, forwardedRef, setFallbackPopoverAnchor]),
35967 tabIndex: -1,
35968 style,
35969 children: [renderToggle(args), isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(popover_default, {
35970 position,
35971 onClose: close,
35972 onFocusOutside: closeIfFocusOutside,
35973 expandOnMobile,
35974 headerTitle,
35975 focusOnMount,
35976 offset: 13,
35977 anchor: !popoverPropsHaveAnchor ? fallbackPopoverAnchor : void 0,
35978 variant,
35979 ...popoverProps,
35980 className: dist_clsx("components-dropdown__content", popoverProps?.className, contentClassName),
35981 children: renderContent(args)
35982 })]
35983 });
35984};
35985const Dropdown = contextConnect(UnconnectedDropdown, "Dropdown");
35986var dropdown_default = Dropdown;
35987
35988
35989;// ./node_modules/@wordpress/components/build-module/input-control/input-suffix-wrapper.js
35990
35991
35992
35993function UnconnectedInputControlSuffixWrapper(props, forwardedRef) {
35994 const derivedProps = useContextSystem(props, "InputControlSuffixWrapper");
35995 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrefixSuffixWrapper, {
35996 ...derivedProps,
35997 ref: forwardedRef
35998 });
35999}
36000const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWrapper, "InputControlSuffixWrapper");
36001var input_suffix_wrapper_default = InputControlSuffixWrapper;
36002
36003
36004;// ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js
36005
36006function select_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
36007 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
36008}
36009
36010
36011
36012
36013
36014
36015const select_control_styles_disabledStyles = ({
36016 disabled
36017}) => {
36018 if (!disabled) {
36019 return "";
36020 }
36021 return /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.ui.textDisabled, ";cursor:default;" + ( true ? "" : 0), true ? "" : 0);
36022};
36023var select_control_styles_ref2 = true ? {
36024 name: "1lv1yo7",
36025 styles: "display:inline-flex"
36026} : 0;
36027const inputBaseVariantStyles = ({
36028 variant
36029}) => {
36030 if (variant === "minimal") {
36031 return select_control_styles_ref2;
36032 }
36033 return "";
36034};
36035const StyledInputBase = /* @__PURE__ */ emotion_styled_base_browser_esm(input_base_default, true ? {
36036 target: "e1mv6sxx3"
36037} : 0)("color:", COLORS.theme.foreground, ";cursor:pointer;", select_control_styles_disabledStyles, " ", inputBaseVariantStyles, ";" + ( true ? "" : 0));
36038const select_control_styles_sizeStyles = ({
36039 __next40pxDefaultSize,
36040 multiple,
36041 selectSize = "default"
36042}) => {
36043 if (multiple) {
36044 return;
36045 }
36046 const sizes = {
36047 default: {
36048 height: 40,
36049 minHeight: 40,
36050 paddingTop: 0,
36051 paddingBottom: 0
36052 },
36053 small: {
36054 height: 24,
36055 minHeight: 24,
36056 paddingTop: 0,
36057 paddingBottom: 0
36058 },
36059 compact: {
36060 height: 32,
36061 minHeight: 32,
36062 paddingTop: 0,
36063 paddingBottom: 0
36064 },
36065 "__unstable-large": {
36066 height: 40,
36067 minHeight: 40,
36068 paddingTop: 0,
36069 paddingBottom: 0
36070 }
36071 };
36072 if (!__next40pxDefaultSize) {
36073 sizes.default = sizes.compact;
36074 }
36075 const style = sizes[selectSize] || sizes.default;
36076 return /* @__PURE__ */ emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0);
36077};
36078const chevronIconSize = 18;
36079const sizePaddings = ({
36080 __next40pxDefaultSize,
36081 multiple,
36082 selectSize = "default"
36083}) => {
36084 const padding = {
36085 default: config_values_default.controlPaddingX,
36086 small: config_values_default.controlPaddingXSmall,
36087 compact: config_values_default.controlPaddingXSmall,
36088 "__unstable-large": config_values_default.controlPaddingX
36089 };
36090 if (!__next40pxDefaultSize) {
36091 padding.default = padding.compact;
36092 }
36093 const selectedPadding = padding[selectSize] || padding.default;
36094 return rtl({
36095 paddingLeft: selectedPadding,
36096 paddingRight: selectedPadding + chevronIconSize,
36097 ...multiple ? {
36098 paddingTop: selectedPadding,
36099 paddingBottom: selectedPadding
36100 } : {}
36101 });
36102};
36103const overflowStyles = ({
36104 multiple
36105}) => {
36106 return {
36107 overflow: multiple ? "auto" : "hidden"
36108 };
36109};
36110var select_control_styles_ref = true ? {
36111 name: "n1jncc",
36112 styles: "field-sizing:content"
36113} : 0;
36114const variantStyles = ({
36115 variant
36116}) => {
36117 if (variant === "minimal") {
36118 return select_control_styles_ref;
36119 }
36120 return "";
36121};
36122const Select = /* @__PURE__ */ emotion_styled_base_browser_esm("select", true ? {
36123 target: "e1mv6sxx2"
36124} : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;", fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, " ", variantStyles, ";}" + ( true ? "" : 0));
36125const DownArrowWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
36126 target: "e1mv6sxx1"
36127} : 0)("margin-inline-end:", space(-1), ";line-height:0;path{fill:currentColor;}" + ( true ? "" : 0));
36128const InputControlSuffixWrapperWithClickThrough = /* @__PURE__ */ emotion_styled_base_browser_esm(input_suffix_wrapper_default, true ? {
36129 target: "e1mv6sxx0"
36130} : 0)("position:absolute;pointer-events:none;", rtl({
36131 right: 0
36132}), ";" + ( true ? "" : 0));
36133
36134
36135;// ./node_modules/@wordpress/icons/build-module/icon/index.js
36136
36137var build_module_icon_icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
36138 ({ icon, size = 24, ...props }, ref) => {
36139 return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
36140 width: size,
36141 height: size,
36142 ...props,
36143 ref
36144 });
36145 }
36146);
36147
36148
36149;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
36150
36151
36152var chevron_down_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });
36153
36154
36155;// ./node_modules/@wordpress/components/build-module/select-control/chevron-down.js
36156
36157
36158
36159const SelectControlChevronDown = () => {
36160 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlSuffixWrapperWithClickThrough, {
36161 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DownArrowWrapper, {
36162 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
36163 icon: chevron_down_default,
36164 size: chevronIconSize
36165 })
36166 })
36167 });
36168};
36169var chevron_down_chevron_down_default = SelectControlChevronDown;
36170
36171
36172;// ./node_modules/@wordpress/components/build-module/select-control/index.js
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182function select_control_useUniqueId(idProp) {
36183 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SelectControl);
36184 const id = `inspector-select-control-${instanceId}`;
36185 return idProp || id;
36186}
36187function SelectOptions({
36188 options
36189}) {
36190 return options.map(({
36191 id,
36192 label,
36193 value,
36194 ...optionProps
36195 }, index) => {
36196 const key = id || `${label}-${value}-${index}`;
36197 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", {
36198 value,
36199 ...optionProps,
36200 children: label
36201 }, key);
36202 });
36203}
36204function UnforwardedSelectControl(props, ref) {
36205 const {
36206 className,
36207 disabled = false,
36208 help,
36209 hideLabelFromVision,
36210 id: idProp,
36211 label,
36212 multiple = false,
36213 onChange,
36214 options = [],
36215 size = "default",
36216 value: valueProp,
36217 labelPosition = "top",
36218 children,
36219 prefix,
36220 suffix,
36221 variant = "default",
36222 __next40pxDefaultSize = false,
36223 __nextHasNoMarginBottom = false,
36224 __shouldNotWarnDeprecated36pxSize,
36225 ...restProps
36226 } = useDeprecated36pxDefaultSizeProp(props);
36227 const id = select_control_useUniqueId(idProp);
36228 const helpId = help ? `${id}__help` : void 0;
36229 if (!options?.length && !children) {
36230 return null;
36231 }
36232 const handleOnChange = (event) => {
36233 if (props.multiple) {
36234 const selectedOptions = Array.from(event.target.options).filter(({
36235 selected
36236 }) => selected);
36237 const newValues = selectedOptions.map(({
36238 value
36239 }) => value);
36240 props.onChange?.(newValues, {
36241 event
36242 });
36243 return;
36244 }
36245 props.onChange?.(event.target.value, {
36246 event
36247 });
36248 };
36249 const classes = dist_clsx("components-select-control", className);
36250 maybeWarnDeprecated36pxSize({
36251 componentName: "SelectControl",
36252 __next40pxDefaultSize,
36253 size,
36254 __shouldNotWarnDeprecated36pxSize
36255 });
36256 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
36257 help,
36258 id,
36259 className: classes,
36260 __nextHasNoMarginBottom,
36261 __associatedWPComponentName: "SelectControl",
36262 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledInputBase, {
36263 disabled,
36264 hideLabelFromVision,
36265 id,
36266 isBorderless: variant === "minimal",
36267 label,
36268 size,
36269 suffix: suffix || !multiple && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(chevron_down_chevron_down_default, {}),
36270 prefix,
36271 labelPosition,
36272 __unstableInputWidth: variant === "minimal" ? "auto" : void 0,
36273 variant,
36274 __next40pxDefaultSize,
36275 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Select, {
36276 ...restProps,
36277 __next40pxDefaultSize,
36278 "aria-describedby": helpId,
36279 className: "components-select-control__input",
36280 disabled,
36281 id,
36282 multiple,
36283 onChange: handleOnChange,
36284 ref,
36285 selectSize: size,
36286 value: valueProp,
36287 variant,
36288 children: children || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectOptions, {
36289 options
36290 })
36291 })
36292 })
36293 });
36294}
36295const SelectControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSelectControl);
36296var select_control_default = SelectControl;
36297
36298
36299;// ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js
36300
36301
36302const defaultOptions = {
36303 initial: void 0,
36304 /**
36305 * Defaults to empty string, as that is preferred for usage with
36306 * <input />, <textarea />, and <select /> form elements.
36307 */
36308 fallback: ""
36309};
36310function useControlledState(currentState, options = defaultOptions) {
36311 const {
36312 initial,
36313 fallback
36314 } = {
36315 ...defaultOptions,
36316 ...options
36317 };
36318 const [internalState, setInternalState] = (0,external_wp_element_namespaceObject.useState)(currentState);
36319 const hasCurrentState = isValueDefined(currentState);
36320 (0,external_wp_element_namespaceObject.useEffect)(() => {
36321 if (hasCurrentState && internalState) {
36322 setInternalState(void 0);
36323 }
36324 }, [hasCurrentState, internalState]);
36325 const state = getDefinedValue([currentState, internalState, initial], fallback);
36326 const setState = (0,external_wp_element_namespaceObject.useCallback)((nextState) => {
36327 if (!hasCurrentState) {
36328 setInternalState(nextState);
36329 }
36330 }, [hasCurrentState]);
36331 return [state, setState];
36332}
36333var use_controlled_state_default = useControlledState;
36334
36335
36336;// ./node_modules/@wordpress/components/build-module/range-control/utils.js
36337
36338
36339
36340function floatClamp(value, min, max) {
36341 if (typeof value !== "number") {
36342 return null;
36343 }
36344 return parseFloat(`${math_clamp(value, min, max)}`);
36345}
36346function useControlledRangeValue(settings) {
36347 const {
36348 min,
36349 max,
36350 value: valueProp,
36351 initial
36352 } = settings;
36353 const [state, setInternalState] = use_controlled_state_default(floatClamp(valueProp, min, max), {
36354 initial: floatClamp(initial !== null && initial !== void 0 ? initial : null, min, max),
36355 fallback: null
36356 });
36357 const setState = (0,external_wp_element_namespaceObject.useCallback)((nextValue) => {
36358 if (nextValue === null) {
36359 setInternalState(null);
36360 } else {
36361 setInternalState(floatClamp(nextValue, min, max));
36362 }
36363 }, [min, max, setInternalState]);
36364 return [state, setState];
36365}
36366
36367
36368;// ./node_modules/@wordpress/components/build-module/range-control/styles/range-control-styles.js
36369
36370function range_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
36371 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
36372}
36373
36374
36375
36376
36377const rangeHeightValue = 30;
36378const railHeight = 4;
36379const rangeHeight = () => /* @__PURE__ */ emotion_react_browser_esm_css({
36380 height: rangeHeightValue,
36381 minHeight: rangeHeightValue
36382}, true ? "" : 0, true ? "" : 0);
36383const thumbSize = 12;
36384const deprecatedHeight = ({
36385 __next40pxDefaultSize
36386}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css({
36387 minHeight: rangeHeightValue
36388}, true ? "" : 0, true ? "" : 0);
36389const range_control_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
36390 target: "e1epgpqk14"
36391} : 0)("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;", deprecatedHeight, ";" + ( true ? "" : 0));
36392const wrapperColor = ({
36393 color = COLORS.ui.borderFocus
36394}) => /* @__PURE__ */ emotion_react_browser_esm_css({
36395 color
36396}, true ? "" : 0, true ? "" : 0);
36397const wrapperMargin = ({
36398 marks,
36399 __nextHasNoMarginBottom
36400}) => {
36401 if (!__nextHasNoMarginBottom) {
36402 return /* @__PURE__ */ emotion_react_browser_esm_css({
36403 marginBottom: marks ? 16 : void 0
36404 }, true ? "" : 0, true ? "" : 0);
36405 }
36406 return "";
36407};
36408const range_control_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
36409 shouldForwardProp: (prop) => !["color", "__nextHasNoMarginBottom", "marks"].includes(prop),
36410 target: "e1epgpqk13"
36411} : 0)("display:block;flex:1;position:relative;width:100%;", wrapperColor, ";", rangeHeight, ";", wrapperMargin, ";" + ( true ? "" : 0));
36412const BeforeIconWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36413 target: "e1epgpqk12"
36414} : 0)("display:flex;margin-top:", railHeight, "px;", rtl({
36415 marginRight: 6
36416}), ";" + ( true ? "" : 0));
36417const AfterIconWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36418 target: "e1epgpqk11"
36419} : 0)("display:flex;margin-top:", railHeight, "px;", rtl({
36420 marginLeft: 6
36421}), ";" + ( true ? "" : 0));
36422const railBackgroundColor = ({
36423 disabled,
36424 railColor
36425}) => {
36426 let background = railColor || "";
36427 if (disabled) {
36428 background = COLORS.ui.backgroundDisabled;
36429 }
36430 return /* @__PURE__ */ emotion_react_browser_esm_css({
36431 background
36432 }, true ? "" : 0, true ? "" : 0);
36433};
36434const Rail = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36435 target: "e1epgpqk10"
36436} : 0)("background-color:", COLORS.gray[300], ";left:0;pointer-events:none;right:0;display:block;height:", railHeight, "px;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;border-radius:", config_values_default.radiusFull, ";", railBackgroundColor, ";" + ( true ? "" : 0));
36437const trackBackgroundColor = ({
36438 disabled,
36439 trackColor
36440}) => {
36441 let background = trackColor || "currentColor";
36442 if (disabled) {
36443 background = COLORS.gray[400];
36444 }
36445 return /* @__PURE__ */ emotion_react_browser_esm_css({
36446 background
36447 }, true ? "" : 0, true ? "" : 0);
36448};
36449const Track = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36450 target: "e1epgpqk9"
36451} : 0)("background-color:currentColor;border-radius:", config_values_default.radiusFull, ";height:", railHeight, "px;pointer-events:none;display:block;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;.is-marked &{@media not ( prefers-reduced-motion ){transition:width ease 0.1s;}}", trackBackgroundColor, ";" + ( true ? "" : 0));
36452const MarksWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36453 target: "e1epgpqk8"
36454} : 0)( true ? {
36455 name: "g5kg28",
36456 styles: "display:block;pointer-events:none;position:relative;width:100%;user-select:none;margin-top:17px"
36457} : 0);
36458const Mark = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36459 target: "e1epgpqk7"
36460} : 0)("position:absolute;left:0;top:-4px;height:4px;width:2px;transform:translateX( -50% );background-color:", COLORS.ui.background, ";z-index:1;" + ( true ? "" : 0));
36461const markLabelFill = ({
36462 isFilled
36463}) => {
36464 return /* @__PURE__ */ emotion_react_browser_esm_css({
36465 color: isFilled ? COLORS.gray[700] : COLORS.gray[300]
36466 }, true ? "" : 0, true ? "" : 0);
36467};
36468const MarkLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36469 target: "e1epgpqk6"
36470} : 0)("color:", COLORS.gray[300], ";font-size:11px;position:absolute;top:8px;white-space:nowrap;", rtl({
36471 left: 0
36472}), ";", rtl({
36473 transform: "translateX( -50% )"
36474}, {
36475 transform: "translateX( 50% )"
36476}), ";", markLabelFill, ";" + ( true ? "" : 0));
36477const thumbColor = ({
36478 disabled
36479}) => disabled ? /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.gray[400], ";" + ( true ? "" : 0), true ? "" : 0) : /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.theme.accent, ";" + ( true ? "" : 0), true ? "" : 0);
36480const ThumbWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36481 target: "e1epgpqk5"
36482} : 0)("align-items:center;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:", (rangeHeightValue - thumbSize) / 2, "px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;border-radius:", config_values_default.radiusRound, ";z-index:3;.is-marked &{@media not ( prefers-reduced-motion ){transition:left ease 0.1s;}}", thumbColor, ";", rtl({
36483 marginLeft: -10
36484}), ";", rtl({
36485 transform: "translateX( 4.5px )"
36486}, {
36487 transform: "translateX( -4.5px )"
36488}), ";" + ( true ? "" : 0));
36489const thumbFocus = ({
36490 isFocused
36491}) => {
36492 return isFocused ? /* @__PURE__ */ emotion_react_browser_esm_css("&::before{content:' ';position:absolute;background-color:", COLORS.theme.accent, ";opacity:0.4;border-radius:", config_values_default.radiusRound, ";height:", thumbSize + 8, "px;width:", thumbSize + 8, "px;top:-4px;left:-4px;}" + ( true ? "" : 0), true ? "" : 0) : "";
36493};
36494const Thumb = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36495 target: "e1epgpqk4"
36496} : 0)("align-items:center;border-radius:", config_values_default.radiusRound, ";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:", config_values_default.elevationXSmall, ";", thumbColor, ";", thumbFocus, ";" + ( true ? "" : 0));
36497const InputRange = /* @__PURE__ */ emotion_styled_base_browser_esm("input", true ? {
36498 target: "e1epgpqk3"
36499} : 0)("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : 0));
36500const tooltipShow = ({
36501 show
36502}) => {
36503 return /* @__PURE__ */ emotion_react_browser_esm_css("display:", show ? "inline-block" : "none", ";opacity:", show ? 1 : 0, ";@media not ( prefers-reduced-motion ){transition:opacity 120ms ease,display 120ms ease allow-discrete;}@starting-style{opacity:0;}" + ( true ? "" : 0), true ? "" : 0);
36504};
36505var range_control_styles_ref = true ? {
36506 name: "1cypxip",
36507 styles: "top:-80%"
36508} : 0;
36509var range_control_styles_ref2 = true ? {
36510 name: "1lr98c4",
36511 styles: "bottom:-80%"
36512} : 0;
36513const tooltipPlacement = ({
36514 placement
36515}) => {
36516 const isBottom = placement === "bottom";
36517 if (isBottom) {
36518 return range_control_styles_ref2;
36519 }
36520 return range_control_styles_ref;
36521};
36522const range_control_styles_Tooltip = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36523 target: "e1epgpqk2"
36524} : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:", config_values_default.radiusSmall, ";color:white;font-size:12px;min-width:32px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;", tooltipShow, ";", tooltipPlacement, ";", rtl({
36525 transform: "translateX(-50%)"
36526}, {
36527 transform: "translateX(50%)"
36528}), ";" + ( true ? "" : 0));
36529const InputNumber = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
36530 target: "e1epgpqk1"
36531} : 0)("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{", rangeHeight, ";}", rtl({
36532 marginLeft: `${space(4)} !important`
36533}), ";" + ( true ? "" : 0));
36534const ActionRightWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
36535 target: "e1epgpqk0"
36536} : 0)("display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl({
36537 marginLeft: 8
36538}), ";" + ( true ? "" : 0));
36539
36540
36541;// ./node_modules/@wordpress/components/build-module/range-control/input-range.js
36542
36543
36544
36545function input_range_InputRange(props, ref) {
36546 const {
36547 describedBy,
36548 label,
36549 value,
36550 ...otherProps
36551 } = props;
36552 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputRange, {
36553 ...otherProps,
36554 "aria-describedby": describedBy,
36555 "aria-label": label,
36556 "aria-hidden": false,
36557 ref,
36558 tabIndex: 0,
36559 type: "range",
36560 value
36561 });
36562}
36563const input_range_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(input_range_InputRange);
36564var input_range_default = input_range_ForwardedComponent;
36565
36566
36567;// ./node_modules/@wordpress/components/build-module/range-control/mark.js
36568
36569
36570
36571function RangeMark(props) {
36572 const {
36573 className,
36574 isFilled = false,
36575 label,
36576 style = {},
36577 ...otherProps
36578 } = props;
36579 const classes = dist_clsx("components-range-control__mark", isFilled && "is-filled", className);
36580 const labelClasses = dist_clsx("components-range-control__mark-label", isFilled && "is-filled");
36581 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
36582 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Mark, {
36583 ...otherProps,
36584 "aria-hidden": "true",
36585 className: classes,
36586 style
36587 }), label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MarkLabel, {
36588 "aria-hidden": "true",
36589 className: labelClasses,
36590 isFilled,
36591 style,
36592 children: label
36593 })]
36594 });
36595}
36596
36597
36598;// ./node_modules/@wordpress/components/build-module/range-control/rail.js
36599
36600
36601
36602
36603
36604function RangeRail(props) {
36605 const {
36606 disabled = false,
36607 marks = false,
36608 min = 0,
36609 max = 100,
36610 step = 1,
36611 value = 0,
36612 ...restProps
36613 } = props;
36614 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
36615 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Rail, {
36616 disabled,
36617 ...restProps
36618 }), marks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Marks, {
36619 disabled,
36620 marks,
36621 min,
36622 max,
36623 step,
36624 value
36625 })]
36626 });
36627}
36628function Marks(props) {
36629 const {
36630 disabled = false,
36631 marks = false,
36632 min = 0,
36633 max = 100,
36634 step: stepProp = 1,
36635 value = 0
36636 } = props;
36637 const step = stepProp === "any" ? 1 : stepProp;
36638 const marksData = useMarks({
36639 marks,
36640 min,
36641 max,
36642 step,
36643 value
36644 });
36645 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MarksWrapper, {
36646 "aria-hidden": "true",
36647 className: "components-range-control__marks",
36648 children: marksData.map((mark) => /* @__PURE__ */ (0,external_React_.createElement)(RangeMark, {
36649 ...mark,
36650 key: mark.key,
36651 "aria-hidden": "true",
36652 disabled
36653 }))
36654 });
36655}
36656function useMarks({
36657 marks,
36658 min = 0,
36659 max = 100,
36660 step = 1,
36661 value = 0
36662}) {
36663 if (!marks) {
36664 return [];
36665 }
36666 const range = max - min;
36667 if (!Array.isArray(marks)) {
36668 marks = [];
36669 const count = 1 + Math.round(range / step);
36670 while (count > marks.push({
36671 value: step * marks.length + min
36672 })) {
36673 }
36674 }
36675 const placedMarks = [];
36676 marks.forEach((mark, index) => {
36677 if (mark.value < min || mark.value > max) {
36678 return;
36679 }
36680 const key = `mark-${index}`;
36681 const isFilled = mark.value <= value;
36682 const offset = `${(mark.value - min) / range * 100}%`;
36683 const offsetStyle = {
36684 [(0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left"]: offset
36685 };
36686 placedMarks.push({
36687 ...mark,
36688 isFilled,
36689 key,
36690 style: offsetStyle
36691 });
36692 });
36693 return placedMarks;
36694}
36695
36696
36697;// ./node_modules/@wordpress/components/build-module/range-control/tooltip.js
36698
36699
36700
36701
36702function SimpleTooltip(props) {
36703 const {
36704 className,
36705 inputRef,
36706 tooltipPlacement,
36707 show = false,
36708 style = {},
36709 value = 0,
36710 renderTooltipContent = (v) => v,
36711 zIndex = 100,
36712 ...restProps
36713 } = props;
36714 const placement = useTooltipPlacement({
36715 inputRef,
36716 tooltipPlacement
36717 });
36718 const classes = dist_clsx("components-simple-tooltip", className);
36719 const styles = {
36720 ...style,
36721 zIndex
36722 };
36723 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_styles_Tooltip, {
36724 ...restProps,
36725 "aria-hidden": "false",
36726 className: classes,
36727 placement,
36728 show,
36729 role: "tooltip",
36730 style: styles,
36731 children: renderTooltipContent(value)
36732 });
36733}
36734function useTooltipPlacement({
36735 inputRef,
36736 tooltipPlacement
36737}) {
36738 const [placement, setPlacement] = (0,external_wp_element_namespaceObject.useState)();
36739 const setTooltipPlacement = (0,external_wp_element_namespaceObject.useCallback)(() => {
36740 if (inputRef && inputRef.current) {
36741 setPlacement(tooltipPlacement);
36742 }
36743 }, [tooltipPlacement, inputRef]);
36744 (0,external_wp_element_namespaceObject.useEffect)(() => {
36745 setTooltipPlacement();
36746 }, [setTooltipPlacement]);
36747 (0,external_wp_element_namespaceObject.useEffect)(() => {
36748 window.addEventListener("resize", setTooltipPlacement);
36749 return () => {
36750 window.removeEventListener("resize", setTooltipPlacement);
36751 };
36752 });
36753 return placement;
36754}
36755
36756
36757;// ./node_modules/@wordpress/components/build-module/range-control/index.js
36758
36759
36760
36761
36762
36763
36764
36765
36766
36767
36768
36769
36770
36771
36772
36773
36774
36775const range_control_noop = () => {
36776};
36777function computeResetValue({
36778 resetFallbackValue,
36779 initialPosition
36780}) {
36781 if (resetFallbackValue !== void 0) {
36782 return !Number.isNaN(resetFallbackValue) ? resetFallbackValue : null;
36783 }
36784 if (initialPosition !== void 0) {
36785 return !Number.isNaN(initialPosition) ? initialPosition : null;
36786 }
36787 return null;
36788}
36789function UnforwardedRangeControl(props, forwardedRef) {
36790 const {
36791 __nextHasNoMarginBottom = false,
36792 afterIcon,
36793 allowReset = false,
36794 beforeIcon,
36795 className,
36796 color: colorProp = COLORS.theme.accent,
36797 currentInput,
36798 disabled = false,
36799 help,
36800 hideLabelFromVision = false,
36801 initialPosition,
36802 isShiftStepEnabled = true,
36803 label,
36804 marks = false,
36805 max = 100,
36806 min = 0,
36807 onBlur = range_control_noop,
36808 onChange = range_control_noop,
36809 onFocus = range_control_noop,
36810 onMouseLeave = range_control_noop,
36811 onMouseMove = range_control_noop,
36812 railColor,
36813 renderTooltipContent = (v) => v,
36814 resetFallbackValue,
36815 __next40pxDefaultSize = false,
36816 shiftStep = 10,
36817 showTooltip: showTooltipProp,
36818 step = 1,
36819 trackColor,
36820 value: valueProp,
36821 withInputField = true,
36822 __shouldNotWarnDeprecated36pxSize,
36823 ...otherProps
36824 } = props;
36825 const [value, setValue] = useControlledRangeValue({
36826 min,
36827 max,
36828 value: valueProp !== null && valueProp !== void 0 ? valueProp : null,
36829 initial: initialPosition
36830 });
36831 const isResetPendent = (0,external_wp_element_namespaceObject.useRef)(false);
36832 let hasTooltip = showTooltipProp;
36833 let hasInputField = withInputField;
36834 if (step === "any") {
36835 hasTooltip = false;
36836 hasInputField = false;
36837 }
36838 const [showTooltip, setShowTooltip] = (0,external_wp_element_namespaceObject.useState)(hasTooltip);
36839 const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false);
36840 const inputRef = (0,external_wp_element_namespaceObject.useRef)();
36841 const isCurrentlyFocused = inputRef.current?.matches(":focus");
36842 const isThumbFocused = !disabled && isFocused;
36843 const isValueReset = value === null;
36844 const currentValue = value !== void 0 ? value : currentInput;
36845 const inputSliderValue = isValueReset ? "" : currentValue;
36846 const rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
36847 const fillValue = isValueReset ? 50 : (value - min) / (max - min) * 100;
36848 const fillValueOffset = `${math_clamp(fillValue, 0, 100)}%`;
36849 const classes = dist_clsx("components-range-control", className);
36850 const wrapperClasses = dist_clsx("components-range-control__wrapper", !!marks && "is-marked");
36851 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedRangeControl, "inspector-range-control");
36852 const describedBy = !!help ? `${id}__help` : void 0;
36853 const enableTooltip = hasTooltip !== false && Number.isFinite(value);
36854 const handleOnRangeChange = (event) => {
36855 const nextValue = parseFloat(event.target.value);
36856 setValue(nextValue);
36857 onChange(nextValue);
36858 };
36859 const handleOnChange = (next) => {
36860 let nextValue = parseFloat(next);
36861 setValue(nextValue);
36862 if (!isNaN(nextValue)) {
36863 if (nextValue < min || nextValue > max) {
36864 nextValue = floatClamp(nextValue, min, max);
36865 }
36866 onChange(nextValue);
36867 isResetPendent.current = false;
36868 } else if (allowReset) {
36869 isResetPendent.current = true;
36870 }
36871 };
36872 const handleOnInputNumberBlur = () => {
36873 if (isResetPendent.current) {
36874 handleOnReset();
36875 isResetPendent.current = false;
36876 }
36877 };
36878 const handleOnReset = () => {
36879 const resetValue = Number.isNaN(resetFallbackValue) ? null : resetFallbackValue !== null && resetFallbackValue !== void 0 ? resetFallbackValue : null;
36880 setValue(resetValue);
36881 onChange(resetValue !== null && resetValue !== void 0 ? resetValue : void 0);
36882 };
36883 const handleShowTooltip = () => setShowTooltip(true);
36884 const handleHideTooltip = () => setShowTooltip(false);
36885 const handleOnBlur = (event) => {
36886 onBlur(event);
36887 setIsFocused(false);
36888 handleHideTooltip();
36889 };
36890 const handleOnFocus = (event) => {
36891 onFocus(event);
36892 setIsFocused(true);
36893 handleShowTooltip();
36894 };
36895 const offsetStyle = {
36896 [(0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left"]: fillValueOffset
36897 };
36898 maybeWarnDeprecated36pxSize({
36899 componentName: "RangeControl",
36900 __next40pxDefaultSize,
36901 size: void 0,
36902 __shouldNotWarnDeprecated36pxSize
36903 });
36904 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
36905 __nextHasNoMarginBottom,
36906 __associatedWPComponentName: "RangeControl",
36907 className: classes,
36908 label,
36909 hideLabelFromVision,
36910 id: `${id}`,
36911 help,
36912 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Root, {
36913 className: "components-range-control__root",
36914 __next40pxDefaultSize,
36915 children: [beforeIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BeforeIconWrapper, {
36916 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
36917 icon: beforeIcon
36918 })
36919 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Wrapper, {
36920 __nextHasNoMarginBottom,
36921 className: wrapperClasses,
36922 color: colorProp,
36923 marks: !!marks,
36924 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_range_default, {
36925 ...otherProps,
36926 className: "components-range-control__slider",
36927 describedBy,
36928 disabled,
36929 id: `${id}`,
36930 label,
36931 max,
36932 min,
36933 onBlur: handleOnBlur,
36934 onChange: handleOnRangeChange,
36935 onFocus: handleOnFocus,
36936 onMouseMove,
36937 onMouseLeave,
36938 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]),
36939 step,
36940 value: inputSliderValue !== null && inputSliderValue !== void 0 ? inputSliderValue : void 0
36941 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RangeRail, {
36942 "aria-hidden": true,
36943 disabled,
36944 marks,
36945 max,
36946 min,
36947 railColor,
36948 step,
36949 value: rangeFillValue
36950 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Track, {
36951 "aria-hidden": true,
36952 className: "components-range-control__track",
36953 disabled,
36954 style: {
36955 width: fillValueOffset
36956 },
36957 trackColor
36958 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ThumbWrapper, {
36959 className: "components-range-control__thumb-wrapper",
36960 style: offsetStyle,
36961 disabled,
36962 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Thumb, {
36963 "aria-hidden": true,
36964 isFocused: isThumbFocused,
36965 disabled
36966 })
36967 }), enableTooltip && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SimpleTooltip, {
36968 className: "components-range-control__tooltip",
36969 inputRef,
36970 tooltipPlacement: "bottom",
36971 renderTooltipContent,
36972 show: isCurrentlyFocused || showTooltip,
36973 style: offsetStyle,
36974 value
36975 })]
36976 }), afterIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AfterIconWrapper, {
36977 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
36978 icon: afterIcon
36979 })
36980 }), hasInputField && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputNumber, {
36981 "aria-label": label,
36982 className: "components-range-control__number",
36983 disabled,
36984 inputMode: "decimal",
36985 isShiftStepEnabled,
36986 max,
36987 min,
36988 onBlur: handleOnInputNumberBlur,
36989 onChange: handleOnChange,
36990 shiftStep,
36991 size: __next40pxDefaultSize ? "__unstable-large" : "default",
36992 __unstableInputWidth: __next40pxDefaultSize ? space(20) : space(16),
36993 step,
36994 value: inputSliderValue,
36995 __shouldNotWarnDeprecated36pxSize: true
36996 }), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionRightWrapper, {
36997 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
36998 className: "components-range-control__reset",
36999 accessibleWhenDisabled: !disabled,
37000 disabled: disabled || value === computeResetValue({
37001 resetFallbackValue,
37002 initialPosition
37003 }),
37004 variant: "secondary",
37005 size: "small",
37006 onClick: handleOnReset,
37007 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
37008 })
37009 })]
37010 })
37011 });
37012}
37013const RangeControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRangeControl);
37014var range_control_default = RangeControl;
37015
37016
37017;// ./node_modules/@wordpress/components/build-module/color-picker/styles.js
37018
37019
37020
37021
37022
37023
37024
37025
37026
37027const NumberControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
37028 target: "ez9hsf46"
37029} : 0)("width:", space(24), ";" + ( true ? "" : 0));
37030const styles_SelectControl = /* @__PURE__ */ emotion_styled_base_browser_esm(select_control_default, true ? {
37031 target: "ez9hsf45"
37032} : 0)("margin-left:", space(-2), ";" + ( true ? "" : 0));
37033const styles_RangeControl = /* @__PURE__ */ emotion_styled_base_browser_esm(range_control_default, true ? {
37034 target: "ez9hsf44"
37035} : 0)("flex:1;margin-right:", space(2), ";" + ( true ? "" : 0));
37036const interactiveHueStyles = `
37037.react-colorful__interactive {
37038 width: calc( 100% - ${space(2)} );
37039 margin-left: ${space(1)};
37040}`;
37041const AuxiliaryColorArtefactWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
37042 target: "ez9hsf43"
37043} : 0)("padding-top:", space(2), ";padding-right:0;padding-left:0;padding-bottom:0;" + ( true ? "" : 0));
37044const AuxiliaryColorArtefactHStackHeader = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
37045 target: "ez9hsf42"
37046} : 0)("padding-left:", space(4), ";padding-right:", space(4), ";" + ( true ? "" : 0));
37047const ColorInputWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
37048 target: "ez9hsf41"
37049} : 0)("padding-top:", space(4), ";padding-left:", space(4), ";padding-right:", space(3), ";padding-bottom:", space(5), ";" + ( true ? "" : 0));
37050const ColorfulWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
37051 target: "ez9hsf40"
37052} : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:", config_values_default.radiusFull, ";margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;@media not ( prefers-reduced-motion ){transition:transform ", config_values_default.transitionDurationFast, " ease-in-out;}}.react-colorful__interactive:focus .react-colorful__pointer{box-shadow:0 0 0 ", config_values_default.borderWidthFocus, " ", config_values_default.surfaceColor, ";border:", config_values_default.borderWidthFocus, " solid black;transform:translate( -50%, -50% ) scale( 1.5 );}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values_default.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0));
37053
37054
37055;// ./node_modules/@wordpress/icons/build-module/library/check.js
37056
37057
37058var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
37059
37060
37061;// ./node_modules/@wordpress/icons/build-module/library/copy.js
37062
37063
37064var copy_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
37065 external_wp_primitives_namespaceObject.Path,
37066 {
37067 fillRule: "evenodd",
37068 clipRule: "evenodd",
37069 d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"
37070 }
37071) });
37072
37073
37074;// ./node_modules/@wordpress/components/build-module/color-picker/color-copy-button.js
37075
37076
37077
37078
37079
37080
37081
37082const ColorCopyButton = (props) => {
37083 const {
37084 color,
37085 colorType
37086 } = props;
37087 const [copiedColor, setCopiedColor] = (0,external_wp_element_namespaceObject.useState)(null);
37088 const copyTimerRef = (0,external_wp_element_namespaceObject.useRef)();
37089 const copyRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(() => {
37090 switch (colorType) {
37091 case "hsl": {
37092 return color.toHslString();
37093 }
37094 case "rgb": {
37095 return color.toRgbString();
37096 }
37097 default:
37098 case "hex": {
37099 return color.toHex();
37100 }
37101 }
37102 }, () => {
37103 if (copyTimerRef.current) {
37104 clearTimeout(copyTimerRef.current);
37105 }
37106 setCopiedColor(color.toHex());
37107 copyTimerRef.current = setTimeout(() => {
37108 setCopiedColor(null);
37109 copyTimerRef.current = void 0;
37110 }, 3e3);
37111 });
37112 (0,external_wp_element_namespaceObject.useEffect)(() => {
37113 return () => {
37114 if (copyTimerRef.current) {
37115 clearTimeout(copyTimerRef.current);
37116 }
37117 };
37118 }, []);
37119 const isCopied = copiedColor === color.toHex();
37120 const label = isCopied ? (0,external_wp_i18n_namespaceObject.__)("Copied!") : (0,external_wp_i18n_namespaceObject.__)("Copy");
37121 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
37122 delay: 0,
37123 hideOnClick: false,
37124 text: label,
37125 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Button, {
37126 size: "compact",
37127 "aria-label": label,
37128 ref: copyRef,
37129 icon: isCopied ? check_default : copy_default,
37130 showTooltip: false
37131 })
37132 });
37133};
37134
37135
37136;// ./node_modules/@wordpress/components/build-module/input-control/input-prefix-wrapper.js
37137
37138
37139
37140function UnconnectedInputControlPrefixWrapper(props, forwardedRef) {
37141 const derivedProps = useContextSystem(props, "InputControlPrefixWrapper");
37142 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PrefixSuffixWrapper, {
37143 ...derivedProps,
37144 isPrefix: true,
37145 ref: forwardedRef
37146 });
37147}
37148const InputControlPrefixWrapper = contextConnect(UnconnectedInputControlPrefixWrapper, "InputControlPrefixWrapper");
37149var input_prefix_wrapper_default = InputControlPrefixWrapper;
37150
37151
37152;// ./node_modules/@wordpress/components/build-module/color-picker/input-with-slider.js
37153
37154
37155
37156
37157
37158
37159const InputWithSlider = ({
37160 min,
37161 max,
37162 label,
37163 abbreviation,
37164 onChange,
37165 value
37166}) => {
37167 const onNumberControlChange = (newValue) => {
37168 if (!newValue) {
37169 onChange(0);
37170 return;
37171 }
37172 if (typeof newValue === "string") {
37173 onChange(parseInt(newValue, 10));
37174 return;
37175 }
37176 onChange(newValue);
37177 };
37178 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
37179 spacing: 4,
37180 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NumberControlWrapper, {
37181 __next40pxDefaultSize: true,
37182 min,
37183 max,
37184 label,
37185 hideLabelFromVision: true,
37186 value,
37187 onChange: onNumberControlChange,
37188 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_prefix_wrapper_default, {
37189 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
37190 color: COLORS.theme.accent,
37191 lineHeight: 1,
37192 children: abbreviation
37193 })
37194 }),
37195 spinControls: "none"
37196 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_RangeControl, {
37197 __nextHasNoMarginBottom: true,
37198 __next40pxDefaultSize: true,
37199 label,
37200 hideLabelFromVision: true,
37201 min,
37202 max,
37203 value,
37204 onChange,
37205 withInputField: false
37206 })]
37207 });
37208};
37209
37210
37211;// ./node_modules/@wordpress/components/build-module/color-picker/rgb-input.js
37212
37213
37214
37215const RgbInput = ({
37216 color,
37217 onChange,
37218 enableAlpha
37219}) => {
37220 const {
37221 r,
37222 g,
37223 b,
37224 a
37225 } = color.toRgb();
37226 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
37227 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37228 min: 0,
37229 max: 255,
37230 label: "Red",
37231 abbreviation: "R",
37232 value: r,
37233 onChange: (nextR) => onChange(w({
37234 r: nextR,
37235 g,
37236 b,
37237 a
37238 }))
37239 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37240 min: 0,
37241 max: 255,
37242 label: "Green",
37243 abbreviation: "G",
37244 value: g,
37245 onChange: (nextG) => onChange(w({
37246 r,
37247 g: nextG,
37248 b,
37249 a
37250 }))
37251 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37252 min: 0,
37253 max: 255,
37254 label: "Blue",
37255 abbreviation: "B",
37256 value: b,
37257 onChange: (nextB) => onChange(w({
37258 r,
37259 g,
37260 b: nextB,
37261 a
37262 }))
37263 }), enableAlpha && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37264 min: 0,
37265 max: 100,
37266 label: "Alpha",
37267 abbreviation: "A",
37268 value: Math.trunc(a * 100),
37269 onChange: (nextA) => onChange(w({
37270 r,
37271 g,
37272 b,
37273 a: nextA / 100
37274 }))
37275 })]
37276 });
37277};
37278
37279
37280;// ./node_modules/@wordpress/components/build-module/color-picker/hsl-input.js
37281
37282
37283
37284
37285const HslInput = ({
37286 color,
37287 onChange,
37288 enableAlpha
37289}) => {
37290 const colorPropHSLA = (0,external_wp_element_namespaceObject.useMemo)(() => color.toHsl(), [color]);
37291 const [internalHSLA, setInternalHSLA] = (0,external_wp_element_namespaceObject.useState)({
37292 ...colorPropHSLA
37293 });
37294 const isInternalColorSameAsReceivedColor = color.isEqual(w(internalHSLA));
37295 (0,external_wp_element_namespaceObject.useEffect)(() => {
37296 if (!isInternalColorSameAsReceivedColor) {
37297 setInternalHSLA(colorPropHSLA);
37298 }
37299 }, [colorPropHSLA, isInternalColorSameAsReceivedColor]);
37300 const colorValue = isInternalColorSameAsReceivedColor ? internalHSLA : colorPropHSLA;
37301 const updateHSLAValue = (partialNewValue) => {
37302 const nextOnChangeValue = w({
37303 ...colorValue,
37304 ...partialNewValue
37305 });
37306 if (!color.isEqual(nextOnChangeValue)) {
37307 onChange(nextOnChangeValue);
37308 } else {
37309 setInternalHSLA((prevHSLA) => ({
37310 ...prevHSLA,
37311 ...partialNewValue
37312 }));
37313 }
37314 };
37315 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
37316 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37317 min: 0,
37318 max: 359,
37319 label: "Hue",
37320 abbreviation: "H",
37321 value: colorValue.h,
37322 onChange: (nextH) => {
37323 updateHSLAValue({
37324 h: nextH
37325 });
37326 }
37327 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37328 min: 0,
37329 max: 100,
37330 label: "Saturation",
37331 abbreviation: "S",
37332 value: colorValue.s,
37333 onChange: (nextS) => {
37334 updateHSLAValue({
37335 s: nextS
37336 });
37337 }
37338 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37339 min: 0,
37340 max: 100,
37341 label: "Lightness",
37342 abbreviation: "L",
37343 value: colorValue.l,
37344 onChange: (nextL) => {
37345 updateHSLAValue({
37346 l: nextL
37347 });
37348 }
37349 }), enableAlpha && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
37350 min: 0,
37351 max: 100,
37352 label: "Alpha",
37353 abbreviation: "A",
37354 value: Math.trunc(100 * colorValue.a),
37355 onChange: (nextA) => {
37356 updateHSLAValue({
37357 a: nextA / 100
37358 });
37359 }
37360 })]
37361 });
37362};
37363
37364
37365;// ./node_modules/@wordpress/components/build-module/color-picker/hex-input.js
37366
37367
37368
37369
37370
37371
37372
37373const HexInput = ({
37374 color,
37375 onChange,
37376 enableAlpha
37377}) => {
37378 const handleChange = (nextValue) => {
37379 if (!nextValue) {
37380 return;
37381 }
37382 const hexValue = nextValue.startsWith("#") ? nextValue : "#" + nextValue;
37383 onChange(w(hexValue));
37384 };
37385 const stateReducer = (state, action) => {
37386 const nativeEvent = action.payload?.event?.nativeEvent;
37387 if ("insertFromPaste" !== nativeEvent?.inputType) {
37388 return {
37389 ...state
37390 };
37391 }
37392 const value = state.value?.startsWith("#") ? state.value.slice(1).toUpperCase() : state.value?.toUpperCase();
37393 return {
37394 ...state,
37395 value
37396 };
37397 };
37398 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControl, {
37399 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_prefix_wrapper_default, {
37400 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
37401 color: COLORS.theme.accent,
37402 lineHeight: 1,
37403 children: "#"
37404 })
37405 }),
37406 value: color.toHex().slice(1).toUpperCase(),
37407 onChange: handleChange,
37408 maxLength: enableAlpha ? 9 : 7,
37409 label: (0,external_wp_i18n_namespaceObject.__)("Hex color"),
37410 hideLabelFromVision: true,
37411 size: "__unstable-large",
37412 __unstableStateReducer: stateReducer,
37413 __unstableInputWidth: "9em"
37414 });
37415};
37416
37417
37418;// ./node_modules/@wordpress/components/build-module/color-picker/color-input.js
37419
37420
37421
37422
37423const ColorInput = ({
37424 colorType,
37425 color,
37426 onChange,
37427 enableAlpha
37428}) => {
37429 const props = {
37430 color,
37431 onChange,
37432 enableAlpha
37433 };
37434 switch (colorType) {
37435 case "hsl":
37436 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HslInput, {
37437 ...props
37438 });
37439 case "rgb":
37440 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RgbInput, {
37441 ...props
37442 });
37443 default:
37444 case "hex":
37445 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HexInput, {
37446 ...props
37447 });
37448 }
37449};
37450
37451
37452;// ./node_modules/react-colorful/dist/index.mjs
37453function dist_u(){return(dist_u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function dist_c(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(o[t]=e[t]);return o}function dist_i(e){var t=(0,external_React_.useRef)(e),n=(0,external_React_.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dist_s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e<r?r:e},dist_f=function(e){return"touches"in e},dist_v=function(e){return e&&e.ownerDocument.defaultView||self},dist_d=function(e,r,t){var n=e.getBoundingClientRect(),o=dist_f(r)?function(e,r){for(var t=0;t<e.length;t++)if(e[t].identifier===r)return e[t];return e[0]}(r.touches,t):r;return{left:dist_s((o.pageX-(n.left+dist_v(e).pageXOffset))/n.width),top:dist_s((o.pageY-(n.top+dist_v(e).pageYOffset))/n.height)}},dist_h=function(e){!dist_f(e)&&e.preventDefault()},dist_m=external_React_.memo(function(o){var a=o.onMove,l=o.onKey,s=dist_c(o,["onMove","onKey"]),m=(0,external_React_.useRef)(null),g=dist_i(a),p=dist_i(l),b=(0,external_React_.useRef)(null),_=(0,external_React_.useRef)(!1),x=(0,external_React_.useMemo)(function(){var e=function(e){dist_h(e),(dist_f(e)?e.touches.length>0:e.buttons>0)&&m.current?g(dist_d(m.current,e,b.current)):t(!1)},r=function(){return t(!1)};function t(t){var n=_.current,o=dist_v(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r)}return[function(e){var r=e.nativeEvent,n=m.current;if(n&&(dist_h(r),!function(e,r){return r&&!dist_f(e)}(r,_.current)&&n)){if(dist_f(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier)}n.focus(),g(dist_d(n,r,b.current)),t(!0)}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}))},t]},[p,g]),C=x[0],E=x[1],H=x[2];return (0,external_React_.useEffect)(function(){return H},[H]),external_React_.createElement("div",dist_u({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),dist_g=function(e){return e.filter(Boolean).join(" ")},dist_p=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=dist_g(["react-colorful__pointer",r.className]);return external_React_.createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},external_React_.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},dist_b=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},_={grad:.9,turn:360,rad:360/(2*Math.PI)},dist_x=function(e){return L(C(e))},C=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?dist_b(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?dist_b(parseInt(e.substring(6,8),16)/255,2):1}},dist_E=function(e,r){return void 0===r&&(r="deg"),Number(e)*(_[r]||1)},dist_H=function(e){var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_N({h:dist_E(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_M=dist_H,dist_N=function(e){var r=e.s,t=e.l;return{h:e.h,s:(r*=(t<50?t:100-t)/100)>0?2*r/(t+r)*100:0,v:t+r,a:e.a}},dist_w=function(e){return K(dist_I(e))},dist_y=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return{h:dist_b(e.h),s:dist_b(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:dist_b(o/2),a:dist_b(n,2)}},q=function(e){var r=dist_y(e);return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},dist_k=function(e){var r=dist_y(e);return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},dist_I=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return{r:dist_b(255*[n,u,l,l,c,n][i]),g:dist_b(255*[c,n,n,u,l,l][i]),b:dist_b(255*[l,l,c,n,n,u][i]),a:dist_b(o,2)}},O=function(e){var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?A({h:dist_E(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_j=O,z=function(e){var r=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?L({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:void 0===r[7]?1:Number(r[7])/(r[8]?100:1)}):{h:0,s:0,v:0,a:1}},B=z,D=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},K=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=o<1?D(dist_b(255*o)):"";return"#"+D(r)+D(t)+D(n)+a},L=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return{h:dist_b(60*(u<0?u+6:u)),s:dist_b(a?l/a*100:0),v:dist_b(a/255*100),a:o}},A=function(e){return{h:dist_b(e.h),s:dist_b(e.s),v:dist_b(e.v),a:dist_b(e.a,2)}},dist_S=external_React_.memo(function(r){var t=r.hue,n=r.onChange,o=dist_g(["react-colorful__hue",r.className]);return external_React_.createElement("div",{className:o},external_React_.createElement(dist_m,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dist_s(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":dist_b(t),"aria-valuemax":"360","aria-valuemin":"0"},external_React_.createElement(dist_p,{className:"react-colorful__hue-pointer",left:t/360,color:q({h:t,s:100,v:100,a:1})})))}),T=external_React_.memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:q({h:t.h,s:100,v:100,a:1})};return external_React_.createElement("div",{className:"react-colorful__saturation",style:o},external_React_.createElement(dist_m,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dist_s(t.s+100*e.left,0,100),v:dist_s(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dist_b(t.s)+"%, Brightness "+dist_b(t.v)+"%"},external_React_.createElement(dist_p,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:q(t)})))}),F=function(e,r){if(e===r)return!0;for(var t in e)if(e[t]!==r[t])return!1;return!0},P=function(e,r){return e.replace(/\s/g,"")===r.replace(/\s/g,"")},X=function(e,r){return e.toLowerCase()===r.toLowerCase()||F(C(e),C(r))};function Y(e,t,l){var u=dist_i(l),c=(0,external_React_.useState)(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=(0,external_React_.useRef)({color:t,hsva:s});(0,external_React_.useEffect)(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r)}},[t,e]),(0,external_React_.useEffect)(function(){var r;F(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r))},[s,e,u]);var d=(0,external_React_.useCallback)(function(e){f(function(r){return Object.assign({},r,e)})},[]);return[s,d]}var R,dist_V="undefined"!=typeof window?external_React_.useLayoutEffect:external_React_.useEffect,dist_$=function(){return R||( true?__webpack_require__.nc:0)},G=function(e){R=e},J=new Map,Q=function(e){dist_V(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!J.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',J.set(r,t);var n=dist_$();n&&t.setAttribute("nonce",n),r.head.appendChild(t)}},[])},U=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},W={defaultColor:"000",toHsva:dist_x,fromHsva:function(e){return dist_w({h:e.h,s:e.s,v:e.v,a:1})},equal:X},Z=function(r){return e.createElement(U,dist_u({},r,{colorModel:W}))},ee=function(r){var t=r.className,n=r.hsva,o=r.onChange,a={backgroundImage:"linear-gradient(90deg, "+dist_k(Object.assign({},n,{a:0}))+", "+dist_k(Object.assign({},n,{a:1}))+")"},l=dist_g(["react-colorful__alpha",t]),u=dist_b(100*n.a);return external_React_.createElement("div",{className:l},external_React_.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),external_React_.createElement(dist_m,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:dist_s(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":u+"%","aria-valuenow":u,"aria-valuemin":"0","aria-valuemax":"100"},external_React_.createElement(dist_p,{className:"react-colorful__alpha-pointer",left:n.a,color:dist_k(n)})))},re=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h}),external_React_.createElement(ee,{hsva:d,onChange:h,className:"react-colorful__last-control"}))},te={defaultColor:"0001",toHsva:dist_x,fromHsva:dist_w,equal:X},ne=function(r){return e.createElement(re,dist_u({},r,{colorModel:te}))},oe={defaultColor:{h:0,s:0,l:0,a:1},toHsva:dist_N,fromHsva:dist_y,equal:F},ae=function(r){return e.createElement(re,dist_u({},r,{colorModel:oe}))},le={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:dist_H,fromHsva:dist_k,equal:P},ue=function(r){return e.createElement(re,dist_u({},r,{colorModel:le}))},ce={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return dist_N({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){return{h:(r=dist_y(e)).h,s:r.s,l:r.l};var r},equal:F},ie=function(r){return e.createElement(U,dist_u({},r,{colorModel:ce}))},se={defaultColor:"hsl(0, 0%, 0%)",toHsva:dist_M,fromHsva:q,equal:P},fe=function(r){return e.createElement(U,dist_u({},r,{colorModel:se}))},ve={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:A,equal:F},de=function(r){return e.createElement(re,dist_u({},r,{colorModel:ve}))},he={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:O,fromHsva:function(e){var r=A(e);return"hsva("+r.h+", "+r.s+"%, "+r.v+"%, "+r.a+")"},equal:P},me=function(r){return e.createElement(re,dist_u({},r,{colorModel:he}))},ge={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var r=A(e);return{h:r.h,s:r.s,v:r.v}},equal:F},pe=function(r){return e.createElement(U,dist_u({},r,{colorModel:ge}))},be={defaultColor:"hsv(0, 0%, 0%)",toHsva:dist_j,fromHsva:function(e){var r=A(e);return"hsv("+r.h+", "+r.s+"%, "+r.v+"%)"},equal:P},_e=function(r){return e.createElement(U,dist_u({},r,{colorModel:be}))},xe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L,fromHsva:dist_I,equal:F},Ce=function(r){return e.createElement(re,dist_u({},r,{colorModel:xe}))},Ee={defaultColor:"rgba(0, 0, 0, 1)",toHsva:z,fromHsva:function(e){var r=dist_I(e);return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},equal:P},He=function(r){return external_React_.createElement(re,dist_u({},r,{colorModel:Ee}))},Me={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return L({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(r=dist_I(e)).r,g:r.g,b:r.b};var r},equal:F},Ne=function(r){return e.createElement(U,dist_u({},r,{colorModel:Me}))},we={defaultColor:"rgb(0, 0, 0)",toHsva:B,fromHsva:function(e){var r=dist_I(e);return"rgb("+r.r+", "+r.g+", "+r.b+")"},equal:P},ye=function(r){return external_React_.createElement(U,dist_u({},r,{colorModel:we}))},qe=/^#?([0-9A-F]{3,8})$/i,ke=function(r){var t=r.color,l=void 0===t?"":t,s=r.onChange,f=r.onBlur,v=r.escape,d=r.validate,h=r.format,m=r.process,g=dist_c(r,["color","onChange","onBlur","escape","validate","format","process"]),p=o(function(){return v(l)}),b=p[0],_=p[1],x=dist_i(s),C=dist_i(f),E=a(function(e){var r=v(e.target.value);_(r),d(r)&&x(m?m(r):r)},[v,m,d,x]),H=a(function(e){d(e.target.value)||_(v(l)),C(e)},[l,v,d,C]);return n(function(){_(v(l))},[l,v]),e.createElement("input",dist_u({},g,{value:h?h(b):b,spellCheck:"false",onChange:E,onBlur:H}))},Ie=function(e){return"#"+e},Oe=function(r){var t=r.prefixed,n=r.alpha,o=dist_c(r,["prefixed","alpha"]),l=a(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),i=a(function(e){return function(e,r){var t=qe.exec(e),n=t?t[1].length:0;return 3===n||6===n||!!r&&4===n||!!r&&8===n}(e,n)},[n]);return e.createElement(ke,dist_u({},o,{escape:l,format:t?Ie:void 0,process:Ie,validate:i}))};
37454//# sourceMappingURL=index.module.js.map
37455
37456;// ./node_modules/@wordpress/components/build-module/color-picker/picker.js
37457
37458
37459
37460
37461const Picker = ({
37462 color,
37463 enableAlpha,
37464 onChange
37465}) => {
37466 const Component = enableAlpha ? He : ye;
37467 const rgbColor = (0,external_wp_element_namespaceObject.useMemo)(() => color.toRgbString(), [color]);
37468 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
37469 color: rgbColor,
37470 onChange: (nextColor) => {
37471 onChange(w(nextColor));
37472 },
37473 onPointerDown: ({
37474 currentTarget,
37475 pointerId
37476 }) => {
37477 currentTarget.setPointerCapture(pointerId);
37478 },
37479 onPointerUp: ({
37480 currentTarget,
37481 pointerId
37482 }) => {
37483 currentTarget.releasePointerCapture(pointerId);
37484 }
37485 });
37486};
37487
37488
37489;// ./node_modules/@wordpress/components/build-module/color-picker/component.js
37490
37491
37492
37493
37494
37495
37496
37497
37498
37499
37500
37501
37502k([names]);
37503const options = [{
37504 label: "RGB",
37505 value: "rgb"
37506}, {
37507 label: "HSL",
37508 value: "hsl"
37509}, {
37510 label: "Hex",
37511 value: "hex"
37512}];
37513const UnconnectedColorPicker = (props, forwardedRef) => {
37514 const {
37515 enableAlpha = false,
37516 color: colorProp,
37517 onChange,
37518 defaultValue = "#fff",
37519 copyFormat,
37520 ...divProps
37521 } = useContextSystem(props, "ColorPicker");
37522 const [color, setColor] = useControlledValue({
37523 onChange,
37524 value: colorProp,
37525 defaultValue
37526 });
37527 const safeColordColor = (0,external_wp_element_namespaceObject.useMemo)(() => {
37528 return w(color || "");
37529 }, [color]);
37530 const debouncedSetColor = (0,external_wp_compose_namespaceObject.useDebounce)(setColor);
37531 const handleChange = (0,external_wp_element_namespaceObject.useCallback)((nextValue) => {
37532 debouncedSetColor(nextValue.toHex());
37533 }, [debouncedSetColor]);
37534 const [colorType, setColorType] = (0,external_wp_element_namespaceObject.useState)(copyFormat || "hex");
37535 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ColorfulWrapper, {
37536 ref: forwardedRef,
37537 ...divProps,
37538 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Picker, {
37539 onChange: handleChange,
37540 color: safeColordColor,
37541 enableAlpha
37542 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(AuxiliaryColorArtefactWrapper, {
37543 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(AuxiliaryColorArtefactHStackHeader, {
37544 justify: "space-between",
37545 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_SelectControl, {
37546 __nextHasNoMarginBottom: true,
37547 size: "compact",
37548 options,
37549 value: colorType,
37550 onChange: (nextColorType) => setColorType(nextColorType),
37551 label: (0,external_wp_i18n_namespaceObject.__)("Color format"),
37552 hideLabelFromVision: true,
37553 variant: "minimal"
37554 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorCopyButton, {
37555 color: safeColordColor,
37556 colorType: copyFormat || colorType
37557 })]
37558 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorInputWrapper, {
37559 direction: "column",
37560 gap: 2,
37561 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorInput, {
37562 colorType,
37563 color: safeColordColor,
37564 onChange: handleChange,
37565 enableAlpha
37566 })
37567 })]
37568 })]
37569 });
37570};
37571const ColorPicker = contextConnect(UnconnectedColorPicker, "ColorPicker");
37572var color_picker_component_component_default = ColorPicker;
37573
37574
37575;// ./node_modules/@wordpress/components/build-module/color-picker/use-deprecated-props.js
37576
37577
37578
37579function isLegacyProps(props) {
37580 return typeof props.onChangeComplete !== "undefined" || typeof props.disableAlpha !== "undefined" || typeof props.color?.hex === "string";
37581}
37582function getColorFromLegacyProps(color) {
37583 if (color === void 0) {
37584 return;
37585 }
37586 if (typeof color === "string") {
37587 return color;
37588 }
37589 if (color.hex) {
37590 return color.hex;
37591 }
37592 return void 0;
37593}
37594const transformColorStringToLegacyColor = memize((color) => {
37595 const colordColor = w(color);
37596 const hex = colordColor.toHex();
37597 const rgb = colordColor.toRgb();
37598 const hsv = colordColor.toHsv();
37599 const hsl = colordColor.toHsl();
37600 return {
37601 hex,
37602 rgb,
37603 hsv,
37604 hsl,
37605 source: "hex",
37606 oldHue: hsl.h
37607 };
37608});
37609function use_deprecated_props_useDeprecatedProps(props) {
37610 const {
37611 onChangeComplete
37612 } = props;
37613 const legacyChangeHandler = (0,external_wp_element_namespaceObject.useCallback)((color) => {
37614 onChangeComplete(transformColorStringToLegacyColor(color));
37615 }, [onChangeComplete]);
37616 if (isLegacyProps(props)) {
37617 return {
37618 color: getColorFromLegacyProps(props.color),
37619 enableAlpha: !props.disableAlpha,
37620 onChange: legacyChangeHandler
37621 };
37622 }
37623 return {
37624 ...props,
37625 color: props.color,
37626 enableAlpha: props.enableAlpha,
37627 onChange: props.onChange
37628 };
37629}
37630
37631
37632;// ./node_modules/@wordpress/components/build-module/color-picker/legacy-adapter.js
37633
37634
37635
37636const LegacyAdapter = (props) => {
37637 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_picker_component_component_default, {
37638 ...use_deprecated_props_useDeprecatedProps(props)
37639 });
37640};
37641
37642
37643;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-context.js
37644
37645const CircularOptionPickerContext = (0,external_wp_element_namespaceObject.createContext)({});
37646CircularOptionPickerContext.displayName = "CircularOptionPickerContext";
37647
37648
37649;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-option.js
37650
37651
37652
37653
37654
37655
37656
37657
37658function UnforwardedOptionAsButton(props, forwardedRef) {
37659 const {
37660 isPressed,
37661 label,
37662 ...additionalProps
37663 } = props;
37664 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
37665 ...additionalProps,
37666 "aria-pressed": isPressed,
37667 ref: forwardedRef,
37668 label
37669 });
37670}
37671const OptionAsButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedOptionAsButton);
37672function UnforwardedOptionAsOption(props, forwardedRef) {
37673 const {
37674 id,
37675 isSelected,
37676 label,
37677 ...additionalProps
37678 } = props;
37679 const {
37680 setActiveId,
37681 activeId
37682 } = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext);
37683 (0,external_wp_element_namespaceObject.useEffect)(() => {
37684 if (isSelected && !activeId) {
37685 window.setTimeout(() => setActiveId?.(id), 0);
37686 }
37687 }, [isSelected, setActiveId, activeId, id]);
37688 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite.Item, {
37689 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
37690 ...additionalProps,
37691 role: "option",
37692 "aria-selected": !!isSelected,
37693 ref: forwardedRef,
37694 label
37695 }),
37696 id
37697 });
37698}
37699const OptionAsOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedOptionAsOption);
37700function Option({
37701 className,
37702 isSelected,
37703 selectedIconProps = {},
37704 tooltipText,
37705 ...additionalProps
37706}) {
37707 const {
37708 baseId,
37709 setActiveId
37710 } = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext);
37711 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(Option, baseId || "components-circular-option-picker__option");
37712 const commonProps = {
37713 id,
37714 className: "components-circular-option-picker__option",
37715 __next40pxDefaultSize: true,
37716 ...additionalProps
37717 };
37718 const isListbox = setActiveId !== void 0;
37719 const optionControl = isListbox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionAsOption, {
37720 ...commonProps,
37721 label: tooltipText,
37722 isSelected
37723 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionAsButton, {
37724 ...commonProps,
37725 label: tooltipText,
37726 isPressed: isSelected
37727 });
37728 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
37729 className: dist_clsx(className, "components-circular-option-picker__option-wrapper"),
37730 children: [optionControl, isSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
37731 icon: check_default,
37732 ...selectedIconProps
37733 })]
37734 });
37735}
37736
37737
37738;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-option-group.js
37739
37740
37741function OptionGroup({
37742 className,
37743 options,
37744 ...additionalProps
37745}) {
37746 const role = "aria-label" in additionalProps || "aria-labelledby" in additionalProps ? "group" : void 0;
37747 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
37748 ...additionalProps,
37749 role,
37750 className: dist_clsx("components-circular-option-picker__option-group", "components-circular-option-picker__swatches", className),
37751 children: options
37752 });
37753}
37754
37755
37756;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-actions.js
37757
37758
37759
37760
37761function DropdownLinkAction({
37762 buttonProps,
37763 className,
37764 dropdownProps,
37765 linkText
37766}) {
37767 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
37768 className: dist_clsx("components-circular-option-picker__dropdown-link-action", className),
37769 renderToggle: ({
37770 isOpen,
37771 onToggle
37772 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
37773 "aria-expanded": isOpen,
37774 "aria-haspopup": "true",
37775 onClick: onToggle,
37776 variant: "link",
37777 ...buttonProps,
37778 children: linkText
37779 }),
37780 ...dropdownProps
37781 });
37782}
37783function ButtonAction({
37784 className,
37785 children,
37786 ...additionalProps
37787}) {
37788 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
37789 __next40pxDefaultSize: true,
37790 className: dist_clsx("components-circular-option-picker__clear", className),
37791 variant: "tertiary",
37792 ...additionalProps,
37793 children
37794 });
37795}
37796
37797
37798;// ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker.js
37799
37800
37801
37802
37803
37804
37805
37806
37807
37808
37809function ListboxCircularOptionPicker(props) {
37810 const {
37811 actions,
37812 options,
37813 baseId,
37814 className,
37815 loop = true,
37816 children,
37817 ...additionalProps
37818 } = props;
37819 const [activeId, setActiveId] = (0,external_wp_element_namespaceObject.useState)(void 0);
37820 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
37821 baseId,
37822 activeId,
37823 setActiveId
37824 }), [baseId, activeId, setActiveId]);
37825 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
37826 className,
37827 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CircularOptionPickerContext.Provider, {
37828 value: contextValue,
37829 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(composite_Composite, {
37830 ...additionalProps,
37831 id: baseId,
37832 focusLoop: loop,
37833 rtl: (0,external_wp_i18n_namespaceObject.isRTL)(),
37834 role: "listbox",
37835 activeId,
37836 setActiveId,
37837 children: options
37838 }), children, actions]
37839 })
37840 });
37841}
37842function ButtonsCircularOptionPicker(props) {
37843 const {
37844 actions,
37845 options,
37846 children,
37847 baseId,
37848 ...additionalProps
37849 } = props;
37850 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
37851 baseId
37852 }), [baseId]);
37853 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
37854 ...additionalProps,
37855 role: "group",
37856 id: baseId,
37857 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CircularOptionPickerContext.Provider, {
37858 value: contextValue,
37859 children: [options, children, actions]
37860 })
37861 });
37862}
37863function CircularOptionPicker(props) {
37864 const {
37865 asButtons,
37866 actions: actionsProp,
37867 options: optionsProp,
37868 children,
37869 className,
37870 ...additionalProps
37871 } = props;
37872 const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(CircularOptionPicker, "components-circular-option-picker", additionalProps.id);
37873 const OptionPickerImplementation = asButtons ? ButtonsCircularOptionPicker : ListboxCircularOptionPicker;
37874 const actions = actionsProp ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
37875 className: "components-circular-option-picker__custom-clear-wrapper",
37876 children: actionsProp
37877 }) : void 0;
37878 const options = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
37879 className: "components-circular-option-picker__swatches",
37880 children: optionsProp
37881 });
37882 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionPickerImplementation, {
37883 ...additionalProps,
37884 baseId,
37885 className: dist_clsx("components-circular-option-picker", className),
37886 actions,
37887 options,
37888 children
37889 });
37890}
37891CircularOptionPicker.Option = Option;
37892CircularOptionPicker.OptionGroup = OptionGroup;
37893CircularOptionPicker.ButtonAction = ButtonAction;
37894CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
37895var circular_option_picker_default = CircularOptionPicker;
37896
37897
37898;// ./node_modules/@wordpress/components/build-module/circular-option-picker/index.js
37899
37900
37901
37902
37903
37904var circular_option_picker_circular_option_picker_default = circular_option_picker_default;
37905
37906
37907;// ./node_modules/@wordpress/components/build-module/circular-option-picker/utils.js
37908
37909function getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby) {
37910 const metaProps = asButtons ? {
37911 asButtons: true
37912 } : {
37913 asButtons: false,
37914 loop
37915 };
37916 const labelProps = {
37917 "aria-labelledby": ariaLabelledby,
37918 "aria-label": ariaLabelledby ? void 0 : ariaLabel || (0,external_wp_i18n_namespaceObject.__)("Custom color picker")
37919 };
37920 return {
37921 metaProps,
37922 labelProps
37923 };
37924}
37925
37926
37927;// ./node_modules/@wordpress/components/build-module/v-stack/hook.js
37928
37929
37930function useVStack(props) {
37931 const {
37932 expanded = false,
37933 alignment = "stretch",
37934 ...otherProps
37935 } = useContextSystem(props, "VStack");
37936 const hStackProps = useHStack({
37937 direction: "column",
37938 expanded,
37939 alignment,
37940 ...otherProps
37941 });
37942 return hStackProps;
37943}
37944
37945
37946;// ./node_modules/@wordpress/components/build-module/v-stack/component.js
37947
37948
37949
37950
37951function UnconnectedVStack(props, forwardedRef) {
37952 const vStackProps = useVStack(props);
37953 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
37954 ...vStackProps,
37955 ref: forwardedRef
37956 });
37957}
37958const VStack = contextConnect(UnconnectedVStack, "VStack");
37959var v_stack_component_component_default = VStack;
37960
37961
37962;// ./node_modules/@wordpress/components/build-module/truncate/component.js
37963
37964
37965
37966
37967function UnconnectedTruncate(props, forwardedRef) {
37968 const truncateProps = useTruncate(props);
37969 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
37970 as: "span",
37971 ...truncateProps,
37972 ref: forwardedRef
37973 });
37974}
37975const component_Truncate = contextConnect(UnconnectedTruncate, "Truncate");
37976var truncate_component_component_default = component_Truncate;
37977
37978
37979;// ./node_modules/@wordpress/components/build-module/heading/hook.js
37980
37981
37982
37983
37984function useHeading(props) {
37985 const {
37986 as: asProp,
37987 level = 2,
37988 color = COLORS.theme.foreground,
37989 isBlock = true,
37990 weight = config_values_default.fontWeightHeading,
37991 ...otherProps
37992 } = useContextSystem(props, "Heading");
37993 const as = asProp || `h${level}`;
37994 const a11yProps = {};
37995 if (typeof as === "string" && as[0] !== "h") {
37996 a11yProps.role = "heading";
37997 a11yProps["aria-level"] = typeof level === "string" ? parseInt(level) : level;
37998 }
37999 const textProps = useText({
38000 color,
38001 isBlock,
38002 weight,
38003 size: getHeadingFontSize(level),
38004 ...otherProps
38005 });
38006 return {
38007 ...textProps,
38008 ...a11yProps,
38009 as
38010 };
38011}
38012
38013
38014;// ./node_modules/@wordpress/components/build-module/heading/component.js
38015
38016
38017
38018
38019function UnconnectedHeading(props, forwardedRef) {
38020 const headerProps = useHeading(props);
38021 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
38022 ...headerProps,
38023 ref: forwardedRef
38024 });
38025}
38026const Heading = contextConnect(UnconnectedHeading, "Heading");
38027var heading_component_component_default = Heading;
38028
38029
38030;// ./node_modules/@wordpress/components/build-module/color-palette/styles.js
38031
38032function color_palette_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
38033 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
38034}
38035
38036const ColorHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
38037 target: "ev9wop70"
38038} : 0)( true ? {
38039 name: "13lxv2o",
38040 styles: "text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"
38041} : 0);
38042
38043
38044;// ./node_modules/@wordpress/components/build-module/dropdown/styles.js
38045
38046
38047
38048const padding = ({
38049 paddingSize = "small"
38050}) => {
38051 if (paddingSize === "none") {
38052 return;
38053 }
38054 const paddingValues = {
38055 small: space(2),
38056 medium: space(4)
38057 };
38058 return /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingValues[paddingSize] || paddingValues.small, ";" + ( true ? "" : 0), true ? "" : 0);
38059};
38060const DropdownContentWrapperDiv = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
38061 target: "eovvns30"
38062} : 0)("margin-left:", space(-2), ";margin-right:", space(-2), ";&:first-of-type{margin-top:", space(-2), ";}&:last-of-type{margin-bottom:", space(-2), ";}", padding, ";" + ( true ? "" : 0));
38063
38064
38065;// ./node_modules/@wordpress/components/build-module/dropdown/dropdown-content-wrapper.js
38066
38067
38068
38069function UnconnectedDropdownContentWrapper(props, forwardedRef) {
38070 const {
38071 paddingSize = "small",
38072 ...derivedProps
38073 } = useContextSystem(props, "DropdownContentWrapper");
38074 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownContentWrapperDiv, {
38075 ...derivedProps,
38076 paddingSize,
38077 ref: forwardedRef
38078 });
38079}
38080const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, "DropdownContentWrapper");
38081var dropdown_content_wrapper_default = DropdownContentWrapper;
38082
38083
38084;// ./node_modules/@wordpress/components/build-module/color-palette/utils.js
38085
38086
38087
38088
38089k([names, a11y]);
38090const isSimpleCSSColor = (value) => {
38091 const valueIsCssVariable = /var\(/.test(value !== null && value !== void 0 ? value : "");
38092 const valueIsColorMix = /color-mix\(/.test(value !== null && value !== void 0 ? value : "");
38093 return !valueIsCssVariable && !valueIsColorMix;
38094};
38095const extractColorNameFromCurrentValue = (currentValue, colors = [], showMultiplePalettes = false) => {
38096 if (!currentValue) {
38097 return "";
38098 }
38099 const currentValueIsSimpleColor = currentValue ? isSimpleCSSColor(currentValue) : false;
38100 const normalizedCurrentValue = currentValueIsSimpleColor ? w(currentValue).toHex() : currentValue;
38101 const colorPalettes = showMultiplePalettes ? colors : [{
38102 colors
38103 }];
38104 for (const {
38105 colors: paletteColors
38106 } of colorPalettes) {
38107 for (const {
38108 name: colorName,
38109 color: colorValue
38110 } of paletteColors) {
38111 const normalizedColorValue = currentValueIsSimpleColor ? w(colorValue).toHex() : colorValue;
38112 if (normalizedCurrentValue === normalizedColorValue) {
38113 return colorName;
38114 }
38115 }
38116 }
38117 return (0,external_wp_i18n_namespaceObject.__)("Custom");
38118};
38119const isMultiplePaletteObject = (obj) => Array.isArray(obj.colors) && !("color" in obj);
38120const isMultiplePaletteArray = (arr) => {
38121 return arr.length > 0 && arr.every((colorObj) => isMultiplePaletteObject(colorObj));
38122};
38123const normalizeColorValue = (value, element) => {
38124 if (!value || !element || isSimpleCSSColor(value)) {
38125 return value;
38126 }
38127 const {
38128 ownerDocument
38129 } = element;
38130 const {
38131 defaultView
38132 } = ownerDocument;
38133 const computedBackgroundColor = defaultView?.getComputedStyle(element).backgroundColor;
38134 return computedBackgroundColor ? w(computedBackgroundColor).toHex() : value;
38135};
38136
38137
38138;// ./node_modules/@wordpress/components/build-module/color-palette/index.js
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
38154
38155k([names, a11y]);
38156function SinglePalette({
38157 className,
38158 clearColor,
38159 colors,
38160 onChange,
38161 value,
38162 ...additionalProps
38163}) {
38164 const colorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
38165 return colors.map(({
38166 color,
38167 name
38168 }, index) => {
38169 const colordColor = w(color);
38170 const isSelected = value === color;
38171 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
38172 isSelected,
38173 selectedIconProps: isSelected ? {
38174 fill: colordColor.contrast() > colordColor.contrast("#000") ? "#fff" : "#000"
38175 } : {},
38176 tooltipText: name || // translators: %s: color hex code e.g: "#f00".
38177 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Color code: %s"), color),
38178 style: {
38179 backgroundColor: color,
38180 color
38181 },
38182 onClick: isSelected ? clearColor : () => onChange(color, index)
38183 }, `${color}-${index}`);
38184 });
38185 }, [colors, value, onChange, clearColor]);
38186 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.OptionGroup, {
38187 className,
38188 options: colorOptions,
38189 ...additionalProps
38190 });
38191}
38192function MultiplePalettes({
38193 className,
38194 clearColor,
38195 colors,
38196 onChange,
38197 value,
38198 headingLevel
38199}) {
38200 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MultiplePalettes, "color-palette");
38201 if (colors.length === 0) {
38202 return null;
38203 }
38204 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
38205 spacing: 3,
38206 className,
38207 children: colors.map(({
38208 name,
38209 colors: colorPalette
38210 }, index) => {
38211 const id = `${instanceId}-${index}`;
38212 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
38213 spacing: 2,
38214 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorHeading, {
38215 id,
38216 level: headingLevel,
38217 children: name
38218 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SinglePalette, {
38219 clearColor,
38220 colors: colorPalette,
38221 onChange: (newColor) => onChange(newColor, index),
38222 value,
38223 "aria-labelledby": id
38224 })]
38225 }, index);
38226 })
38227 });
38228}
38229function CustomColorPickerDropdown({
38230 isRenderedInSidebar,
38231 popoverProps: receivedPopoverProps,
38232 ...props
38233}) {
38234 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
38235 shift: true,
38236 // Disabling resize as it would otherwise cause the popover to show
38237 // scrollbars while dragging the color picker's handle close to the
38238 // popover edge.
38239 resize: false,
38240 ...isRenderedInSidebar ? {
38241 // When in the sidebar: open to the left (stacking),
38242 // leaving the same gap as the parent popover.
38243 placement: "left-start",
38244 offset: 34
38245 } : {
38246 // Default behavior: open below the anchor
38247 placement: "bottom",
38248 offset: 8
38249 },
38250 ...receivedPopoverProps
38251 }), [isRenderedInSidebar, receivedPopoverProps]);
38252 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
38253 contentClassName: "components-color-palette__custom-color-dropdown-content",
38254 popoverProps,
38255 ...props
38256 });
38257}
38258function UnforwardedColorPalette(props, forwardedRef) {
38259 const {
38260 asButtons,
38261 loop,
38262 clearable = true,
38263 colors = [],
38264 disableCustomColors = false,
38265 enableAlpha = false,
38266 onChange,
38267 value,
38268 __experimentalIsRenderedInSidebar = false,
38269 headingLevel = 2,
38270 "aria-label": ariaLabel,
38271 "aria-labelledby": ariaLabelledby,
38272 ...additionalProps
38273 } = props;
38274 const [normalizedColorValue, setNormalizedColorValue] = (0,external_wp_element_namespaceObject.useState)(value);
38275 const clearColor = (0,external_wp_element_namespaceObject.useCallback)(() => onChange(void 0), [onChange]);
38276 const customColorPaletteCallbackRef = (0,external_wp_element_namespaceObject.useCallback)((node) => {
38277 setNormalizedColorValue(normalizeColorValue(value, node));
38278 }, [value]);
38279 const hasMultipleColorOrigins = isMultiplePaletteArray(colors);
38280 const buttonLabelName = (0,external_wp_element_namespaceObject.useMemo)(() => extractColorNameFromCurrentValue(value, colors, hasMultipleColorOrigins), [value, colors, hasMultipleColorOrigins]);
38281 const renderCustomColorPicker = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_content_wrapper_default, {
38282 paddingSize: "none",
38283 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
38284 color: normalizedColorValue,
38285 onChange: (color) => onChange(color),
38286 enableAlpha
38287 })
38288 });
38289 const isHex = value?.startsWith("#");
38290 const displayValue = value?.replace(/^var\((.+)\)$/, "$1");
38291 const customColorAccessibleLabel = !!displayValue ? (0,external_wp_i18n_namespaceObject.sprintf)(
38292 // translators: 1: The name of the color e.g: "vivid red". 2: The color's hex code e.g: "#f00".
38293 (0,external_wp_i18n_namespaceObject.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
38294 buttonLabelName,
38295 displayValue
38296 ) : (0,external_wp_i18n_namespaceObject.__)("Custom color picker");
38297 const paletteCommonProps = {
38298 clearColor,
38299 onChange,
38300 value
38301 };
38302 const actions = !!clearable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
38303 onClick: clearColor,
38304 accessibleWhenDisabled: true,
38305 disabled: !value,
38306 children: (0,external_wp_i18n_namespaceObject.__)("Clear")
38307 });
38308 const {
38309 metaProps,
38310 labelProps
38311 } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
38312 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
38313 spacing: 3,
38314 ref: forwardedRef,
38315 ...additionalProps,
38316 children: [!disableCustomColors && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomColorPickerDropdown, {
38317 isRenderedInSidebar: __experimentalIsRenderedInSidebar,
38318 renderContent: renderCustomColorPicker,
38319 renderToggle: ({
38320 isOpen,
38321 onToggle
38322 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
38323 className: "components-color-palette__custom-color-wrapper",
38324 spacing: 0,
38325 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
38326 ref: customColorPaletteCallbackRef,
38327 className: "components-color-palette__custom-color-button",
38328 "aria-expanded": isOpen,
38329 "aria-haspopup": "true",
38330 onClick: onToggle,
38331 "aria-label": customColorAccessibleLabel,
38332 style: {
38333 background: value
38334 },
38335 type: "button"
38336 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
38337 className: "components-color-palette__custom-color-text-wrapper",
38338 spacing: 0.5,
38339 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(truncate_component_component_default, {
38340 className: "components-color-palette__custom-color-name",
38341 children: value ? buttonLabelName : (0,external_wp_i18n_namespaceObject.__)("No color selected")
38342 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(truncate_component_component_default, {
38343 className: dist_clsx("components-color-palette__custom-color-value", {
38344 "components-color-palette__custom-color-value--is-hex": isHex
38345 }),
38346 children: displayValue
38347 })]
38348 })]
38349 })
38350 }), (colors.length > 0 || actions) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
38351 ...metaProps,
38352 ...labelProps,
38353 actions,
38354 options: hasMultipleColorOrigins ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultiplePalettes, {
38355 ...paletteCommonProps,
38356 headingLevel,
38357 colors,
38358 value
38359 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SinglePalette, {
38360 ...paletteCommonProps,
38361 colors,
38362 value
38363 })
38364 })]
38365 });
38366}
38367const ColorPalette = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorPalette);
38368var color_palette_default = ColorPalette;
38369
38370
38371;// ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js
38372
38373
38374
38375
38376
38377
38378const ValueInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
38379 target: "e1bagdl32"
38380} : 0)("&&&{input{display:block;width:100%;}", BackdropUI, "{transition:box-shadow 0.1s linear;}}" + ( true ? "" : 0));
38381const baseUnitLabelStyles = ({
38382 selectSize
38383}) => {
38384 const sizes = {
38385 small: /* @__PURE__ */ emotion_react_browser_esm_css("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:", COLORS.gray[800], ";}" + ( true ? "" : 0), true ? "" : 0),
38386 default: /* @__PURE__ */ emotion_react_browser_esm_css("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:", space(2), ";padding:", space(1), ";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:", COLORS.theme.accent, ";}" + ( true ? "" : 0), true ? "" : 0)
38387 };
38388 return sizes[selectSize];
38389};
38390const UnitLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
38391 target: "e1bagdl31"
38392} : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";color:", COLORS.gray[900], ";}" + ( true ? "" : 0));
38393const unitSelectSizes = ({
38394 selectSize = "default"
38395}) => {
38396 const sizes = {
38397 small: /* @__PURE__ */ emotion_react_browser_esm_css("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;", rtl({
38398 borderTopLeftRadius: 0,
38399 borderBottomLeftRadius: 0
38400 })(), " &:not(:disabled):hover{background-color:", COLORS.gray[100], ";}&:focus{border:1px solid ", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values_default.borderWidth + " " + COLORS.ui.borderFocus, ";outline-offset:0;outline:2px solid transparent;z-index:1;}" + ( true ? "" : 0), true ? "" : 0),
38401 default: /* @__PURE__ */ emotion_react_browser_esm_css("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ", config_values_default.borderWidth + " " + COLORS.ui.borderFocus, ";outline:", config_values_default.borderWidth, " solid transparent;}&:focus{box-shadow:0 0 0 ", config_values_default.borderWidthFocus + " " + COLORS.ui.borderFocus, ";outline:", config_values_default.borderWidthFocus, " solid transparent;}" + ( true ? "" : 0), true ? "" : 0)
38402 };
38403 return sizes[selectSize];
38404};
38405const UnitSelect = /* @__PURE__ */ emotion_styled_base_browser_esm("select", true ? {
38406 target: "e1bagdl30"
38407} : 0)("&&&{appearance:none;background:transparent;border-radius:", config_values_default.radiusXSmall, ";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;", baseUnitLabelStyles, ";", unitSelectSizes, ";&:not( :disabled ){cursor:pointer;}}" + ( true ? "" : 0));
38408
38409
38410;// ./node_modules/@wordpress/components/build-module/border-control/styles.js
38411function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
38412 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
38413}
38414
38415
38416
38417
38418
38419const focusBoxShadow = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:inset ", config_values_default.controlBoxShadowFocus, ";" + ( true ? "" : 0), true ? "" : 0);
38420const borderControl = /* @__PURE__ */ emotion_react_browser_esm_css("border:0;padding:0;margin:0;", boxSizingReset, ";" + ( true ? "" : 0), true ? "" : 0);
38421const innerWrapper = () => /* @__PURE__ */ emotion_react_browser_esm_css(ValueInput, "{flex:1 1 40%;}&& ", UnitSelect, "{min-height:0;}" + ( true ? "" : 0), true ? "" : 0);
38422const styles_wrapperWidth = /* @__PURE__ */ emotion_react_browser_esm_css(ValueInput, "{flex:0 0 auto;}" + ( true ? "" : 0), true ? "" : 0);
38423const wrapperHeight = (size) => {
38424 return /* @__PURE__ */ emotion_react_browser_esm_css("height:", size === "__unstable-large" ? "40px" : "30px", ";" + ( true ? "" : 0), true ? "" : 0);
38425};
38426const borderControlDropdown = /* @__PURE__ */ emotion_react_browser_esm_css("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;", rtl({
38427 borderRadius: `2px 0 0 2px`
38428}, {
38429 borderRadius: `0 2px 2px 0`
38430})(), " border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";&:focus,&:hover:not( :disabled ){", focusBoxShadow, " border-color:", COLORS.ui.borderFocus, ";z-index:1;position:relative;}}" + ( true ? "" : 0), true ? "" : 0);
38431const colorIndicatorBorder = (border) => {
38432 const {
38433 color,
38434 style
38435 } = border || {};
38436 const fallbackColor = !!style && style !== "none" ? COLORS.gray[300] : void 0;
38437 return /* @__PURE__ */ emotion_react_browser_esm_css("border-style:", style === "none" ? "solid" : style, ";border-color:", color || fallbackColor, ";" + ( true ? "" : 0), true ? "" : 0);
38438};
38439const colorIndicatorWrapper = (border, size) => {
38440 const {
38441 style
38442 } = border || {};
38443 return /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", config_values_default.radiusFull, ";border:2px solid transparent;", style ? colorIndicatorBorder(border) : void 0, " width:", size === "__unstable-large" ? "24px" : "22px", ";height:", size === "__unstable-large" ? "24px" : "22px", ";padding:", size === "__unstable-large" ? "2px" : "1px", ";&>span{height:", space(4), ";width:", space(4), ";background:linear-gradient(\n -45deg,\n transparent 48%,\n rgb( 0 0 0 / 20% ) 48%,\n rgb( 0 0 0 / 20% ) 52%,\n transparent 52%\n );}" + ( true ? "" : 0), true ? "" : 0);
38444};
38445const swatchSize = 28;
38446const swatchGap = 12;
38447const borderControlPopoverControls = /* @__PURE__ */ emotion_react_browser_esm_css("width:", swatchSize * 6 + swatchGap * 5, "px;>div:first-of-type>", StyledLabel, "{margin-bottom:0;}&& ", StyledLabel, "+button:not( .has-text ){min-width:24px;padding:0;}" + ( true ? "" : 0), true ? "" : 0);
38448const borderControlPopoverContent = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
38449const borderColorIndicator = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
38450const resetButtonWrapper = true ? {
38451 name: "1ghe26v",
38452 styles: "display:flex;justify-content:flex-end;margin-top:12px"
38453} : 0;
38454const borderSlider = () => /* @__PURE__ */ emotion_react_browser_esm_css("flex:1 1 60%;", rtl({
38455 marginRight: space(3)
38456})(), ";" + ( true ? "" : 0), true ? "" : 0);
38457
38458
38459;// ./node_modules/@wordpress/components/build-module/unit-control/utils.js
38460
38461
38462const isWeb = external_wp_element_namespaceObject.Platform.OS === "web";
38463const allUnits = {
38464 px: {
38465 value: "px",
38466 label: isWeb ? "px" : (0,external_wp_i18n_namespaceObject.__)("Pixels (px)"),
38467 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Pixels (px)"),
38468 step: 1
38469 },
38470 "%": {
38471 value: "%",
38472 label: isWeb ? "%" : (0,external_wp_i18n_namespaceObject.__)("Percentage (%)"),
38473 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Percent (%)"),
38474 step: 0.1
38475 },
38476 em: {
38477 value: "em",
38478 label: isWeb ? "em" : (0,external_wp_i18n_namespaceObject.__)("Relative to parent font size (em)"),
38479 a11yLabel: (0,external_wp_i18n_namespaceObject._x)("ems", "Relative to parent font size (em)"),
38480 step: 0.01
38481 },
38482 rem: {
38483 value: "rem",
38484 label: isWeb ? "rem" : (0,external_wp_i18n_namespaceObject.__)("Relative to root font size (rem)"),
38485 a11yLabel: (0,external_wp_i18n_namespaceObject._x)("rems", "Relative to root font size (rem)"),
38486 step: 0.01
38487 },
38488 vw: {
38489 value: "vw",
38490 label: isWeb ? "vw" : (0,external_wp_i18n_namespaceObject.__)("Viewport width (vw)"),
38491 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport width (vw)"),
38492 step: 0.1
38493 },
38494 vh: {
38495 value: "vh",
38496 label: isWeb ? "vh" : (0,external_wp_i18n_namespaceObject.__)("Viewport height (vh)"),
38497 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport height (vh)"),
38498 step: 0.1
38499 },
38500 vmin: {
38501 value: "vmin",
38502 label: isWeb ? "vmin" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest dimension (vmin)"),
38503 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport smallest dimension (vmin)"),
38504 step: 0.1
38505 },
38506 vmax: {
38507 value: "vmax",
38508 label: isWeb ? "vmax" : (0,external_wp_i18n_namespaceObject.__)("Viewport largest dimension (vmax)"),
38509 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Viewport largest dimension (vmax)"),
38510 step: 0.1
38511 },
38512 ch: {
38513 value: "ch",
38514 label: isWeb ? "ch" : (0,external_wp_i18n_namespaceObject.__)("Width of the zero (0) character (ch)"),
38515 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Width of the zero (0) character (ch)"),
38516 step: 0.01
38517 },
38518 ex: {
38519 value: "ex",
38520 label: isWeb ? "ex" : (0,external_wp_i18n_namespaceObject.__)("x-height of the font (ex)"),
38521 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("x-height of the font (ex)"),
38522 step: 0.01
38523 },
38524 cm: {
38525 value: "cm",
38526 label: isWeb ? "cm" : (0,external_wp_i18n_namespaceObject.__)("Centimeters (cm)"),
38527 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Centimeters (cm)"),
38528 step: 1e-3
38529 },
38530 mm: {
38531 value: "mm",
38532 label: isWeb ? "mm" : (0,external_wp_i18n_namespaceObject.__)("Millimeters (mm)"),
38533 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Millimeters (mm)"),
38534 step: 0.1
38535 },
38536 in: {
38537 value: "in",
38538 label: isWeb ? "in" : (0,external_wp_i18n_namespaceObject.__)("Inches (in)"),
38539 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Inches (in)"),
38540 step: 1e-3
38541 },
38542 pc: {
38543 value: "pc",
38544 label: isWeb ? "pc" : (0,external_wp_i18n_namespaceObject.__)("Picas (pc)"),
38545 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Picas (pc)"),
38546 step: 1
38547 },
38548 pt: {
38549 value: "pt",
38550 label: isWeb ? "pt" : (0,external_wp_i18n_namespaceObject.__)("Points (pt)"),
38551 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Points (pt)"),
38552 step: 1
38553 },
38554 svw: {
38555 value: "svw",
38556 label: isWeb ? "svw" : (0,external_wp_i18n_namespaceObject.__)("Small viewport width (svw)"),
38557 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width (svw)"),
38558 step: 0.1
38559 },
38560 svh: {
38561 value: "svh",
38562 label: isWeb ? "svh" : (0,external_wp_i18n_namespaceObject.__)("Small viewport height (svh)"),
38563 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport height (svh)"),
38564 step: 0.1
38565 },
38566 svi: {
38567 value: "svi",
38568 label: isWeb ? "svi" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest size in the inline direction (svi)"),
38569 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width or height (svi)"),
38570 step: 0.1
38571 },
38572 svb: {
38573 value: "svb",
38574 label: isWeb ? "svb" : (0,external_wp_i18n_namespaceObject.__)("Viewport smallest size in the block direction (svb)"),
38575 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport width or height (svb)"),
38576 step: 0.1
38577 },
38578 svmin: {
38579 value: "svmin",
38580 label: isWeb ? "svmin" : (0,external_wp_i18n_namespaceObject.__)("Small viewport smallest dimension (svmin)"),
38581 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport smallest dimension (svmin)"),
38582 step: 0.1
38583 },
38584 lvw: {
38585 value: "lvw",
38586 label: isWeb ? "lvw" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width (lvw)"),
38587 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width (lvw)"),
38588 step: 0.1
38589 },
38590 lvh: {
38591 value: "lvh",
38592 label: isWeb ? "lvh" : (0,external_wp_i18n_namespaceObject.__)("Large viewport height (lvh)"),
38593 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport height (lvh)"),
38594 step: 0.1
38595 },
38596 lvi: {
38597 value: "lvi",
38598 label: isWeb ? "lvi" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvi)"),
38599 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvi)"),
38600 step: 0.1
38601 },
38602 lvb: {
38603 value: "lvb",
38604 label: isWeb ? "lvb" : (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvb)"),
38605 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport width or height (lvb)"),
38606 step: 0.1
38607 },
38608 lvmin: {
38609 value: "lvmin",
38610 label: isWeb ? "lvmin" : (0,external_wp_i18n_namespaceObject.__)("Large viewport smallest dimension (lvmin)"),
38611 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport smallest dimension (lvmin)"),
38612 step: 0.1
38613 },
38614 dvw: {
38615 value: "dvw",
38616 label: isWeb ? "dvw" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width (dvw)"),
38617 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width (dvw)"),
38618 step: 0.1
38619 },
38620 dvh: {
38621 value: "dvh",
38622 label: isWeb ? "dvh" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport height (dvh)"),
38623 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport height (dvh)"),
38624 step: 0.1
38625 },
38626 dvi: {
38627 value: "dvi",
38628 label: isWeb ? "dvi" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvi)"),
38629 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvi)"),
38630 step: 0.1
38631 },
38632 dvb: {
38633 value: "dvb",
38634 label: isWeb ? "dvb" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvb)"),
38635 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport width or height (dvb)"),
38636 step: 0.1
38637 },
38638 dvmin: {
38639 value: "dvmin",
38640 label: isWeb ? "dvmin" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport smallest dimension (dvmin)"),
38641 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport smallest dimension (dvmin)"),
38642 step: 0.1
38643 },
38644 dvmax: {
38645 value: "dvmax",
38646 label: isWeb ? "dvmax" : (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport largest dimension (dvmax)"),
38647 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Dynamic viewport largest dimension (dvmax)"),
38648 step: 0.1
38649 },
38650 svmax: {
38651 value: "svmax",
38652 label: isWeb ? "svmax" : (0,external_wp_i18n_namespaceObject.__)("Small viewport largest dimension (svmax)"),
38653 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Small viewport largest dimension (svmax)"),
38654 step: 0.1
38655 },
38656 lvmax: {
38657 value: "lvmax",
38658 label: isWeb ? "lvmax" : (0,external_wp_i18n_namespaceObject.__)("Large viewport largest dimension (lvmax)"),
38659 a11yLabel: (0,external_wp_i18n_namespaceObject.__)("Large viewport largest dimension (lvmax)"),
38660 step: 0.1
38661 }
38662};
38663const ALL_CSS_UNITS = Object.values(allUnits);
38664const CSS_UNITS = [allUnits.px, allUnits["%"], allUnits.em, allUnits.rem, allUnits.vw, allUnits.vh];
38665const DEFAULT_UNIT = allUnits.px;
38666function getParsedQuantityAndUnit(rawValue, fallbackUnit, allowedUnits) {
38667 const initialValue = fallbackUnit ? `${rawValue !== null && rawValue !== void 0 ? rawValue : ""}${fallbackUnit}` : rawValue;
38668 return parseQuantityAndUnitFromRawValue(initialValue, allowedUnits);
38669}
38670function hasUnits(units) {
38671 return Array.isArray(units) && !!units.length;
38672}
38673function parseQuantityAndUnitFromRawValue(rawValue, allowedUnits = ALL_CSS_UNITS) {
38674 let trimmedValue;
38675 let quantityToReturn;
38676 if (typeof rawValue !== "undefined" || rawValue === null) {
38677 trimmedValue = `${rawValue}`.trim();
38678 const parsedQuantity = parseFloat(trimmedValue);
38679 quantityToReturn = !isFinite(parsedQuantity) ? void 0 : parsedQuantity;
38680 }
38681 const unitMatch = trimmedValue?.match(/[\d.\-\+]*\s*(.*)/);
38682 const matchedUnit = unitMatch?.[1]?.toLowerCase();
38683 let unitToReturn;
38684 if (hasUnits(allowedUnits)) {
38685 const match = allowedUnits.find((item) => item.value === matchedUnit);
38686 unitToReturn = match?.value;
38687 } else {
38688 unitToReturn = DEFAULT_UNIT.value;
38689 }
38690 return [quantityToReturn, unitToReturn];
38691}
38692function getValidParsedQuantityAndUnit(rawValue, allowedUnits, fallbackQuantity, fallbackUnit) {
38693 const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(rawValue, allowedUnits);
38694 const quantityToReturn = parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : fallbackQuantity;
38695 let unitToReturn = parsedUnit || fallbackUnit;
38696 if (!unitToReturn && hasUnits(allowedUnits)) {
38697 unitToReturn = allowedUnits[0].value;
38698 }
38699 return [quantityToReturn, unitToReturn];
38700}
38701function getAccessibleLabelForUnit(unit) {
38702 const match = ALL_CSS_UNITS.find((item) => item.value === unit);
38703 return match?.a11yLabel ? match?.a11yLabel : match?.value;
38704}
38705function filterUnitsWithSettings(allowedUnitValues = [], availableUnits) {
38706 return Array.isArray(availableUnits) ? availableUnits.filter((unit) => allowedUnitValues.includes(unit.value)) : [];
38707}
38708const useCustomUnits = ({
38709 units = ALL_CSS_UNITS,
38710 availableUnits = [],
38711 defaultValues
38712}) => {
38713 const customUnitsToReturn = filterUnitsWithSettings(availableUnits, units);
38714 if (!defaultValues) {
38715 return customUnitsToReturn;
38716 }
38717 return customUnitsToReturn.map((unit) => {
38718 const [defaultValue] = defaultValues[unit.value] ? parseQuantityAndUnitFromRawValue(defaultValues[unit.value]) : [];
38719 return {
38720 ...unit,
38721 default: defaultValue
38722 };
38723 });
38724};
38725function getUnitsWithCurrentUnit(rawValue, legacyUnit, units = ALL_CSS_UNITS) {
38726 const unitsToReturn = Array.isArray(units) ? [...units] : [];
38727 const [, currentUnit] = getParsedQuantityAndUnit(rawValue, legacyUnit, ALL_CSS_UNITS);
38728 if (currentUnit && !unitsToReturn.some((unit) => unit.value === currentUnit)) {
38729 if (allUnits[currentUnit]) {
38730 unitsToReturn.unshift(allUnits[currentUnit]);
38731 }
38732 }
38733 return unitsToReturn;
38734}
38735
38736
38737;// ./node_modules/@wordpress/components/build-module/border-control/border-control-dropdown/hook.js
38738
38739
38740
38741
38742
38743function useBorderControlDropdown(props) {
38744 const {
38745 border,
38746 className,
38747 colors = [],
38748 enableAlpha = false,
38749 enableStyle = true,
38750 onChange,
38751 previousStyleSelection,
38752 size = "default",
38753 __experimentalIsRenderedInSidebar = false,
38754 ...otherProps
38755 } = useContextSystem(props, "BorderControlDropdown");
38756 const [widthValue] = parseQuantityAndUnitFromRawValue(border?.width);
38757 const hasZeroWidth = widthValue === 0;
38758 const onColorChange = (color) => {
38759 const style = border?.style === "none" ? previousStyleSelection : border?.style;
38760 const width = hasZeroWidth && !!color ? "1px" : border?.width;
38761 onChange({
38762 color,
38763 style,
38764 width
38765 });
38766 };
38767 const onStyleChange = (style) => {
38768 const width = hasZeroWidth && !!style ? "1px" : border?.width;
38769 onChange({
38770 ...border,
38771 style,
38772 width
38773 });
38774 };
38775 const onReset = () => {
38776 onChange({
38777 ...border,
38778 color: void 0,
38779 style: void 0
38780 });
38781 };
38782 const cx = useCx();
38783 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
38784 return cx(borderControlDropdown, className);
38785 }, [className, cx]);
38786 const indicatorClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
38787 return cx(borderColorIndicator);
38788 }, [cx]);
38789 const indicatorWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
38790 return cx(colorIndicatorWrapper(border, size));
38791 }, [border, cx, size]);
38792 const popoverControlsClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
38793 return cx(borderControlPopoverControls);
38794 }, [cx]);
38795 const popoverContentClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
38796 return cx(borderControlPopoverContent);
38797 }, [cx]);
38798 const resetButtonWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
38799 return cx(resetButtonWrapper);
38800 }, [cx]);
38801 return {
38802 ...otherProps,
38803 border,
38804 className: classes,
38805 colors,
38806 enableAlpha,
38807 enableStyle,
38808 indicatorClassName,
38809 indicatorWrapperClassName,
38810 onColorChange,
38811 onStyleChange,
38812 onReset,
38813 popoverContentClassName,
38814 popoverControlsClassName,
38815 resetButtonWrapperClassName,
38816 size,
38817 __experimentalIsRenderedInSidebar
38818 };
38819}
38820
38821
38822;// ./node_modules/@wordpress/components/build-module/border-control/border-control-dropdown/component.js
38823
38824
38825
38826
38827
38828
38829
38830
38831
38832
38833
38834
38835const getAriaLabelColorValue = (colorValue) => {
38836 return colorValue.replace(/^var\((.+)\)$/, "$1");
38837};
38838const getColorObject = (colorValue, colors) => {
38839 if (!colorValue || !colors) {
38840 return;
38841 }
38842 if (isMultiplePaletteArray(colors)) {
38843 let matchedColor;
38844 colors.some((origin) => origin.colors.some((color) => {
38845 if (color.color === colorValue) {
38846 matchedColor = color;
38847 return true;
38848 }
38849 return false;
38850 }));
38851 return matchedColor;
38852 }
38853 return colors.find((color) => color.color === colorValue);
38854};
38855const getToggleAriaLabel = (colorValue, colorObject, style, isStyleEnabled) => {
38856 if (isStyleEnabled) {
38857 if (colorObject) {
38858 const ariaLabelValue = getAriaLabelColorValue(colorObject.color);
38859 return style ? (0,external_wp_i18n_namespaceObject.sprintf)(
38860 // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:". 3: The current border style selection e.g. "solid".
38861 (0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),
38862 colorObject.name,
38863 ariaLabelValue,
38864 style
38865 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
38866 // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g.: "#f00:".
38867 (0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
38868 colorObject.name,
38869 ariaLabelValue
38870 );
38871 }
38872 if (colorValue) {
38873 const ariaLabelValue = getAriaLabelColorValue(colorValue);
38874 return style ? (0,external_wp_i18n_namespaceObject.sprintf)(
38875 // translators: 1: The color's hex code e.g.: "#f00:". 2: The current border style selection e.g. "solid".
38876 (0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),
38877 ariaLabelValue,
38878 style
38879 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
38880 // translators: %s: The color's hex code e.g: "#f00".
38881 (0,external_wp_i18n_namespaceObject.__)('Border color and style picker. The currently selected color has a value of "%s".'),
38882 ariaLabelValue
38883 );
38884 }
38885 return (0,external_wp_i18n_namespaceObject.__)("Border color and style picker.");
38886 }
38887 if (colorObject) {
38888 return (0,external_wp_i18n_namespaceObject.sprintf)(
38889 // translators: 1: The name of the color e.g. "vivid red". 2: The color's hex code e.g: "#f00".
38890 (0,external_wp_i18n_namespaceObject.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),
38891 colorObject.name,
38892 getAriaLabelColorValue(colorObject.color)
38893 );
38894 }
38895 if (colorValue) {
38896 return (0,external_wp_i18n_namespaceObject.sprintf)(
38897 // translators: %s: The color's hex code e.g: "#f00".
38898 (0,external_wp_i18n_namespaceObject.__)('Border color picker. The currently selected color has a value of "%s".'),
38899 getAriaLabelColorValue(colorValue)
38900 );
38901 }
38902 return (0,external_wp_i18n_namespaceObject.__)("Border color picker.");
38903};
38904const BorderControlDropdown = (props, forwardedRef) => {
38905 const {
38906 __experimentalIsRenderedInSidebar,
38907 border,
38908 colors,
38909 disableCustomColors,
38910 enableAlpha,
38911 enableStyle,
38912 indicatorClassName,
38913 indicatorWrapperClassName,
38914 isStyleSettable,
38915 onReset,
38916 onColorChange,
38917 onStyleChange,
38918 popoverContentClassName,
38919 popoverControlsClassName,
38920 resetButtonWrapperClassName,
38921 size,
38922 __unstablePopoverProps,
38923 ...otherProps
38924 } = useBorderControlDropdown(props);
38925 const {
38926 color,
38927 style
38928 } = border || {};
38929 const colorObject = getColorObject(color, colors);
38930 const toggleAriaLabel = getToggleAriaLabel(color, colorObject, style, enableStyle);
38931 const enableResetButton = color || style && style !== "none";
38932 const dropdownPosition = __experimentalIsRenderedInSidebar ? "bottom left" : void 0;
38933 const renderToggle = ({
38934 onToggle
38935 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
38936 onClick: onToggle,
38937 variant: "tertiary",
38938 "aria-label": toggleAriaLabel,
38939 tooltipPosition: dropdownPosition,
38940 label: (0,external_wp_i18n_namespaceObject.__)("Border color and style picker"),
38941 showTooltip: true,
38942 __next40pxDefaultSize: size === "__unstable-large",
38943 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
38944 className: indicatorWrapperClassName,
38945 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
38946 className: indicatorClassName,
38947 colorValue: color
38948 })
38949 })
38950 });
38951 const renderContent = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
38952 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dropdown_content_wrapper_default, {
38953 paddingSize: "medium",
38954 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
38955 className: popoverControlsClassName,
38956 spacing: 6,
38957 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
38958 className: popoverContentClassName,
38959 value: color,
38960 onChange: onColorChange,
38961 colors,
38962 disableCustomColors,
38963 __experimentalIsRenderedInSidebar,
38964 clearable: false,
38965 enableAlpha
38966 }), enableStyle && isStyleSettable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_style_picker_component_component_default, {
38967 label: (0,external_wp_i18n_namespaceObject.__)("Style"),
38968 value: style,
38969 onChange: onStyleChange
38970 })]
38971 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
38972 className: resetButtonWrapperClassName,
38973 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
38974 variant: "tertiary",
38975 onClick: () => {
38976 onReset();
38977 },
38978 disabled: !enableResetButton,
38979 accessibleWhenDisabled: true,
38980 __next40pxDefaultSize: true,
38981 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
38982 })
38983 })]
38984 })
38985 });
38986 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
38987 renderToggle,
38988 renderContent,
38989 popoverProps: {
38990 ...__unstablePopoverProps
38991 },
38992 ...otherProps,
38993 ref: forwardedRef
38994 });
38995};
38996const ConnectedBorderControlDropdown = contextConnect(BorderControlDropdown, "BorderControlDropdown");
38997var border_control_dropdown_component_component_default = ConnectedBorderControlDropdown;
38998
38999
39000;// ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js
39001
39002
39003
39004
39005
39006function UnitSelectControl({
39007 className,
39008 isUnitSelectTabbable: isTabbable = true,
39009 onChange,
39010 size = "default",
39011 unit = "px",
39012 units = CSS_UNITS,
39013 ...props
39014}, ref) {
39015 if (!hasUnits(units) || units?.length === 1) {
39016 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitLabel, {
39017 className: "components-unit-control__unit-label",
39018 selectSize: size,
39019 children: unit
39020 });
39021 }
39022 const handleOnChange = (event) => {
39023 const {
39024 value: unitValue
39025 } = event.target;
39026 const data = units.find((option) => option.value === unitValue);
39027 onChange?.(unitValue, {
39028 event,
39029 data
39030 });
39031 };
39032 const classes = dist_clsx("components-unit-control__select", className);
39033 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnitSelect, {
39034 ref,
39035 className: classes,
39036 onChange: handleOnChange,
39037 selectSize: size,
39038 tabIndex: isTabbable ? void 0 : -1,
39039 value: unit,
39040 ...props,
39041 children: units.map((option) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", {
39042 value: option.value,
39043 children: option.label
39044 }, option.value))
39045 });
39046}
39047var unit_select_control_default = (0,external_wp_element_namespaceObject.forwardRef)(UnitSelectControl);
39048
39049
39050;// ./node_modules/@wordpress/components/build-module/unit-control/index.js
39051
39052
39053
39054
39055
39056
39057
39058
39059
39060
39061
39062
39063function UnforwardedUnitControl(unitControlProps, forwardedRef) {
39064 const {
39065 __unstableStateReducer,
39066 autoComplete = "off",
39067 // @ts-expect-error Ensure that children is omitted from restProps
39068 children,
39069 className,
39070 disabled = false,
39071 disableUnits = false,
39072 isPressEnterToChange = false,
39073 isResetValueOnUnitChange = false,
39074 isUnitSelectTabbable = true,
39075 label,
39076 onChange: onChangeProp,
39077 onUnitChange,
39078 size = "default",
39079 unit: unitProp,
39080 units: unitsProp = CSS_UNITS,
39081 value: valueProp,
39082 onFocus: onFocusProp,
39083 __shouldNotWarnDeprecated36pxSize,
39084 ...props
39085 } = useDeprecated36pxDefaultSizeProp(unitControlProps);
39086 maybeWarnDeprecated36pxSize({
39087 componentName: "UnitControl",
39088 __next40pxDefaultSize: props.__next40pxDefaultSize,
39089 size,
39090 __shouldNotWarnDeprecated36pxSize
39091 });
39092 if ("unit" in unitControlProps) {
39093 external_wp_deprecated_default()("UnitControl unit prop", {
39094 since: "5.6",
39095 hint: "The unit should be provided within the `value` prop.",
39096 version: "6.2"
39097 });
39098 }
39099 const nonNullValueProp = valueProp !== null && valueProp !== void 0 ? valueProp : void 0;
39100 const [units, reFirstCharacterOfUnits] = (0,external_wp_element_namespaceObject.useMemo)(() => {
39101 const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);
39102 const [{
39103 value: firstUnitValue = ""
39104 } = {}, ...rest] = list;
39105 const firstCharacters = rest.reduce((carry, {
39106 value
39107 }) => {
39108 const first = escapeRegExp(value?.substring(0, 1) || "");
39109 return carry.includes(first) ? carry : `${carry}|${first}`;
39110 }, escapeRegExp(firstUnitValue.substring(0, 1)));
39111 return [list, new RegExp(`^(?:${firstCharacters})$`, "i")];
39112 }, [nonNullValueProp, unitProp, unitsProp]);
39113 const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);
39114 const [unit, setUnit] = use_controlled_state_default(units.length === 1 ? units[0].value : unitProp, {
39115 initial: parsedUnit,
39116 fallback: ""
39117 });
39118 (0,external_wp_element_namespaceObject.useEffect)(() => {
39119 if (parsedUnit !== void 0) {
39120 setUnit(parsedUnit);
39121 }
39122 }, [parsedUnit, setUnit]);
39123 const classes = dist_clsx(
39124 "components-unit-control",
39125 // This class is added for legacy purposes to maintain it on the outer
39126 // wrapper. See: https://github.com/WordPress/gutenberg/pull/45139
39127 "components-unit-control-wrapper",
39128 className
39129 );
39130 const handleOnQuantityChange = (nextQuantityValue, changeProps) => {
39131 if (nextQuantityValue === "" || typeof nextQuantityValue === "undefined" || nextQuantityValue === null) {
39132 onChangeProp?.("", changeProps);
39133 return;
39134 }
39135 const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join("");
39136 onChangeProp?.(onChangeValue, changeProps);
39137 };
39138 const handleOnUnitChange = (nextUnitValue, changeProps) => {
39139 const {
39140 data
39141 } = changeProps;
39142 let nextValue = `${parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : ""}${nextUnitValue}`;
39143 if (isResetValueOnUnitChange && data?.default !== void 0) {
39144 nextValue = `${data.default}${nextUnitValue}`;
39145 }
39146 onChangeProp?.(nextValue, changeProps);
39147 onUnitChange?.(nextUnitValue, changeProps);
39148 setUnit(nextUnitValue);
39149 };
39150 let handleOnKeyDown;
39151 if (!disableUnits && isUnitSelectTabbable && units.length) {
39152 handleOnKeyDown = (event) => {
39153 props.onKeyDown?.(event);
39154 if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {
39155 refInputSuffix.current?.focus();
39156 }
39157 };
39158 }
39159 const refInputSuffix = (0,external_wp_element_namespaceObject.useRef)(null);
39160 const inputSuffix = !disableUnits ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_select_control_default, {
39161 ref: refInputSuffix,
39162 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Select unit"),
39163 disabled,
39164 isUnitSelectTabbable,
39165 onChange: handleOnUnitChange,
39166 size: ["small", "compact"].includes(size) || size === "default" && !props.__next40pxDefaultSize ? "small" : "default",
39167 unit,
39168 units,
39169 onFocus: onFocusProp,
39170 onBlur: unitControlProps.onBlur
39171 }) : null;
39172 let step = props.step;
39173 if (!step && units) {
39174 var _activeUnit$step;
39175 const activeUnit = units.find((option) => option.value === unit);
39176 step = (_activeUnit$step = activeUnit?.step) !== null && _activeUnit$step !== void 0 ? _activeUnit$step : 1;
39177 }
39178 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValueInput, {
39179 ...props,
39180 __shouldNotWarnDeprecated36pxSize: true,
39181 autoComplete,
39182 className: classes,
39183 disabled,
39184 spinControls: "none",
39185 isPressEnterToChange,
39186 label,
39187 onKeyDown: handleOnKeyDown,
39188 onChange: handleOnQuantityChange,
39189 ref: forwardedRef,
39190 size,
39191 suffix: inputSuffix,
39192 type: isPressEnterToChange ? "text" : "number",
39193 value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : "",
39194 step,
39195 onFocus: onFocusProp,
39196 __unstableStateReducer
39197 });
39198}
39199const UnitControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedUnitControl);
39200
39201var unit_control_default = UnitControl;
39202
39203
39204;// ./node_modules/@wordpress/components/build-module/border-control/border-control/hook.js
39205
39206
39207
39208
39209
39210
39211const isValidBorder = (border) => {
39212 const hasWidth = border?.width !== void 0 && border.width !== "";
39213 const hasColor = border?.color !== void 0;
39214 return hasWidth || hasColor;
39215};
39216function useBorderControl(props) {
39217 const {
39218 className,
39219 colors = [],
39220 isCompact,
39221 onChange,
39222 enableAlpha = true,
39223 enableStyle = true,
39224 shouldSanitizeBorder = true,
39225 size = "default",
39226 value: border,
39227 width,
39228 __experimentalIsRenderedInSidebar = false,
39229 __next40pxDefaultSize,
39230 __shouldNotWarnDeprecated36pxSize,
39231 ...otherProps
39232 } = useContextSystem(props, "BorderControl");
39233 maybeWarnDeprecated36pxSize({
39234 componentName: "BorderControl",
39235 __next40pxDefaultSize,
39236 size,
39237 __shouldNotWarnDeprecated36pxSize
39238 });
39239 const computedSize = size === "default" && __next40pxDefaultSize ? "__unstable-large" : size;
39240 const [widthValue, originalWidthUnit] = parseQuantityAndUnitFromRawValue(border?.width);
39241 const widthUnit = originalWidthUnit || "px";
39242 const hadPreviousZeroWidth = widthValue === 0;
39243 const [colorSelection, setColorSelection] = (0,external_wp_element_namespaceObject.useState)();
39244 const [styleSelection, setStyleSelection] = (0,external_wp_element_namespaceObject.useState)();
39245 const isStyleSettable = shouldSanitizeBorder ? isValidBorder(border) : true;
39246 const onBorderChange = (0,external_wp_element_namespaceObject.useCallback)((newBorder) => {
39247 if (shouldSanitizeBorder && !isValidBorder(newBorder)) {
39248 onChange(void 0);
39249 return;
39250 }
39251 onChange(newBorder);
39252 }, [onChange, shouldSanitizeBorder]);
39253 const onWidthChange = (0,external_wp_element_namespaceObject.useCallback)((newWidth) => {
39254 const newWidthValue = newWidth === "" ? void 0 : newWidth;
39255 const [parsedValue] = parseQuantityAndUnitFromRawValue(newWidth);
39256 const hasZeroWidth = parsedValue === 0;
39257 const updatedBorder = {
39258 ...border,
39259 width: newWidthValue
39260 };
39261 if (hasZeroWidth && !hadPreviousZeroWidth) {
39262 setColorSelection(border?.color);
39263 setStyleSelection(border?.style);
39264 updatedBorder.color = void 0;
39265 updatedBorder.style = "none";
39266 }
39267 if (!hasZeroWidth && hadPreviousZeroWidth) {
39268 if (updatedBorder.color === void 0) {
39269 updatedBorder.color = colorSelection;
39270 }
39271 if (updatedBorder.style === "none") {
39272 updatedBorder.style = styleSelection;
39273 }
39274 }
39275 onBorderChange(updatedBorder);
39276 }, [border, hadPreviousZeroWidth, colorSelection, styleSelection, onBorderChange]);
39277 const onSliderChange = (0,external_wp_element_namespaceObject.useCallback)((value) => {
39278 onWidthChange(`${value}${widthUnit}`);
39279 }, [onWidthChange, widthUnit]);
39280 const cx = useCx();
39281 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
39282 return cx(borderControl, className);
39283 }, [className, cx]);
39284 let wrapperWidth = width;
39285 if (isCompact) {
39286 wrapperWidth = size === "__unstable-large" ? "116px" : "90px";
39287 }
39288 const innerWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39289 const widthStyle = !!wrapperWidth && styles_wrapperWidth;
39290 const heightStyle = wrapperHeight(computedSize);
39291 return cx(innerWrapper(), widthStyle, heightStyle);
39292 }, [wrapperWidth, cx, computedSize]);
39293 const sliderClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39294 return cx(borderSlider());
39295 }, [cx]);
39296 return {
39297 ...otherProps,
39298 className: classes,
39299 colors,
39300 enableAlpha,
39301 enableStyle,
39302 innerWrapperClassName,
39303 inputWidth: wrapperWidth,
39304 isStyleSettable,
39305 onBorderChange,
39306 onSliderChange,
39307 onWidthChange,
39308 previousStyleSelection: styleSelection,
39309 sliderClassName,
39310 value: border,
39311 widthUnit,
39312 widthValue,
39313 size: computedSize,
39314 __experimentalIsRenderedInSidebar,
39315 __next40pxDefaultSize
39316 };
39317}
39318
39319
39320;// ./node_modules/@wordpress/components/build-module/border-control/border-control/component.js
39321
39322
39323
39324
39325
39326
39327
39328
39329
39330
39331
39332
39333const BorderLabel = (props) => {
39334 const {
39335 label,
39336 hideLabelFromVision
39337 } = props;
39338 if (!label) {
39339 return null;
39340 }
39341 return hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
39342 as: "legend",
39343 children: label
39344 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
39345 as: "legend",
39346 children: label
39347 });
39348};
39349const UnconnectedBorderControl = (props, forwardedRef) => {
39350 const {
39351 __next40pxDefaultSize = false,
39352 colors,
39353 disableCustomColors,
39354 disableUnits,
39355 enableAlpha,
39356 enableStyle,
39357 hideLabelFromVision,
39358 innerWrapperClassName,
39359 inputWidth,
39360 isStyleSettable,
39361 label,
39362 onBorderChange,
39363 onSliderChange,
39364 onWidthChange,
39365 placeholder,
39366 __unstablePopoverProps,
39367 previousStyleSelection,
39368 showDropdownHeader,
39369 size,
39370 sliderClassName,
39371 value: border,
39372 widthUnit,
39373 widthValue,
39374 withSlider,
39375 __experimentalIsRenderedInSidebar,
39376 ...otherProps
39377 } = useBorderControl(props);
39378 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
39379 as: "fieldset",
39380 ...otherProps,
39381 ref: forwardedRef,
39382 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BorderLabel, {
39383 label,
39384 hideLabelFromVision
39385 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
39386 spacing: 4,
39387 className: innerWrapperClassName,
39388 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_control_default, {
39389 __next40pxDefaultSize,
39390 __shouldNotWarnDeprecated36pxSize: true,
39391 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
39392 marginRight: 1,
39393 marginBottom: 0,
39394 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_dropdown_component_component_default, {
39395 border,
39396 colors,
39397 __unstablePopoverProps,
39398 disableCustomColors,
39399 enableAlpha,
39400 enableStyle,
39401 isStyleSettable,
39402 onChange: onBorderChange,
39403 previousStyleSelection,
39404 __experimentalIsRenderedInSidebar,
39405 size
39406 })
39407 }),
39408 label: (0,external_wp_i18n_namespaceObject.__)("Border width"),
39409 hideLabelFromVision: true,
39410 min: 0,
39411 onChange: onWidthChange,
39412 value: border?.width || "",
39413 placeholder,
39414 disableUnits,
39415 __unstableInputWidth: inputWidth,
39416 size
39417 }), withSlider && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
39418 __nextHasNoMarginBottom: true,
39419 label: (0,external_wp_i18n_namespaceObject.__)("Border width"),
39420 hideLabelFromVision: true,
39421 className: sliderClassName,
39422 initialPosition: 0,
39423 max: 100,
39424 min: 0,
39425 onChange: onSliderChange,
39426 step: ["px", "%"].includes(widthUnit) ? 1 : 0.1,
39427 value: widthValue || void 0,
39428 withInputField: false,
39429 __next40pxDefaultSize,
39430 __shouldNotWarnDeprecated36pxSize: true
39431 })]
39432 })]
39433 });
39434};
39435const BorderControl = contextConnect(UnconnectedBorderControl, "BorderControl");
39436var border_control_component_component_default = BorderControl;
39437
39438
39439;// ./node_modules/@wordpress/components/build-module/grid/utils.js
39440const utils_ALIGNMENTS = {
39441 bottom: {
39442 alignItems: "flex-end",
39443 justifyContent: "center"
39444 },
39445 bottomLeft: {
39446 alignItems: "flex-start",
39447 justifyContent: "flex-end"
39448 },
39449 bottomRight: {
39450 alignItems: "flex-end",
39451 justifyContent: "flex-end"
39452 },
39453 center: {
39454 alignItems: "center",
39455 justifyContent: "center"
39456 },
39457 spaced: {
39458 alignItems: "center",
39459 justifyContent: "space-between"
39460 },
39461 left: {
39462 alignItems: "center",
39463 justifyContent: "flex-start"
39464 },
39465 right: {
39466 alignItems: "center",
39467 justifyContent: "flex-end"
39468 },
39469 stretch: {
39470 alignItems: "stretch"
39471 },
39472 top: {
39473 alignItems: "flex-start",
39474 justifyContent: "center"
39475 },
39476 topLeft: {
39477 alignItems: "flex-start",
39478 justifyContent: "flex-start"
39479 },
39480 topRight: {
39481 alignItems: "flex-start",
39482 justifyContent: "flex-end"
39483 }
39484};
39485function utils_getAlignmentProps(alignment) {
39486 const alignmentProps = alignment ? utils_ALIGNMENTS[alignment] : {};
39487 return alignmentProps;
39488}
39489
39490
39491;// ./node_modules/@wordpress/components/build-module/grid/hook.js
39492
39493
39494
39495
39496
39497
39498
39499function useGrid(props) {
39500 const {
39501 align,
39502 alignment,
39503 className,
39504 columnGap,
39505 columns = 2,
39506 gap = 3,
39507 isInline = false,
39508 justify,
39509 rowGap,
39510 rows,
39511 templateColumns,
39512 templateRows,
39513 ...otherProps
39514 } = useContextSystem(props, "Grid");
39515 const columnsAsArray = Array.isArray(columns) ? columns : [columns];
39516 const column = useResponsiveValue(columnsAsArray);
39517 const rowsAsArray = Array.isArray(rows) ? rows : [rows];
39518 const row = useResponsiveValue(rowsAsArray);
39519 const gridTemplateColumns = templateColumns || !!columns && `repeat( ${column}, 1fr )`;
39520 const gridTemplateRows = templateRows || !!rows && `repeat( ${row}, 1fr )`;
39521 const cx = useCx();
39522 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
39523 const alignmentProps = utils_getAlignmentProps(alignment);
39524 const gridClasses = /* @__PURE__ */ emotion_react_browser_esm_css({
39525 alignItems: align,
39526 display: isInline ? "inline-grid" : "grid",
39527 gap: `calc( ${config_values_default.gridBase} * ${gap} )`,
39528 gridTemplateColumns: gridTemplateColumns || void 0,
39529 gridTemplateRows: gridTemplateRows || void 0,
39530 gridRowGap: rowGap,
39531 gridColumnGap: columnGap,
39532 justifyContent: justify,
39533 verticalAlign: isInline ? "middle" : void 0,
39534 ...alignmentProps
39535 }, true ? "" : 0, true ? "" : 0);
39536 return cx(gridClasses, className);
39537 }, [align, alignment, className, columnGap, cx, gap, gridTemplateColumns, gridTemplateRows, isInline, justify, rowGap]);
39538 return {
39539 ...otherProps,
39540 className: classes
39541 };
39542}
39543
39544
39545;// ./node_modules/@wordpress/components/build-module/grid/component.js
39546
39547
39548
39549
39550function UnconnectedGrid(props, forwardedRef) {
39551 const gridProps = useGrid(props);
39552 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
39553 ...gridProps,
39554 ref: forwardedRef
39555 });
39556}
39557const Grid = contextConnect(UnconnectedGrid, "Grid");
39558var grid_component_component_default = Grid;
39559
39560
39561;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-split-controls/hook.js
39562
39563
39564
39565
39566function useBorderBoxControlSplitControls(props) {
39567 const {
39568 className,
39569 colors = [],
39570 enableAlpha = false,
39571 enableStyle = true,
39572 size = "default",
39573 __experimentalIsRenderedInSidebar = false,
39574 ...otherProps
39575 } = useContextSystem(props, "BorderBoxControlSplitControls");
39576 const cx = useCx();
39577 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
39578 return cx(borderBoxControlSplitControls(size), className);
39579 }, [cx, className, size]);
39580 const centeredClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39581 return cx(centeredBorderControl, className);
39582 }, [cx, className]);
39583 const rightAlignedClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39584 return cx(rightBorderControl(), className);
39585 }, [cx, className]);
39586 return {
39587 ...otherProps,
39588 centeredClassName,
39589 className: classes,
39590 colors,
39591 enableAlpha,
39592 enableStyle,
39593 rightAlignedClassName,
39594 size,
39595 __experimentalIsRenderedInSidebar
39596 };
39597}
39598
39599
39600;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-split-controls/component.js
39601
39602
39603
39604
39605
39606
39607
39608
39609
39610const BorderBoxControlSplitControls = (props, forwardedRef) => {
39611 const {
39612 centeredClassName,
39613 colors,
39614 disableCustomColors,
39615 enableAlpha,
39616 enableStyle,
39617 onChange,
39618 popoverPlacement,
39619 popoverOffset,
39620 rightAlignedClassName,
39621 size = "default",
39622 value,
39623 __experimentalIsRenderedInSidebar,
39624 ...otherProps
39625 } = useBorderBoxControlSplitControls(props);
39626 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
39627 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => popoverPlacement ? {
39628 placement: popoverPlacement,
39629 offset: popoverOffset,
39630 anchor: popoverAnchor,
39631 shift: true
39632 } : void 0, [popoverPlacement, popoverOffset, popoverAnchor]);
39633 const sharedBorderControlProps = {
39634 colors,
39635 disableCustomColors,
39636 enableAlpha,
39637 enableStyle,
39638 isCompact: true,
39639 __experimentalIsRenderedInSidebar,
39640 size,
39641 __shouldNotWarnDeprecated36pxSize: true
39642 };
39643 const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]);
39644 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(grid_component_component_default, {
39645 ...otherProps,
39646 ref: mergedRef,
39647 gap: 3,
39648 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_visualizer_component_component_default, {
39649 value,
39650 size
39651 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
39652 className: centeredClassName,
39653 hideLabelFromVision: true,
39654 label: (0,external_wp_i18n_namespaceObject.__)("Top border"),
39655 onChange: (newBorder) => onChange(newBorder, "top"),
39656 __unstablePopoverProps: popoverProps,
39657 value: value?.top,
39658 ...sharedBorderControlProps
39659 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
39660 hideLabelFromVision: true,
39661 label: (0,external_wp_i18n_namespaceObject.__)("Left border"),
39662 onChange: (newBorder) => onChange(newBorder, "left"),
39663 __unstablePopoverProps: popoverProps,
39664 value: value?.left,
39665 ...sharedBorderControlProps
39666 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
39667 className: rightAlignedClassName,
39668 hideLabelFromVision: true,
39669 label: (0,external_wp_i18n_namespaceObject.__)("Right border"),
39670 onChange: (newBorder) => onChange(newBorder, "right"),
39671 __unstablePopoverProps: popoverProps,
39672 value: value?.right,
39673 ...sharedBorderControlProps
39674 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
39675 className: centeredClassName,
39676 hideLabelFromVision: true,
39677 label: (0,external_wp_i18n_namespaceObject.__)("Bottom border"),
39678 onChange: (newBorder) => onChange(newBorder, "bottom"),
39679 __unstablePopoverProps: popoverProps,
39680 value: value?.bottom,
39681 ...sharedBorderControlProps
39682 })]
39683 });
39684};
39685const ConnectedBorderBoxControlSplitControls = contextConnect(BorderBoxControlSplitControls, "BorderBoxControlSplitControls");
39686var border_box_control_split_controls_component_component_default = ConnectedBorderBoxControlSplitControls;
39687
39688
39689;// ./node_modules/@wordpress/components/build-module/utils/unit-values.js
39690const UNITED_VALUE_REGEX = /^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;
39691function parseCSSUnitValue(toParse) {
39692 const value = toParse.trim();
39693 const matched = value.match(UNITED_VALUE_REGEX);
39694 if (!matched) {
39695 return [void 0, void 0];
39696 }
39697 const [, num, unit] = matched;
39698 let numParsed = parseFloat(num);
39699 numParsed = Number.isNaN(numParsed) ? void 0 : numParsed;
39700 return [numParsed, unit];
39701}
39702function createCSSUnitValue(value, unit) {
39703 return `${value}${unit}`;
39704}
39705
39706
39707;// ./node_modules/@wordpress/components/build-module/border-box-control/utils.js
39708
39709const utils_sides = ["top", "right", "bottom", "left"];
39710const borderProps = ["color", "style", "width"];
39711const isEmptyBorder = (border) => {
39712 if (!border) {
39713 return true;
39714 }
39715 return !borderProps.some((prop) => border[prop] !== void 0);
39716};
39717const isDefinedBorder = (border) => {
39718 if (!border) {
39719 return false;
39720 }
39721 if (hasSplitBorders(border)) {
39722 const allSidesEmpty = utils_sides.every((side) => isEmptyBorder(border[side]));
39723 return !allSidesEmpty;
39724 }
39725 return !isEmptyBorder(border);
39726};
39727const isCompleteBorder = (border) => {
39728 if (!border) {
39729 return false;
39730 }
39731 return borderProps.every((prop) => border[prop] !== void 0);
39732};
39733const hasSplitBorders = (border = {}) => {
39734 return Object.keys(border).some((side) => utils_sides.indexOf(side) !== -1);
39735};
39736const hasMixedBorders = (borders) => {
39737 if (!hasSplitBorders(borders)) {
39738 return false;
39739 }
39740 const shorthandBorders = utils_sides.map((side) => getShorthandBorderStyle(borders?.[side]));
39741 return !shorthandBorders.every((border) => border === shorthandBorders[0]);
39742};
39743const getSplitBorders = (border) => {
39744 if (!border || isEmptyBorder(border)) {
39745 return void 0;
39746 }
39747 return {
39748 top: border,
39749 right: border,
39750 bottom: border,
39751 left: border
39752 };
39753};
39754const getBorderDiff = (original, updated) => {
39755 const diff = {};
39756 if (original.color !== updated.color) {
39757 diff.color = updated.color;
39758 }
39759 if (original.style !== updated.style) {
39760 diff.style = updated.style;
39761 }
39762 if (original.width !== updated.width) {
39763 diff.width = updated.width;
39764 }
39765 return diff;
39766};
39767const getCommonBorder = (borders) => {
39768 if (!borders) {
39769 return void 0;
39770 }
39771 const colors = [];
39772 const styles = [];
39773 const widths = [];
39774 utils_sides.forEach((side) => {
39775 colors.push(borders[side]?.color);
39776 styles.push(borders[side]?.style);
39777 widths.push(borders[side]?.width);
39778 });
39779 const allColorsMatch = colors.every((value) => value === colors[0]);
39780 const allStylesMatch = styles.every((value) => value === styles[0]);
39781 const allWidthsMatch = widths.every((value) => value === widths[0]);
39782 return {
39783 color: allColorsMatch ? colors[0] : void 0,
39784 style: allStylesMatch ? styles[0] : void 0,
39785 width: allWidthsMatch ? widths[0] : getMostCommonUnit(widths)
39786 };
39787};
39788const getShorthandBorderStyle = (border, fallbackBorder) => {
39789 if (isEmptyBorder(border)) {
39790 return fallbackBorder;
39791 }
39792 const {
39793 color: fallbackColor,
39794 style: fallbackStyle,
39795 width: fallbackWidth
39796 } = fallbackBorder || {};
39797 const {
39798 color = fallbackColor,
39799 style = fallbackStyle,
39800 width = fallbackWidth
39801 } = border;
39802 const hasVisibleBorder = !!width && width !== "0" || !!color;
39803 const borderStyle = hasVisibleBorder ? style || "solid" : style;
39804 return [width, borderStyle, color].filter(Boolean).join(" ");
39805};
39806const getMostCommonUnit = (values) => {
39807 const units = values.map((value) => value === void 0 ? void 0 : parseCSSUnitValue(`${value}`)[1]);
39808 const filteredUnits = units.filter((value) => value !== void 0);
39809 return mode(filteredUnits);
39810};
39811function mode(values) {
39812 if (values.length === 0) {
39813 return void 0;
39814 }
39815 const map = {};
39816 let maxCount = 0;
39817 let currentMode;
39818 values.forEach((value) => {
39819 map[value] = map[value] === void 0 ? 1 : map[value] + 1;
39820 if (map[value] > maxCount) {
39821 currentMode = value;
39822 maxCount = map[value];
39823 }
39824 });
39825 return currentMode;
39826}
39827
39828
39829;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control/hook.js
39830
39831
39832
39833
39834
39835
39836function useBorderBoxControl(props) {
39837 const {
39838 className,
39839 colors = [],
39840 onChange,
39841 enableAlpha = false,
39842 enableStyle = true,
39843 size = "default",
39844 value,
39845 __experimentalIsRenderedInSidebar = false,
39846 __next40pxDefaultSize,
39847 ...otherProps
39848 } = useContextSystem(props, "BorderBoxControl");
39849 maybeWarnDeprecated36pxSize({
39850 componentName: "BorderBoxControl",
39851 __next40pxDefaultSize,
39852 size
39853 });
39854 const computedSize = size === "default" && __next40pxDefaultSize ? "__unstable-large" : size;
39855 const mixedBorders = hasMixedBorders(value);
39856 const splitBorders = hasSplitBorders(value);
39857 const linkedValue = splitBorders ? getCommonBorder(value) : value;
39858 const splitValue = splitBorders ? value : getSplitBorders(value);
39859 const hasWidthValue = !isNaN(parseFloat(`${linkedValue?.width}`));
39860 const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!mixedBorders);
39861 const toggleLinked = () => setIsLinked(!isLinked);
39862 const onLinkedChange = (newBorder) => {
39863 if (!newBorder) {
39864 return onChange(void 0);
39865 }
39866 if (!mixedBorders || isCompleteBorder(newBorder)) {
39867 return onChange(isEmptyBorder(newBorder) ? void 0 : newBorder);
39868 }
39869 const changes = getBorderDiff(linkedValue, newBorder);
39870 const updatedBorders = {
39871 top: {
39872 ...value?.top,
39873 ...changes
39874 },
39875 right: {
39876 ...value?.right,
39877 ...changes
39878 },
39879 bottom: {
39880 ...value?.bottom,
39881 ...changes
39882 },
39883 left: {
39884 ...value?.left,
39885 ...changes
39886 }
39887 };
39888 if (hasMixedBorders(updatedBorders)) {
39889 return onChange(updatedBorders);
39890 }
39891 const filteredResult = isEmptyBorder(updatedBorders.top) ? void 0 : updatedBorders.top;
39892 onChange(filteredResult);
39893 };
39894 const onSplitChange = (newBorder, side) => {
39895 const updatedBorders = {
39896 ...splitValue,
39897 [side]: newBorder
39898 };
39899 if (hasMixedBorders(updatedBorders)) {
39900 onChange(updatedBorders);
39901 } else {
39902 onChange(newBorder);
39903 }
39904 };
39905 const cx = useCx();
39906 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
39907 return cx(borderBoxControl, className);
39908 }, [cx, className]);
39909 const linkedControlClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39910 return cx(linkedBorderControl());
39911 }, [cx]);
39912 const wrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
39913 return cx(wrapper);
39914 }, [cx]);
39915 return {
39916 ...otherProps,
39917 className: classes,
39918 colors,
39919 disableUnits: mixedBorders && !hasWidthValue,
39920 enableAlpha,
39921 enableStyle,
39922 hasMixedBorders: mixedBorders,
39923 isLinked,
39924 linkedControlClassName,
39925 onLinkedChange,
39926 onSplitChange,
39927 toggleLinked,
39928 linkedValue,
39929 size: computedSize,
39930 splitValue,
39931 wrapperClassName,
39932 __experimentalIsRenderedInSidebar
39933 };
39934}
39935
39936
39937;// ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control/component.js
39938
39939
39940
39941
39942
39943
39944
39945
39946
39947
39948
39949
39950const component_BorderLabel = (props) => {
39951 const {
39952 label,
39953 hideLabelFromVision
39954 } = props;
39955 if (!label) {
39956 return null;
39957 }
39958 return hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
39959 as: "label",
39960 children: label
39961 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
39962 children: label
39963 });
39964};
39965const UnconnectedBorderBoxControl = (props, forwardedRef) => {
39966 const {
39967 className,
39968 colors,
39969 disableCustomColors,
39970 disableUnits,
39971 enableAlpha,
39972 enableStyle,
39973 hasMixedBorders,
39974 hideLabelFromVision,
39975 isLinked,
39976 label,
39977 linkedControlClassName,
39978 linkedValue,
39979 onLinkedChange,
39980 onSplitChange,
39981 popoverPlacement,
39982 popoverOffset,
39983 size,
39984 splitValue,
39985 toggleLinked,
39986 wrapperClassName,
39987 __experimentalIsRenderedInSidebar,
39988 ...otherProps
39989 } = useBorderBoxControl(props);
39990 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
39991 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => popoverPlacement ? {
39992 placement: popoverPlacement,
39993 offset: popoverOffset,
39994 anchor: popoverAnchor,
39995 shift: true
39996 } : void 0, [popoverPlacement, popoverOffset, popoverAnchor]);
39997 const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]);
39998 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
39999 className,
40000 ...otherProps,
40001 ref: mergedRef,
40002 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_BorderLabel, {
40003 label,
40004 hideLabelFromVision
40005 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
40006 className: wrapperClassName,
40007 children: [isLinked ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_control_component_component_default, {
40008 className: linkedControlClassName,
40009 colors,
40010 disableUnits,
40011 disableCustomColors,
40012 enableAlpha,
40013 enableStyle,
40014 onChange: onLinkedChange,
40015 placeholder: hasMixedBorders ? (0,external_wp_i18n_namespaceObject.__)("Mixed") : void 0,
40016 __unstablePopoverProps: popoverProps,
40017 shouldSanitizeBorder: false,
40018 value: linkedValue,
40019 withSlider: true,
40020 width: size === "__unstable-large" ? "116px" : "110px",
40021 __experimentalIsRenderedInSidebar,
40022 __shouldNotWarnDeprecated36pxSize: true,
40023 size
40024 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_split_controls_component_component_default, {
40025 colors,
40026 disableCustomColors,
40027 enableAlpha,
40028 enableStyle,
40029 onChange: onSplitChange,
40030 popoverPlacement,
40031 popoverOffset,
40032 value: splitValue,
40033 __experimentalIsRenderedInSidebar,
40034 size
40035 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(border_box_control_linked_button_component_component_default, {
40036 onClick: toggleLinked,
40037 isLinked,
40038 size
40039 })]
40040 })]
40041 });
40042};
40043const BorderBoxControl = contextConnect(UnconnectedBorderBoxControl, "BorderBoxControl");
40044var border_box_control_component_component_default = BorderBoxControl;
40045
40046
40047;// ./node_modules/@wordpress/icons/build-module/library/settings.js
40048
40049
40050var settings_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
40051 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }),
40052 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })
40053] });
40054
40055
40056;// ./node_modules/@wordpress/components/build-module/box-control/utils.js
40057
40058
40059const CUSTOM_VALUE_SETTINGS = {
40060 px: {
40061 max: 300,
40062 step: 1
40063 },
40064 "%": {
40065 max: 100,
40066 step: 1
40067 },
40068 vw: {
40069 max: 100,
40070 step: 1
40071 },
40072 vh: {
40073 max: 100,
40074 step: 1
40075 },
40076 em: {
40077 max: 10,
40078 step: 0.1
40079 },
40080 rm: {
40081 max: 10,
40082 step: 0.1
40083 },
40084 svw: {
40085 max: 100,
40086 step: 1
40087 },
40088 lvw: {
40089 max: 100,
40090 step: 1
40091 },
40092 dvw: {
40093 max: 100,
40094 step: 1
40095 },
40096 svh: {
40097 max: 100,
40098 step: 1
40099 },
40100 lvh: {
40101 max: 100,
40102 step: 1
40103 },
40104 dvh: {
40105 max: 100,
40106 step: 1
40107 },
40108 vi: {
40109 max: 100,
40110 step: 1
40111 },
40112 svi: {
40113 max: 100,
40114 step: 1
40115 },
40116 lvi: {
40117 max: 100,
40118 step: 1
40119 },
40120 dvi: {
40121 max: 100,
40122 step: 1
40123 },
40124 vb: {
40125 max: 100,
40126 step: 1
40127 },
40128 svb: {
40129 max: 100,
40130 step: 1
40131 },
40132 lvb: {
40133 max: 100,
40134 step: 1
40135 },
40136 dvb: {
40137 max: 100,
40138 step: 1
40139 },
40140 vmin: {
40141 max: 100,
40142 step: 1
40143 },
40144 svmin: {
40145 max: 100,
40146 step: 1
40147 },
40148 lvmin: {
40149 max: 100,
40150 step: 1
40151 },
40152 dvmin: {
40153 max: 100,
40154 step: 1
40155 },
40156 vmax: {
40157 max: 100,
40158 step: 1
40159 },
40160 svmax: {
40161 max: 100,
40162 step: 1
40163 },
40164 lvmax: {
40165 max: 100,
40166 step: 1
40167 },
40168 dvmax: {
40169 max: 100,
40170 step: 1
40171 }
40172};
40173const LABELS = {
40174 all: (0,external_wp_i18n_namespaceObject.__)("All sides"),
40175 top: (0,external_wp_i18n_namespaceObject.__)("Top side"),
40176 bottom: (0,external_wp_i18n_namespaceObject.__)("Bottom side"),
40177 left: (0,external_wp_i18n_namespaceObject.__)("Left side"),
40178 right: (0,external_wp_i18n_namespaceObject.__)("Right side"),
40179 vertical: (0,external_wp_i18n_namespaceObject.__)("Top and bottom sides"),
40180 horizontal: (0,external_wp_i18n_namespaceObject.__)("Left and right sides")
40181};
40182const DEFAULT_VALUES = {
40183 top: void 0,
40184 right: void 0,
40185 bottom: void 0,
40186 left: void 0
40187};
40188const ALL_SIDES = ["top", "right", "bottom", "left"];
40189function utils_mode(arr) {
40190 return arr.sort((a, b) => arr.filter((v) => v === a).length - arr.filter((v) => v === b).length).pop();
40191}
40192function getMergedValue(values = {}, availableSides = ALL_SIDES) {
40193 const sides = normalizeSides(availableSides);
40194 if (sides.every((side) => values[side] === values[sides[0]])) {
40195 return values[sides[0]];
40196 }
40197 return void 0;
40198}
40199function isValueMixed(values = {}, availableSides = ALL_SIDES) {
40200 const sides = normalizeSides(availableSides);
40201 return sides.some((side) => values[side] !== values[sides[0]]);
40202}
40203function getAllUnitFallback(selectedUnits) {
40204 if (!selectedUnits || typeof selectedUnits !== "object") {
40205 return void 0;
40206 }
40207 const filteredUnits = Object.values(selectedUnits).filter(Boolean);
40208 return utils_mode(filteredUnits);
40209}
40210function isValuesDefined(values) {
40211 return values && Object.values(values).filter(
40212 // Switching units when input is empty causes values only
40213 // containing units. This gives false positive on mixed values
40214 // unless filtered.
40215 (value) => !!value && /\d/.test(value)
40216 ).length > 0;
40217}
40218function getInitialSide(isLinked, splitOnAxis) {
40219 let initialSide = "all";
40220 if (!isLinked) {
40221 initialSide = splitOnAxis ? "vertical" : "top";
40222 }
40223 return initialSide;
40224}
40225function normalizeSides(sides) {
40226 const filteredSides = [];
40227 if (!sides?.length) {
40228 return ALL_SIDES;
40229 }
40230 if (sides.includes("vertical")) {
40231 filteredSides.push(...["top", "bottom"]);
40232 } else if (sides.includes("horizontal")) {
40233 filteredSides.push(...["left", "right"]);
40234 } else {
40235 const newSides = ALL_SIDES.filter((side) => sides.includes(side));
40236 filteredSides.push(...newSides);
40237 }
40238 return filteredSides;
40239}
40240function applyValueToSides(currentValues, newValue, sides) {
40241 external_wp_deprecated_default()("applyValueToSides", {
40242 since: "6.8",
40243 version: "7.0"
40244 });
40245 const newValues = {
40246 ...currentValues
40247 };
40248 if (sides?.length) {
40249 sides.forEach((side) => {
40250 if (side === "vertical") {
40251 newValues.top = newValue;
40252 newValues.bottom = newValue;
40253 } else if (side === "horizontal") {
40254 newValues.left = newValue;
40255 newValues.right = newValue;
40256 } else {
40257 newValues[side] = newValue;
40258 }
40259 });
40260 } else {
40261 ALL_SIDES.forEach((side) => newValues[side] = newValue);
40262 }
40263 return newValues;
40264}
40265function getAllowedSides(sides) {
40266 const allowedSides = new Set(!sides ? ALL_SIDES : []);
40267 sides?.forEach((allowedSide) => {
40268 if (allowedSide === "vertical") {
40269 allowedSides.add("top");
40270 allowedSides.add("bottom");
40271 } else if (allowedSide === "horizontal") {
40272 allowedSides.add("right");
40273 allowedSides.add("left");
40274 } else {
40275 allowedSides.add(allowedSide);
40276 }
40277 });
40278 return allowedSides;
40279}
40280function isValuePreset(value, presetKey) {
40281 return value.startsWith(`var:preset|${presetKey}|`);
40282}
40283function getPresetIndexFromValue(value, presetKey, presets) {
40284 if (!isValuePreset(value, presetKey)) {
40285 return void 0;
40286 }
40287 const match = value.match(new RegExp(`^var:preset\\|${presetKey}\\|(.+)$`));
40288 if (!match) {
40289 return void 0;
40290 }
40291 const slug = match[1];
40292 const index = presets.findIndex((preset) => {
40293 return preset.slug === slug;
40294 });
40295 return index !== -1 ? index : void 0;
40296}
40297function getPresetValueFromIndex(index, presetKey, presets) {
40298 const preset = presets[index];
40299 return `var:preset|${presetKey}|${preset.slug}`;
40300}
40301
40302
40303;// ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js
40304
40305function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
40306 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
40307}
40308
40309const box_control_icon_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
40310 target: "e1j5nr4z8"
40311} : 0)( true ? {
40312 name: "1w884gc",
40313 styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"
40314} : 0);
40315const Viewbox = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
40316 target: "e1j5nr4z7"
40317} : 0)( true ? {
40318 name: "i6vjox",
40319 styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%"
40320} : 0);
40321const strokeFocus = ({
40322 isFocused
40323}) => {
40324 return /* @__PURE__ */ emotion_react_browser_esm_css({
40325 backgroundColor: "currentColor",
40326 opacity: isFocused ? 1 : 0.3
40327 }, true ? "" : 0, true ? "" : 0);
40328};
40329const Stroke = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
40330 target: "e1j5nr4z6"
40331} : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0));
40332const VerticalStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(Stroke, true ? {
40333 target: "e1j5nr4z5"
40334} : 0)( true ? {
40335 name: "1k2w39q",
40336 styles: "bottom:3px;top:3px;width:2px"
40337} : 0);
40338const HorizontalStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(Stroke, true ? {
40339 target: "e1j5nr4z4"
40340} : 0)( true ? {
40341 name: "1q9b07k",
40342 styles: "height:2px;left:3px;right:3px"
40343} : 0);
40344const TopStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(HorizontalStroke, true ? {
40345 target: "e1j5nr4z3"
40346} : 0)( true ? {
40347 name: "abcix4",
40348 styles: "top:0"
40349} : 0);
40350const RightStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(VerticalStroke, true ? {
40351 target: "e1j5nr4z2"
40352} : 0)( true ? {
40353 name: "1wf8jf",
40354 styles: "right:0"
40355} : 0);
40356const BottomStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(HorizontalStroke, true ? {
40357 target: "e1j5nr4z1"
40358} : 0)( true ? {
40359 name: "8tapst",
40360 styles: "bottom:0"
40361} : 0);
40362const LeftStroke = /* @__PURE__ */ emotion_styled_base_browser_esm(VerticalStroke, true ? {
40363 target: "e1j5nr4z0"
40364} : 0)( true ? {
40365 name: "1ode3cm",
40366 styles: "left:0"
40367} : 0);
40368
40369
40370;// ./node_modules/@wordpress/components/build-module/box-control/icon.js
40371
40372
40373const BASE_ICON_SIZE = 24;
40374function BoxControlIcon({
40375 size = 24,
40376 side = "all",
40377 sides,
40378 ...props
40379}) {
40380 const isSideDisabled = (value) => sides?.length && !sides.includes(value);
40381 const hasSide = (value) => {
40382 if (isSideDisabled(value)) {
40383 return false;
40384 }
40385 return side === "all" || side === value;
40386 };
40387 const top = hasSide("top") || hasSide("vertical");
40388 const right = hasSide("right") || hasSide("horizontal");
40389 const bottom = hasSide("bottom") || hasSide("vertical");
40390 const left = hasSide("left") || hasSide("horizontal");
40391 const scale = size / BASE_ICON_SIZE;
40392 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(box_control_icon_styles_Root, {
40393 style: {
40394 transform: `scale(${scale})`
40395 },
40396 ...props,
40397 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Viewbox, {
40398 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TopStroke, {
40399 isFocused: top
40400 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RightStroke, {
40401 isFocused: right
40402 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BottomStroke, {
40403 isFocused: bottom
40404 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LeftStroke, {
40405 isFocused: left
40406 })]
40407 })
40408 });
40409}
40410
40411
40412;// ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js
40413
40414function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
40415 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
40416}
40417
40418
40419
40420
40421
40422
40423const StyledUnitControl = /* @__PURE__ */ emotion_styled_base_browser_esm(unit_control_default, true ? {
40424 target: "e1jovhle5"
40425} : 0)( true ? {
40426 name: "1ejyr19",
40427 styles: "max-width:90px"
40428} : 0);
40429const InputWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
40430 target: "e1jovhle4"
40431} : 0)( true ? {
40432 name: "1j1lmoi",
40433 styles: "grid-column:1/span 3"
40434} : 0);
40435const ResetButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
40436 target: "e1jovhle3"
40437} : 0)( true ? {
40438 name: "tkya7b",
40439 styles: "grid-area:1/2;justify-self:end"
40440} : 0);
40441const LinkedButtonWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
40442 target: "e1jovhle2"
40443} : 0)( true ? {
40444 name: "1dfa8al",
40445 styles: "grid-area:1/3;justify-self:end"
40446} : 0);
40447const FlexedBoxControlIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(BoxControlIcon, true ? {
40448 target: "e1jovhle1"
40449} : 0)( true ? {
40450 name: "ou8xsw",
40451 styles: "flex:0 0 auto"
40452} : 0);
40453const FlexedRangeControl = /* @__PURE__ */ emotion_styled_base_browser_esm(range_control_default, true ? {
40454 target: "e1jovhle0"
40455} : 0)("width:100%;margin-inline-end:", space(2), ";" + ( true ? "" : 0));
40456
40457
40458;// ./node_modules/@wordpress/components/build-module/box-control/input-control.js
40459
40460
40461
40462
40463
40464
40465
40466
40467
40468
40469const box_control_input_control_noop = () => {
40470};
40471function getSidesToModify(side, sides, isAlt) {
40472 const allowedSides = getAllowedSides(sides);
40473 let modifiedSides = [];
40474 switch (side) {
40475 case "all":
40476 modifiedSides = ["top", "bottom", "left", "right"];
40477 break;
40478 case "horizontal":
40479 modifiedSides = ["left", "right"];
40480 break;
40481 case "vertical":
40482 modifiedSides = ["top", "bottom"];
40483 break;
40484 default:
40485 modifiedSides = [side];
40486 }
40487 if (isAlt) {
40488 switch (side) {
40489 case "top":
40490 modifiedSides.push("bottom");
40491 break;
40492 case "bottom":
40493 modifiedSides.push("top");
40494 break;
40495 case "left":
40496 modifiedSides.push("left");
40497 break;
40498 case "right":
40499 modifiedSides.push("right");
40500 break;
40501 }
40502 }
40503 return modifiedSides.filter((s) => allowedSides.has(s));
40504}
40505function BoxInputControl({
40506 __next40pxDefaultSize,
40507 onChange = box_control_input_control_noop,
40508 onFocus = box_control_input_control_noop,
40509 values,
40510 selectedUnits,
40511 setSelectedUnits,
40512 sides,
40513 side,
40514 min = 0,
40515 presets,
40516 presetKey,
40517 ...props
40518}) {
40519 var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
40520 const defaultValuesToModify = getSidesToModify(side, sides);
40521 const handleOnFocus = (event) => {
40522 onFocus(event, {
40523 side
40524 });
40525 };
40526 const handleOnChange = (nextValues) => {
40527 onChange(nextValues);
40528 };
40529 const handleRawOnValueChange = (next) => {
40530 const nextValues = {
40531 ...values
40532 };
40533 defaultValuesToModify.forEach((modifiedSide) => {
40534 nextValues[modifiedSide] = next;
40535 });
40536 handleOnChange(nextValues);
40537 };
40538 const handleOnValueChange = (next, extra) => {
40539 const nextValues = {
40540 ...values
40541 };
40542 const isNumeric = next !== void 0 && !isNaN(parseFloat(next));
40543 const nextValue = isNumeric ? next : void 0;
40544 const modifiedSides = getSidesToModify(
40545 side,
40546 sides,
40547 /**
40548 * Supports changing pair sides. For example, holding the ALT key
40549 * when changing the TOP will also update BOTTOM.
40550 */
40551 // @ts-expect-error - TODO: event.altKey is only present when the change event was
40552 // triggered by a keyboard event. Should this feature be implemented differently so
40553 // it also works with drag events?
40554 !!extra?.event.altKey
40555 );
40556 modifiedSides.forEach((modifiedSide) => {
40557 nextValues[modifiedSide] = nextValue;
40558 });
40559 handleOnChange(nextValues);
40560 };
40561 const handleOnUnitChange = (next) => {
40562 const newUnits = {
40563 ...selectedUnits
40564 };
40565 defaultValuesToModify.forEach((modifiedSide) => {
40566 newUnits[modifiedSide] = next;
40567 });
40568 setSelectedUnits(newUnits);
40569 };
40570 const mergedValue = getMergedValue(values, defaultValuesToModify);
40571 const hasValues = isValuesDefined(values);
40572 const isMixed = hasValues && defaultValuesToModify.length > 1 && isValueMixed(values, defaultValuesToModify);
40573 const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(mergedValue);
40574 const computedUnit = hasValues ? parsedUnit : selectedUnits[defaultValuesToModify[0]];
40575 const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxInputControl, "box-control-input");
40576 const inputId = [generatedId, side].join("-");
40577 const isMixedUnit = defaultValuesToModify.length > 1 && mergedValue === void 0 && defaultValuesToModify.some((s) => selectedUnits[s] !== computedUnit);
40578 const usedValue = mergedValue === void 0 && computedUnit ? computedUnit : mergedValue;
40579 const mixedPlaceholder = isMixed || isMixedUnit ? (0,external_wp_i18n_namespaceObject.__)("Mixed") : void 0;
40580 const hasPresets = presets && presets.length > 0 && presetKey;
40581 const hasPresetValue = hasPresets && mergedValue !== void 0 && !isMixed && isValuePreset(mergedValue, presetKey);
40582 const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(!hasPresets || !hasPresetValue && !isMixed && mergedValue !== void 0);
40583 const presetIndex = hasPresetValue ? getPresetIndexFromValue(mergedValue, presetKey, presets) : void 0;
40584 const marks = hasPresets ? [{
40585 value: 0,
40586 label: "",
40587 tooltip: (0,external_wp_i18n_namespaceObject.__)("None")
40588 }, ...presets.map((preset, index) => {
40589 var _preset$name;
40590 return {
40591 value: index + 1,
40592 label: "",
40593 tooltip: (_preset$name = preset.name) !== null && _preset$name !== void 0 ? _preset$name : preset.slug
40594 };
40595 })] : [];
40596 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapper, {
40597 expanded: true,
40598 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedBoxControlIcon, {
40599 side,
40600 sides
40601 }), showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
40602 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
40603 placement: "top-end",
40604 text: LABELS[side],
40605 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledUnitControl, {
40606 ...props,
40607 min,
40608 __shouldNotWarnDeprecated36pxSize: true,
40609 __next40pxDefaultSize,
40610 className: "component-box-control__unit-control",
40611 id: inputId,
40612 isPressEnterToChange: true,
40613 disableUnits: isMixed || isMixedUnit,
40614 value: usedValue,
40615 onChange: handleOnValueChange,
40616 onUnitChange: handleOnUnitChange,
40617 onFocus: handleOnFocus,
40618 label: LABELS[side],
40619 placeholder: mixedPlaceholder,
40620 hideLabelFromVision: true
40621 })
40622 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
40623 __nextHasNoMarginBottom: true,
40624 __next40pxDefaultSize,
40625 __shouldNotWarnDeprecated36pxSize: true,
40626 "aria-controls": inputId,
40627 label: LABELS[side],
40628 hideLabelFromVision: true,
40629 onChange: (newValue) => {
40630 handleOnValueChange(newValue !== void 0 ? [newValue, computedUnit].join("") : void 0);
40631 },
40632 min: isFinite(min) ? min : 0,
40633 max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : "px"]?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
40634 step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : "px"]?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
40635 value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
40636 withInputField: false
40637 })]
40638 }), hasPresets && !showCustomValueControl && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
40639 __next40pxDefaultSize: true,
40640 className: "spacing-sizes-control__range-control",
40641 value: presetIndex !== void 0 ? presetIndex + 1 : 0,
40642 onChange: (newIndex) => {
40643 const newValue = newIndex === 0 || newIndex === void 0 ? void 0 : getPresetValueFromIndex(newIndex - 1, presetKey, presets);
40644 handleRawOnValueChange(newValue);
40645 },
40646 withInputField: false,
40647 "aria-valuenow": presetIndex !== void 0 ? presetIndex + 1 : 0,
40648 "aria-valuetext": marks[presetIndex !== void 0 ? presetIndex + 1 : 0].tooltip,
40649 renderTooltipContent: (index) => marks[!index ? 0 : index].tooltip,
40650 min: 0,
40651 max: marks.length - 1,
40652 marks,
40653 label: LABELS[side],
40654 hideLabelFromVision: true,
40655 __nextHasNoMarginBottom: true
40656 }), hasPresets && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
40657 label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)("Use size preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom size"),
40658 icon: settings_default,
40659 onClick: () => {
40660 setShowCustomValueControl(!showCustomValueControl);
40661 },
40662 isPressed: showCustomValueControl,
40663 size: "small",
40664 iconSize: 24
40665 })]
40666 }, `box-control-${side}`);
40667}
40668
40669
40670;// ./node_modules/@wordpress/components/build-module/box-control/linked-button.js
40671
40672
40673
40674
40675function LinkedButton({
40676 isLinked,
40677 ...props
40678}) {
40679 const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)("Unlink sides") : (0,external_wp_i18n_namespaceObject.__)("Link sides");
40680 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
40681 ...props,
40682 className: "component-box-control__linked-button",
40683 size: "small",
40684 icon: isLinked ? link_default : link_off_default,
40685 iconSize: 24,
40686 label
40687 });
40688}
40689
40690
40691;// ./node_modules/@wordpress/components/build-module/box-control/index.js
40692
40693
40694
40695
40696
40697
40698
40699
40700
40701
40702
40703
40704
40705
40706const defaultInputProps = {
40707 min: 0
40708};
40709const box_control_noop = () => {
40710};
40711function box_control_useUniqueId(idProp) {
40712 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxControl, "inspector-box-control");
40713 return idProp || instanceId;
40714}
40715function BoxControl({
40716 __next40pxDefaultSize = false,
40717 id: idProp,
40718 inputProps = defaultInputProps,
40719 onChange = box_control_noop,
40720 label = (0,external_wp_i18n_namespaceObject.__)("Box Control"),
40721 values: valuesProp,
40722 units,
40723 sides,
40724 splitOnAxis = false,
40725 allowReset = true,
40726 resetValues = DEFAULT_VALUES,
40727 presets,
40728 presetKey,
40729 onMouseOver,
40730 onMouseOut
40731}) {
40732 const [values, setValues] = use_controlled_state_default(valuesProp, {
40733 fallback: DEFAULT_VALUES
40734 });
40735 const inputValues = values || DEFAULT_VALUES;
40736 const hasInitialValue = isValuesDefined(valuesProp);
40737 const hasOneSide = sides?.length === 1;
40738 const [isDirty, setIsDirty] = (0,external_wp_element_namespaceObject.useState)(hasInitialValue);
40739 const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasInitialValue || !isValueMixed(inputValues) || hasOneSide);
40740 const [side, setSide] = (0,external_wp_element_namespaceObject.useState)(getInitialSide(isLinked, splitOnAxis));
40741 const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({
40742 top: parseQuantityAndUnitFromRawValue(valuesProp?.top)[1],
40743 right: parseQuantityAndUnitFromRawValue(valuesProp?.right)[1],
40744 bottom: parseQuantityAndUnitFromRawValue(valuesProp?.bottom)[1],
40745 left: parseQuantityAndUnitFromRawValue(valuesProp?.left)[1]
40746 });
40747 const id = box_control_useUniqueId(idProp);
40748 const headingId = `${id}-heading`;
40749 const toggleLinked = () => {
40750 setIsLinked(!isLinked);
40751 setSide(getInitialSide(!isLinked, splitOnAxis));
40752 };
40753 const handleOnFocus = (_event, {
40754 side: nextSide
40755 }) => {
40756 setSide(nextSide);
40757 };
40758 const handleOnChange = (nextValues) => {
40759 onChange(nextValues);
40760 setValues(nextValues);
40761 setIsDirty(true);
40762 };
40763 const handleOnReset = () => {
40764 onChange(resetValues);
40765 setValues(resetValues);
40766 setSelectedUnits(resetValues);
40767 setIsDirty(false);
40768 };
40769 const inputControlProps = {
40770 onMouseOver,
40771 onMouseOut,
40772 ...inputProps,
40773 onChange: handleOnChange,
40774 onFocus: handleOnFocus,
40775 isLinked,
40776 units,
40777 selectedUnits,
40778 setSelectedUnits,
40779 sides,
40780 values: inputValues,
40781 __next40pxDefaultSize,
40782 presets,
40783 presetKey
40784 };
40785 maybeWarnDeprecated36pxSize({
40786 componentName: "BoxControl",
40787 __next40pxDefaultSize,
40788 size: void 0
40789 });
40790 const sidesToRender = getAllowedSides(sides);
40791 if (presets && !presetKey || !presets && presetKey) {
40792 const definedProp = presets ? "presets" : "presetKey";
40793 const missingProp = presets ? "presetKey" : "presets";
40794 true ? external_wp_warning_default()(`wp.components.BoxControl: the '${missingProp}' prop is required when the '${definedProp}' prop is defined.`) : 0;
40795 }
40796 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(grid_component_component_default, {
40797 id,
40798 columns: 3,
40799 templateColumns: "1fr min-content min-content",
40800 role: "group",
40801 "aria-labelledby": headingId,
40802 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseControl.VisualLabel, {
40803 id: headingId,
40804 children: label
40805 }), isLinked && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWrapper, {
40806 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
40807 side: "all",
40808 ...inputControlProps
40809 })
40810 }), !hasOneSide && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButtonWrapper, {
40811 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButton, {
40812 onClick: toggleLinked,
40813 isLinked
40814 })
40815 }), !isLinked && splitOnAxis && ["vertical", "horizontal"].map((axis) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
40816 side: axis,
40817 ...inputControlProps
40818 }, axis)), !isLinked && !splitOnAxis && Array.from(sidesToRender).map((axis) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControl, {
40819 side: axis,
40820 ...inputControlProps
40821 }, axis)), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetButton, {
40822 className: "component-box-control__reset-button",
40823 variant: "secondary",
40824 size: "small",
40825 onClick: handleOnReset,
40826 disabled: !isDirty,
40827 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
40828 })]
40829 });
40830}
40831
40832var box_control_default = BoxControl;
40833
40834
40835;// ./node_modules/@wordpress/components/build-module/button-group/index.js
40836
40837
40838
40839
40840function UnforwardedButtonGroup(props, ref) {
40841 const {
40842 className,
40843 __shouldNotWarnDeprecated,
40844 ...restProps
40845 } = props;
40846 const classes = dist_clsx("components-button-group", className);
40847 if (!__shouldNotWarnDeprecated) {
40848 external_wp_deprecated_default()("wp.components.ButtonGroup", {
40849 since: "6.8",
40850 alternative: "wp.components.__experimentalToggleGroupControl"
40851 });
40852 }
40853 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
40854 ref,
40855 role: "group",
40856 className: classes,
40857 ...restProps
40858 });
40859}
40860const ButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButtonGroup);
40861var button_group_default = ButtonGroup;
40862
40863
40864;// ./node_modules/@wordpress/components/build-module/elevation/styles.js
40865function elevation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
40866 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
40867}
40868
40869const Elevation = true ? {
40870 name: "12ip69d",
40871 styles: "background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"
40872} : 0;
40873
40874
40875;// ./node_modules/@wordpress/components/build-module/elevation/hook.js
40876
40877
40878
40879
40880
40881
40882
40883function getBoxShadow(value) {
40884 const boxShadowColor = `rgba(0, 0, 0, ${value / 20})`;
40885 const boxShadow = `0 ${value}px ${value * 2}px 0
40886 ${boxShadowColor}`;
40887 return boxShadow;
40888}
40889function useElevation(props) {
40890 const {
40891 active,
40892 borderRadius = "inherit",
40893 className,
40894 focus,
40895 hover,
40896 isInteractive = false,
40897 offset = 0,
40898 value = 0,
40899 ...otherProps
40900 } = useContextSystem(props, "Elevation");
40901 const cx = useCx();
40902 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
40903 let hoverValue = isValueDefined(hover) ? hover : value * 2;
40904 let activeValue = isValueDefined(active) ? active : value / 2;
40905 if (!isInteractive) {
40906 hoverValue = isValueDefined(hover) ? hover : void 0;
40907 activeValue = isValueDefined(active) ? active : void 0;
40908 }
40909 const transition = `box-shadow ${config_values_default.transitionDuration} ${config_values_default.transitionTimingFunction}`;
40910 const sx = {};
40911 sx.Base = /* @__PURE__ */ emotion_react_browser_esm_css({
40912 borderRadius,
40913 bottom: offset,
40914 boxShadow: getBoxShadow(value),
40915 opacity: config_values_default.elevationIntensity,
40916 left: offset,
40917 right: offset,
40918 top: offset
40919 }, /* @__PURE__ */ emotion_react_browser_esm_css("@media not ( prefers-reduced-motion ){transition:", transition, ";}" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0, true ? "" : 0);
40920 if (isValueDefined(hoverValue)) {
40921 sx.hover = /* @__PURE__ */ emotion_react_browser_esm_css("*:hover>&{box-shadow:", getBoxShadow(hoverValue), ";}" + ( true ? "" : 0), true ? "" : 0);
40922 }
40923 if (isValueDefined(activeValue)) {
40924 sx.active = /* @__PURE__ */ emotion_react_browser_esm_css("*:active>&{box-shadow:", getBoxShadow(activeValue), ";}" + ( true ? "" : 0), true ? "" : 0);
40925 }
40926 if (isValueDefined(focus)) {
40927 sx.focus = /* @__PURE__ */ emotion_react_browser_esm_css("*:focus>&{box-shadow:", getBoxShadow(focus), ";}" + ( true ? "" : 0), true ? "" : 0);
40928 }
40929 return cx(Elevation, sx.Base, sx.hover, sx.focus, sx.active, className);
40930 }, [active, borderRadius, className, cx, focus, hover, isInteractive, offset, value]);
40931 return {
40932 ...otherProps,
40933 className: classes,
40934 "aria-hidden": true
40935 };
40936}
40937
40938
40939;// ./node_modules/@wordpress/components/build-module/elevation/component.js
40940
40941
40942
40943
40944function UnconnectedElevation(props, forwardedRef) {
40945 const elevationProps = useElevation(props);
40946 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
40947 ...elevationProps,
40948 ref: forwardedRef
40949 });
40950}
40951const component_Elevation = contextConnect(UnconnectedElevation, "Elevation");
40952var elevation_component_component_default = component_Elevation;
40953
40954
40955;// ./node_modules/@wordpress/components/build-module/card/styles.js
40956function card_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
40957 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
40958}
40959
40960
40961const adjustedBorderRadius = `calc(${config_values_default.radiusLarge} - 1px)`;
40962const Card = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:0 0 0 1px ", config_values_default.surfaceBorderColor, ";outline:none;" + ( true ? "" : 0), true ? "" : 0);
40963const Header = true ? {
40964 name: "1showjb",
40965 styles: "border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"
40966} : 0;
40967const Footer = true ? {
40968 name: "14n5oej",
40969 styles: "border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"
40970} : 0;
40971const Content = true ? {
40972 name: "13udsys",
40973 styles: "height:100%"
40974} : 0;
40975const Body = true ? {
40976 name: "6ywzd",
40977 styles: "box-sizing:border-box;height:auto;max-height:100%"
40978} : 0;
40979const Media = true ? {
40980 name: "dq805e",
40981 styles: "box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"
40982} : 0;
40983const Divider = true ? {
40984 name: "c990dr",
40985 styles: "box-sizing:border-box;display:block;width:100%"
40986} : 0;
40987const borderRadius = /* @__PURE__ */ emotion_react_browser_esm_css("&:first-of-type{border-top-left-radius:", adjustedBorderRadius, ";border-top-right-radius:", adjustedBorderRadius, ";}&:last-of-type{border-bottom-left-radius:", adjustedBorderRadius, ";border-bottom-right-radius:", adjustedBorderRadius, ";}" + ( true ? "" : 0), true ? "" : 0);
40988const borderColor = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", config_values_default.colorDivider, ";" + ( true ? "" : 0), true ? "" : 0);
40989const boxShadowless = true ? {
40990 name: "1t90u8d",
40991 styles: "box-shadow:none"
40992} : 0;
40993const borderless = true ? {
40994 name: "1e1ncky",
40995 styles: "border:none"
40996} : 0;
40997const rounded = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", adjustedBorderRadius, ";" + ( true ? "" : 0), true ? "" : 0);
40998const xSmallCardPadding = /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingXSmall, ";" + ( true ? "" : 0), true ? "" : 0);
40999const cardPaddings = {
41000 large: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingLarge, ";" + ( true ? "" : 0), true ? "" : 0),
41001 medium: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingMedium, ";" + ( true ? "" : 0), true ? "" : 0),
41002 small: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", config_values_default.cardPaddingSmall, ";" + ( true ? "" : 0), true ? "" : 0),
41003 xSmall: xSmallCardPadding,
41004 // The `extraSmall` size is not officially documented, but the following styles
41005 // are kept for legacy reasons to support older values of the `size` prop.
41006 extraSmall: xSmallCardPadding
41007};
41008const shady = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", COLORS.ui.backgroundDisabled, ";" + ( true ? "" : 0), true ? "" : 0);
41009
41010
41011;// ./node_modules/@wordpress/components/build-module/surface/styles.js
41012
41013
41014const Surface = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", config_values_default.surfaceColor, ";color:", COLORS.gray[900], ";position:relative;" + ( true ? "" : 0), true ? "" : 0);
41015const background = /* @__PURE__ */ emotion_react_browser_esm_css("background-color:", config_values_default.surfaceBackgroundColor, ";" + ( true ? "" : 0), true ? "" : 0);
41016function getBorders({
41017 borderBottom,
41018 borderLeft,
41019 borderRight,
41020 borderTop
41021}) {
41022 const borderStyle = `1px solid ${config_values_default.surfaceBorderColor}`;
41023 return /* @__PURE__ */ emotion_react_browser_esm_css({
41024 borderBottom: borderBottom ? borderStyle : void 0,
41025 borderLeft: borderLeft ? borderStyle : void 0,
41026 borderRight: borderRight ? borderStyle : void 0,
41027 borderTop: borderTop ? borderStyle : void 0
41028 }, true ? "" : 0, true ? "" : 0);
41029}
41030const primary = /* @__PURE__ */ emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0);
41031const secondary = /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundTintColor, ";" + ( true ? "" : 0), true ? "" : 0);
41032const tertiary = /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundTertiaryColor, ";" + ( true ? "" : 0), true ? "" : 0);
41033const customBackgroundSize = (surfaceBackgroundSize) => [surfaceBackgroundSize, surfaceBackgroundSize].join(" ");
41034const dottedBackground1 = (surfaceBackgroundSizeDotted) => ["90deg", [config_values_default.surfaceBackgroundColor, surfaceBackgroundSizeDotted].join(" "), "transparent 1%"].join(",");
41035const dottedBackground2 = (surfaceBackgroundSizeDotted) => [[config_values_default.surfaceBackgroundColor, surfaceBackgroundSizeDotted].join(" "), "transparent 1%"].join(",");
41036const dottedBackgroundCombined = (surfaceBackgroundSizeDotted) => [`linear-gradient( ${dottedBackground1(surfaceBackgroundSizeDotted)} ) center`, `linear-gradient( ${dottedBackground2(surfaceBackgroundSizeDotted)} ) center`, config_values_default.surfaceBorderBoldColor].join(",");
41037const getDotted = (surfaceBackgroundSize, surfaceBackgroundSizeDotted) => /* @__PURE__ */ emotion_react_browser_esm_css("background:", dottedBackgroundCombined(surfaceBackgroundSizeDotted), ";background-size:", customBackgroundSize(surfaceBackgroundSize), ";" + ( true ? "" : 0), true ? "" : 0);
41038const gridBackground1 = [`${config_values_default.surfaceBorderSubtleColor} 1px`, "transparent 1px"].join(",");
41039const gridBackground2 = ["90deg", `${config_values_default.surfaceBorderSubtleColor} 1px`, "transparent 1px"].join(",");
41040const gridBackgroundCombined = [`linear-gradient( ${gridBackground1} )`, `linear-gradient( ${gridBackground2} )`].join(",");
41041const getGrid = (surfaceBackgroundSize) => {
41042 return /* @__PURE__ */ emotion_react_browser_esm_css("background:", config_values_default.surfaceBackgroundColor, ";background-image:", gridBackgroundCombined, ";background-size:", customBackgroundSize(surfaceBackgroundSize), ";" + ( true ? "" : 0), true ? "" : 0);
41043};
41044const getVariant = (variant, surfaceBackgroundSize, surfaceBackgroundSizeDotted) => {
41045 switch (variant) {
41046 case "dotted": {
41047 return getDotted(surfaceBackgroundSize, surfaceBackgroundSizeDotted);
41048 }
41049 case "grid": {
41050 return getGrid(surfaceBackgroundSize);
41051 }
41052 case "primary": {
41053 return primary;
41054 }
41055 case "secondary": {
41056 return secondary;
41057 }
41058 case "tertiary": {
41059 return tertiary;
41060 }
41061 }
41062};
41063
41064
41065;// ./node_modules/@wordpress/components/build-module/surface/hook.js
41066
41067
41068
41069
41070function useSurface(props) {
41071 const {
41072 backgroundSize = 12,
41073 borderBottom = false,
41074 borderLeft = false,
41075 borderRight = false,
41076 borderTop = false,
41077 className,
41078 variant = "primary",
41079 ...otherProps
41080 } = useContextSystem(props, "Surface");
41081 const cx = useCx();
41082 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
41083 const sx = {
41084 borders: getBorders({
41085 borderBottom,
41086 borderLeft,
41087 borderRight,
41088 borderTop
41089 })
41090 };
41091 return cx(Surface, sx.borders, getVariant(variant, `${backgroundSize}px`, `${backgroundSize - 1}px`), className);
41092 }, [backgroundSize, borderBottom, borderLeft, borderRight, borderTop, className, cx, variant]);
41093 return {
41094 ...otherProps,
41095 className: classes
41096 };
41097}
41098
41099
41100;// ./node_modules/@wordpress/components/build-module/card/card/hook.js
41101
41102
41103
41104
41105
41106
41107function hook_useDeprecatedProps({
41108 elevation,
41109 isElevated,
41110 ...otherProps
41111}) {
41112 const propsToReturn = {
41113 ...otherProps
41114 };
41115 let computedElevation = elevation;
41116 if (isElevated) {
41117 var _computedElevation;
41118 external_wp_deprecated_default()("Card isElevated prop", {
41119 since: "5.9",
41120 alternative: "elevation"
41121 });
41122 (_computedElevation = computedElevation) !== null && _computedElevation !== void 0 ? _computedElevation : computedElevation = 2;
41123 }
41124 if (typeof computedElevation !== "undefined") {
41125 propsToReturn.elevation = computedElevation;
41126 }
41127 return propsToReturn;
41128}
41129function useCard(props) {
41130 const {
41131 className,
41132 elevation = 0,
41133 isBorderless = false,
41134 isRounded = true,
41135 size = "medium",
41136 ...otherProps
41137 } = useContextSystem(hook_useDeprecatedProps(props), "Card");
41138 const cx = useCx();
41139 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
41140 return cx(Card, isBorderless && boxShadowless, isRounded && rounded, className);
41141 }, [className, cx, isBorderless, isRounded]);
41142 const surfaceProps = useSurface({
41143 ...otherProps,
41144 className: classes
41145 });
41146 return {
41147 ...surfaceProps,
41148 elevation,
41149 isBorderless,
41150 isRounded,
41151 size
41152 };
41153}
41154
41155
41156;// ./node_modules/@wordpress/components/build-module/card/card/component.js
41157
41158
41159
41160
41161
41162
41163
41164
41165
41166
41167function UnconnectedCard(props, forwardedRef) {
41168 const {
41169 children,
41170 elevation,
41171 isBorderless,
41172 isRounded,
41173 size,
41174 ...otherProps
41175 } = useCard(props);
41176 const elevationBorderRadius = isRounded ? config_values_default.radiusLarge : 0;
41177 const cx = useCx();
41178 const elevationClassName = (0,external_wp_element_namespaceObject.useMemo)(() => cx(/* @__PURE__ */ emotion_react_browser_esm_css({
41179 borderRadius: elevationBorderRadius
41180 }, true ? "" : 0, true ? "" : 0)), [cx, elevationBorderRadius]);
41181 const contextProviderValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
41182 const contextProps = {
41183 size,
41184 isBorderless
41185 };
41186 return {
41187 CardBody: contextProps,
41188 CardHeader: contextProps,
41189 CardFooter: contextProps
41190 };
41191 }, [isBorderless, size]);
41192 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
41193 value: contextProviderValue,
41194 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(component_default, {
41195 ...otherProps,
41196 ref: forwardedRef,
41197 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41198 className: cx(Content),
41199 children
41200 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(elevation_component_component_default, {
41201 className: elevationClassName,
41202 isInteractive: false,
41203 value: elevation ? 1 : 0
41204 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(elevation_component_component_default, {
41205 className: elevationClassName,
41206 isInteractive: false,
41207 value: elevation
41208 })]
41209 })
41210 });
41211}
41212const component_Card = contextConnect(UnconnectedCard, "Card");
41213var card_component_component_default = component_Card;
41214
41215
41216;// ./node_modules/@wordpress/components/build-module/scrollable/styles.js
41217function scrollable_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
41218 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
41219}
41220
41221
41222const scrollableScrollbar = /* @__PURE__ */ emotion_react_browser_esm_css("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:", config_values_default.colorScrollbarTrack, ";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:", config_values_default.colorScrollbarThumb, ";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:", config_values_default.colorScrollbarThumbHover, ";}}" + ( true ? "" : 0), true ? "" : 0);
41223const Scrollable = true ? {
41224 name: "13udsys",
41225 styles: "height:100%"
41226} : 0;
41227const styles_Content = true ? {
41228 name: "bjn8wh",
41229 styles: "position:relative"
41230} : 0;
41231const styles_smoothScroll = true ? {
41232 name: "7zq9w",
41233 styles: "scroll-behavior:smooth"
41234} : 0;
41235const scrollX = true ? {
41236 name: "q33xhg",
41237 styles: "overflow-x:auto;overflow-y:hidden"
41238} : 0;
41239const scrollY = true ? {
41240 name: "103x71s",
41241 styles: "overflow-x:hidden;overflow-y:auto"
41242} : 0;
41243const scrollAuto = true ? {
41244 name: "umwchj",
41245 styles: "overflow-y:auto"
41246} : 0;
41247
41248
41249;// ./node_modules/@wordpress/components/build-module/scrollable/hook.js
41250
41251
41252
41253
41254function useScrollable(props) {
41255 const {
41256 className,
41257 scrollDirection = "y",
41258 smoothScroll = false,
41259 ...otherProps
41260 } = useContextSystem(props, "Scrollable");
41261 const cx = useCx();
41262 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(Scrollable, scrollableScrollbar, smoothScroll && styles_smoothScroll, scrollDirection === "x" && scrollX, scrollDirection === "y" && scrollY, scrollDirection === "auto" && scrollAuto, className), [className, cx, scrollDirection, smoothScroll]);
41263 return {
41264 ...otherProps,
41265 className: classes
41266 };
41267}
41268
41269
41270;// ./node_modules/@wordpress/components/build-module/scrollable/component.js
41271
41272
41273
41274
41275function UnconnectedScrollable(props, forwardedRef) {
41276 const scrollableProps = useScrollable(props);
41277 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41278 ...scrollableProps,
41279 ref: forwardedRef
41280 });
41281}
41282const component_Scrollable = contextConnect(UnconnectedScrollable, "Scrollable");
41283var scrollable_component_component_default = component_Scrollable;
41284
41285
41286;// ./node_modules/@wordpress/components/build-module/card/card-body/hook.js
41287
41288
41289
41290
41291function useCardBody(props) {
41292 const {
41293 className,
41294 isScrollable = false,
41295 isShady = false,
41296 size = "medium",
41297 ...otherProps
41298 } = useContextSystem(props, "CardBody");
41299 const cx = useCx();
41300 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
41301 Body,
41302 borderRadius,
41303 cardPaddings[size],
41304 isShady && shady,
41305 // This classname is added for legacy compatibility reasons.
41306 "components-card__body",
41307 className
41308 ), [className, cx, isShady, size]);
41309 return {
41310 ...otherProps,
41311 className: classes,
41312 isScrollable
41313 };
41314}
41315
41316
41317;// ./node_modules/@wordpress/components/build-module/card/card-body/component.js
41318
41319
41320
41321
41322
41323function UnconnectedCardBody(props, forwardedRef) {
41324 const {
41325 isScrollable,
41326 ...otherProps
41327 } = useCardBody(props);
41328 if (isScrollable) {
41329 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scrollable_component_component_default, {
41330 ...otherProps,
41331 ref: forwardedRef
41332 });
41333 }
41334 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41335 ...otherProps,
41336 ref: forwardedRef
41337 });
41338}
41339const CardBody = contextConnect(UnconnectedCardBody, "CardBody");
41340var card_body_component_component_default = CardBody;
41341
41342
41343;// ./node_modules/@ariakit/react-core/esm/__chunks/A3CZKICO.js
41344"use client";
41345
41346
41347
41348// src/separator/separator.tsx
41349var A3CZKICO_TagName = "hr";
41350var useSeparator = createHook(
41351 function useSeparator2(_a) {
41352 var _b = _a, { orientation = "horizontal" } = _b, props = __objRest(_b, ["orientation"]);
41353 props = _3YLGPPWQ_spreadValues({
41354 role: "separator",
41355 "aria-orientation": orientation
41356 }, props);
41357 return props;
41358 }
41359);
41360var Separator = forwardRef2(function Separator2(props) {
41361 const htmlProps = useSeparator(props);
41362 return LMDWO4NN_createElement(A3CZKICO_TagName, htmlProps);
41363});
41364
41365
41366
41367;// ./node_modules/@wordpress/components/build-module/divider/styles.js
41368
41369function divider_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
41370 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
41371}
41372
41373
41374
41375const MARGIN_DIRECTIONS = {
41376 vertical: {
41377 start: "marginLeft",
41378 end: "marginRight"
41379 },
41380 horizontal: {
41381 start: "marginTop",
41382 end: "marginBottom"
41383 }
41384};
41385const renderMargin = ({
41386 "aria-orientation": orientation = "horizontal",
41387 margin,
41388 marginStart,
41389 marginEnd
41390}) => /* @__PURE__ */ emotion_react_browser_esm_css(rtl({
41391 [MARGIN_DIRECTIONS[orientation].start]: space(marginStart !== null && marginStart !== void 0 ? marginStart : margin),
41392 [MARGIN_DIRECTIONS[orientation].end]: space(marginEnd !== null && marginEnd !== void 0 ? marginEnd : margin)
41393})(), true ? "" : 0, true ? "" : 0);
41394var divider_styles_ref = true ? {
41395 name: "1u4hpl4",
41396 styles: "display:inline"
41397} : 0;
41398const renderDisplay = ({
41399 "aria-orientation": orientation = "horizontal"
41400}) => {
41401 return orientation === "vertical" ? divider_styles_ref : void 0;
41402};
41403const renderBorder = ({
41404 "aria-orientation": orientation = "horizontal"
41405}) => {
41406 return /* @__PURE__ */ emotion_react_browser_esm_css({
41407 [orientation === "vertical" ? "borderRight" : "borderBottom"]: "1px solid currentColor"
41408 }, true ? "" : 0, true ? "" : 0);
41409};
41410const renderSize = ({
41411 "aria-orientation": orientation = "horizontal"
41412}) => /* @__PURE__ */ emotion_react_browser_esm_css({
41413 height: orientation === "vertical" ? "auto" : 0,
41414 width: orientation === "vertical" ? 0 : "auto"
41415}, true ? "" : 0, true ? "" : 0);
41416const DividerView = /* @__PURE__ */ emotion_styled_base_browser_esm("hr", true ? {
41417 target: "e19on6iw0"
41418} : 0)("border:0;margin:0;", renderDisplay, " ", renderBorder, " ", renderSize, " ", renderMargin, ";" + ( true ? "" : 0));
41419
41420
41421;// ./node_modules/@wordpress/components/build-module/divider/component.js
41422
41423
41424
41425
41426function UnconnectedDivider(props, forwardedRef) {
41427 const contextProps = useContextSystem(props, "Divider");
41428 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Separator, {
41429 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DividerView, {}),
41430 ...contextProps,
41431 ref: forwardedRef
41432 });
41433}
41434const component_Divider = contextConnect(UnconnectedDivider, "Divider");
41435var divider_component_component_default = component_Divider;
41436
41437
41438;// ./node_modules/@wordpress/components/build-module/card/card-divider/hook.js
41439
41440
41441
41442
41443function useCardDivider(props) {
41444 const {
41445 className,
41446 ...otherProps
41447 } = useContextSystem(props, "CardDivider");
41448 const cx = useCx();
41449 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
41450 Divider,
41451 borderColor,
41452 // This classname is added for legacy compatibility reasons.
41453 "components-card__divider",
41454 className
41455 ), [className, cx]);
41456 return {
41457 ...otherProps,
41458 className: classes
41459 };
41460}
41461
41462
41463;// ./node_modules/@wordpress/components/build-module/card/card-divider/component.js
41464
41465
41466
41467
41468function UnconnectedCardDivider(props, forwardedRef) {
41469 const dividerProps = useCardDivider(props);
41470 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(divider_component_component_default, {
41471 ...dividerProps,
41472 ref: forwardedRef
41473 });
41474}
41475const CardDivider = contextConnect(UnconnectedCardDivider, "CardDivider");
41476var card_divider_component_component_default = CardDivider;
41477
41478
41479;// ./node_modules/@wordpress/components/build-module/card/card-footer/hook.js
41480
41481
41482
41483
41484function useCardFooter(props) {
41485 const {
41486 className,
41487 justify,
41488 isBorderless = false,
41489 isShady = false,
41490 size = "medium",
41491 ...otherProps
41492 } = useContextSystem(props, "CardFooter");
41493 const cx = useCx();
41494 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
41495 Footer,
41496 borderRadius,
41497 borderColor,
41498 cardPaddings[size],
41499 isBorderless && borderless,
41500 isShady && shady,
41501 // This classname is added for legacy compatibility reasons.
41502 "components-card__footer",
41503 className
41504 ), [className, cx, isBorderless, isShady, size]);
41505 return {
41506 ...otherProps,
41507 className: classes,
41508 justify
41509 };
41510}
41511
41512
41513;// ./node_modules/@wordpress/components/build-module/card/card-footer/component.js
41514
41515
41516
41517
41518function UnconnectedCardFooter(props, forwardedRef) {
41519 const footerProps = useCardFooter(props);
41520 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_component_component_default, {
41521 ...footerProps,
41522 ref: forwardedRef
41523 });
41524}
41525const CardFooter = contextConnect(UnconnectedCardFooter, "CardFooter");
41526var card_footer_component_component_default = CardFooter;
41527
41528
41529;// ./node_modules/@wordpress/components/build-module/card/card-header/hook.js
41530
41531
41532
41533
41534function useCardHeader(props) {
41535 const {
41536 className,
41537 isBorderless = false,
41538 isShady = false,
41539 size = "medium",
41540 ...otherProps
41541 } = useContextSystem(props, "CardHeader");
41542 const cx = useCx();
41543 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
41544 Header,
41545 borderRadius,
41546 borderColor,
41547 cardPaddings[size],
41548 isBorderless && borderless,
41549 isShady && shady,
41550 // This classname is added for legacy compatibility reasons.
41551 "components-card__header",
41552 className
41553 ), [className, cx, isBorderless, isShady, size]);
41554 return {
41555 ...otherProps,
41556 className: classes
41557 };
41558}
41559
41560
41561;// ./node_modules/@wordpress/components/build-module/card/card-header/component.js
41562
41563
41564
41565
41566function UnconnectedCardHeader(props, forwardedRef) {
41567 const headerProps = useCardHeader(props);
41568 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_component_component_default, {
41569 ...headerProps,
41570 ref: forwardedRef
41571 });
41572}
41573const CardHeader = contextConnect(UnconnectedCardHeader, "CardHeader");
41574var card_header_component_component_default = CardHeader;
41575
41576
41577;// ./node_modules/@wordpress/components/build-module/card/card-media/hook.js
41578
41579
41580
41581
41582function useCardMedia(props) {
41583 const {
41584 className,
41585 ...otherProps
41586 } = useContextSystem(props, "CardMedia");
41587 const cx = useCx();
41588 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(
41589 Media,
41590 borderRadius,
41591 // This classname is added for legacy compatibility reasons.
41592 "components-card__media",
41593 className
41594 ), [className, cx]);
41595 return {
41596 ...otherProps,
41597 className: classes
41598 };
41599}
41600
41601
41602;// ./node_modules/@wordpress/components/build-module/card/card-media/component.js
41603
41604
41605
41606
41607function UnconnectedCardMedia(props, forwardedRef) {
41608 const cardMediaProps = useCardMedia(props);
41609 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41610 ...cardMediaProps,
41611 ref: forwardedRef
41612 });
41613}
41614const CardMedia = contextConnect(UnconnectedCardMedia, "CardMedia");
41615var card_media_component_component_default = CardMedia;
41616
41617
41618;// ./node_modules/@wordpress/components/build-module/checkbox-control/index.js
41619
41620
41621
41622
41623
41624
41625
41626
41627function CheckboxControl(props) {
41628 const {
41629 __nextHasNoMarginBottom,
41630 label,
41631 className,
41632 heading,
41633 checked,
41634 indeterminate,
41635 help,
41636 id: idProp,
41637 onChange,
41638 onClick,
41639 ...additionalProps
41640 } = props;
41641 if (heading) {
41642 external_wp_deprecated_default()("`heading` prop in `CheckboxControl`", {
41643 alternative: "a separate element to implement a heading",
41644 since: "5.8"
41645 });
41646 }
41647 const [showCheckedIcon, setShowCheckedIcon] = (0,external_wp_element_namespaceObject.useState)(false);
41648 const [showIndeterminateIcon, setShowIndeterminateIcon] = (0,external_wp_element_namespaceObject.useState)(false);
41649 const ref = (0,external_wp_compose_namespaceObject.useRefEffect)((node) => {
41650 if (!node) {
41651 return;
41652 }
41653 node.indeterminate = !!indeterminate;
41654 setShowCheckedIcon(node.matches(":checked"));
41655 setShowIndeterminateIcon(node.matches(":indeterminate"));
41656 }, [checked, indeterminate]);
41657 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(CheckboxControl, "inspector-checkbox-control", idProp);
41658 const onChangeValue = (event) => onChange(event.target.checked);
41659 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
41660 __nextHasNoMarginBottom,
41661 __associatedWPComponentName: "CheckboxControl",
41662 label: heading,
41663 id,
41664 help: help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
41665 className: "components-checkbox-control__help",
41666 children: help
41667 }),
41668 className: dist_clsx("components-checkbox-control", className),
41669 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
41670 spacing: 0,
41671 justify: "start",
41672 alignment: "top",
41673 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
41674 className: "components-checkbox-control__input-container",
41675 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
41676 ref,
41677 id,
41678 className: "components-checkbox-control__input",
41679 type: "checkbox",
41680 value: "1",
41681 onChange: onChangeValue,
41682 checked,
41683 "aria-describedby": !!help ? id + "__help" : void 0,
41684 onClick: (event) => {
41685 event.currentTarget.focus();
41686 onClick?.(event);
41687 },
41688 ...additionalProps
41689 }), showIndeterminateIcon ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
41690 icon: reset_default,
41691 className: "components-checkbox-control__indeterminate",
41692 role: "presentation"
41693 }) : null, showCheckedIcon ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
41694 icon: check_default,
41695 className: "components-checkbox-control__checked",
41696 role: "presentation"
41697 }) : null]
41698 }), label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
41699 className: "components-checkbox-control__label",
41700 htmlFor: id,
41701 children: label
41702 })]
41703 })
41704 });
41705}
41706var checkbox_control_default = CheckboxControl;
41707
41708
41709;// ./node_modules/@wordpress/components/build-module/clipboard-button/index.js
41710
41711
41712
41713
41714
41715
41716const TIMEOUT = 4e3;
41717function ClipboardButton({
41718 className,
41719 children,
41720 onCopy,
41721 onFinishCopy,
41722 text,
41723 ...buttonProps
41724}) {
41725 external_wp_deprecated_default()("wp.components.ClipboardButton", {
41726 since: "5.8",
41727 alternative: "wp.compose.useCopyToClipboard"
41728 });
41729 const timeoutIdRef = (0,external_wp_element_namespaceObject.useRef)();
41730 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
41731 onCopy();
41732 if (timeoutIdRef.current) {
41733 clearTimeout(timeoutIdRef.current);
41734 }
41735 if (onFinishCopy) {
41736 timeoutIdRef.current = setTimeout(() => onFinishCopy(), TIMEOUT);
41737 }
41738 });
41739 (0,external_wp_element_namespaceObject.useEffect)(() => {
41740 return () => {
41741 if (timeoutIdRef.current) {
41742 clearTimeout(timeoutIdRef.current);
41743 }
41744 };
41745 }, []);
41746 const classes = dist_clsx("components-clipboard-button", className);
41747 const focusOnCopyEventTarget = (event) => {
41748 event.target.focus();
41749 };
41750 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
41751 ...buttonProps,
41752 className: classes,
41753 ref,
41754 onCopy: focusOnCopyEventTarget,
41755 children
41756 });
41757}
41758
41759
41760;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
41761
41762
41763var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
41764
41765
41766;// ./node_modules/@wordpress/components/build-module/item-group/styles.js
41767function item_group_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
41768 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
41769}
41770
41771
41772const unstyledButton = (as) => {
41773 return /* @__PURE__ */ emotion_react_browser_esm_css("font-size:", font("default.fontSize"), ";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:", as === "a" ? "none" : void 0, ";svg,path{fill:currentColor;}&:hover{color:", COLORS.theme.accent, ";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0), true ? "" : 0);
41774};
41775const itemWrapper = true ? {
41776 name: "1bcj5ek",
41777 styles: "width:100%;display:block"
41778} : 0;
41779const item = true ? {
41780 name: "150ruhm",
41781 styles: "box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"
41782} : 0;
41783const bordered = /* @__PURE__ */ emotion_react_browser_esm_css("border:1px solid ", config_values_default.surfaceBorderColor, ";" + ( true ? "" : 0), true ? "" : 0);
41784const separated = /* @__PURE__ */ emotion_react_browser_esm_css(">*:not( marquee )>*{border-bottom:1px solid ", config_values_default.surfaceBorderColor, ";}>*:last-of-type>*{border-bottom-color:transparent;}" + ( true ? "" : 0), true ? "" : 0);
41785const styles_borderRadius = config_values_default.radiusSmall;
41786const styles_spacedAround = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", styles_borderRadius, ";" + ( true ? "" : 0), true ? "" : 0);
41787const styles_rounded = /* @__PURE__ */ emotion_react_browser_esm_css("border-radius:", styles_borderRadius, ";>*:first-of-type>*{border-top-left-radius:", styles_borderRadius, ";border-top-right-radius:", styles_borderRadius, ";}>*:last-of-type>*{border-bottom-left-radius:", styles_borderRadius, ";border-bottom-right-radius:", styles_borderRadius, ";}" + ( true ? "" : 0), true ? "" : 0);
41788const baseFontHeight = `calc(${config_values_default.fontSize} * ${config_values_default.fontLineHeightBase})`;
41789const paddingY = `calc((${config_values_default.controlHeight} - ${baseFontHeight} - 2px) / 2)`;
41790const paddingYSmall = `calc((${config_values_default.controlHeightSmall} - ${baseFontHeight} - 2px) / 2)`;
41791const paddingYLarge = `calc((${config_values_default.controlHeightLarge} - ${baseFontHeight} - 2px) / 2)`;
41792const itemSizes = {
41793 small: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingYSmall, " ", config_values_default.controlPaddingXSmall, "px;" + ( true ? "" : 0), true ? "" : 0),
41794 medium: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingY, " ", config_values_default.controlPaddingX, "px;" + ( true ? "" : 0), true ? "" : 0),
41795 large: /* @__PURE__ */ emotion_react_browser_esm_css("padding:", paddingYLarge, " ", config_values_default.controlPaddingXLarge, "px;" + ( true ? "" : 0), true ? "" : 0)
41796};
41797
41798
41799;// ./node_modules/@wordpress/components/build-module/item-group/context.js
41800
41801const ItemGroupContext = (0,external_wp_element_namespaceObject.createContext)({
41802 size: "medium"
41803});
41804ItemGroupContext.displayName = "ItemGroupContext";
41805const useItemGroupContext = () => (0,external_wp_element_namespaceObject.useContext)(ItemGroupContext);
41806
41807
41808;// ./node_modules/@wordpress/components/build-module/item-group/item/hook.js
41809
41810
41811
41812
41813
41814function useItem(props) {
41815 const {
41816 as: asProp,
41817 className,
41818 onClick,
41819 role = "listitem",
41820 size: sizeProp,
41821 ...otherProps
41822 } = useContextSystem(props, "Item");
41823 const {
41824 spacedAround,
41825 size: contextSize
41826 } = useItemGroupContext();
41827 const size = sizeProp || contextSize;
41828 const as = asProp || (typeof onClick !== "undefined" ? "button" : "div");
41829 const cx = useCx();
41830 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx((as === "button" || as === "a") && unstyledButton(as), itemSizes[size] || itemSizes.medium, item, spacedAround && styles_spacedAround, className), [as, className, cx, size, spacedAround]);
41831 const wrapperClassName = cx(itemWrapper);
41832 return {
41833 as,
41834 className: classes,
41835 onClick,
41836 wrapperClassName,
41837 role,
41838 ...otherProps
41839 };
41840}
41841
41842
41843;// ./node_modules/@wordpress/components/build-module/item-group/item/component.js
41844
41845
41846
41847
41848function UnconnectedItem(props, forwardedRef) {
41849 const {
41850 role,
41851 wrapperClassName,
41852 ...otherProps
41853 } = useItem(props);
41854 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
41855 role,
41856 className: wrapperClassName,
41857 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41858 ...otherProps,
41859 ref: forwardedRef
41860 })
41861 });
41862}
41863const component_Item = contextConnect(UnconnectedItem, "Item");
41864var item_component_component_default = component_Item;
41865
41866
41867;// ./node_modules/@wordpress/components/build-module/item-group/item-group/hook.js
41868
41869
41870
41871function useItemGroup(props) {
41872 const {
41873 className,
41874 isBordered = false,
41875 isRounded = true,
41876 isSeparated = false,
41877 role = "list",
41878 ...otherProps
41879 } = useContextSystem(props, "ItemGroup");
41880 const cx = useCx();
41881 const classes = cx(isBordered && bordered, isSeparated && separated, isRounded && styles_rounded, className);
41882 return {
41883 isBordered,
41884 className: classes,
41885 role,
41886 isSeparated,
41887 ...otherProps
41888 };
41889}
41890
41891
41892;// ./node_modules/@wordpress/components/build-module/item-group/item-group/component.js
41893
41894
41895
41896
41897
41898function UnconnectedItemGroup(props, forwardedRef) {
41899 const {
41900 isBordered,
41901 isSeparated,
41902 size: sizeProp,
41903 ...otherProps
41904 } = useItemGroup(props);
41905 const {
41906 size: contextSize
41907 } = useItemGroupContext();
41908 const spacedAround = !isBordered && !isSeparated;
41909 const size = sizeProp || contextSize;
41910 const contextValue = {
41911 spacedAround,
41912 size
41913 };
41914 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemGroupContext.Provider, {
41915 value: contextValue,
41916 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
41917 ...otherProps,
41918 ref: forwardedRef
41919 })
41920 });
41921}
41922const ItemGroup = contextConnect(UnconnectedItemGroup, "ItemGroup");
41923var item_group_component_component_default = ItemGroup;
41924
41925
41926;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/constants.js
41927const GRADIENT_MARKERS_WIDTH = 16;
41928const INSERT_POINT_WIDTH = 16;
41929const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10;
41930const MINIMUM_DISTANCE_BETWEEN_POINTS = 0;
41931const MINIMUM_SIGNIFICANT_MOVE = 5;
41932const KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
41933const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2;
41934
41935
41936;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/utils.js
41937
41938function clampPercent(value) {
41939 return Math.max(0, Math.min(100, value));
41940}
41941function isOverlapping(value, initialIndex, newPosition, minDistance = MINIMUM_DISTANCE_BETWEEN_POINTS) {
41942 const initialPosition = value[initialIndex].position;
41943 const minPosition = Math.min(initialPosition, newPosition);
41944 const maxPosition = Math.max(initialPosition, newPosition);
41945 return value.some(({
41946 position
41947 }, index) => {
41948 return index !== initialIndex && (Math.abs(position - newPosition) < minDistance || minPosition < position && position < maxPosition);
41949 });
41950}
41951function addControlPoint(points, position, color) {
41952 const nextIndex = points.findIndex((point) => point.position > position);
41953 const newPoint = {
41954 color,
41955 position
41956 };
41957 const newPoints = points.slice();
41958 newPoints.splice(nextIndex - 1, 0, newPoint);
41959 return newPoints;
41960}
41961function removeControlPoint(points, index) {
41962 return points.filter((_point, pointIndex) => {
41963 return pointIndex !== index;
41964 });
41965}
41966function updateControlPoint(points, index, newPoint) {
41967 const newValue = points.slice();
41968 newValue[index] = newPoint;
41969 return newValue;
41970}
41971function updateControlPointPosition(points, index, newPosition) {
41972 if (isOverlapping(points, index, newPosition)) {
41973 return points;
41974 }
41975 const newPoint = {
41976 ...points[index],
41977 position: newPosition
41978 };
41979 return updateControlPoint(points, index, newPoint);
41980}
41981function updateControlPointColor(points, index, newColor) {
41982 const newPoint = {
41983 ...points[index],
41984 color: newColor
41985 };
41986 return updateControlPoint(points, index, newPoint);
41987}
41988function updateControlPointColorByPosition(points, position, newColor) {
41989 const index = points.findIndex((point) => point.position === position);
41990 return updateControlPointColor(points, index, newColor);
41991}
41992function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElement) {
41993 if (!containerElement) {
41994 return;
41995 }
41996 const {
41997 x,
41998 width
41999 } = containerElement.getBoundingClientRect();
42000 const absolutePositionValue = mouseXCoordinate - x;
42001 return Math.round(clampPercent(absolutePositionValue * 100 / width));
42002}
42003
42004
42005;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/control-points.js
42006
42007
42008
42009
42010
42011
42012
42013
42014
42015
42016
42017
42018
42019
42020
42021function ControlPointButton({
42022 isOpen,
42023 position,
42024 color,
42025 ...additionalProps
42026}) {
42027 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ControlPointButton);
42028 const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`;
42029 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
42030 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
42031 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
42032 // translators: 1: gradient position e.g: 70. 2: gradient color code e.g: rgb(52,121,151).
42033 (0,external_wp_i18n_namespaceObject.__)("Gradient control point at position %1$d%% with color code %2$s."),
42034 position,
42035 color
42036 ),
42037 "aria-describedby": descriptionId,
42038 "aria-haspopup": "true",
42039 "aria-expanded": isOpen,
42040 __next40pxDefaultSize: true,
42041 className: dist_clsx("components-custom-gradient-picker__control-point-button", {
42042 "is-active": isOpen
42043 }),
42044 ...additionalProps
42045 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
42046 id: descriptionId,
42047 children: (0,external_wp_i18n_namespaceObject.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")
42048 })]
42049 });
42050}
42051function GradientColorPickerDropdown({
42052 isRenderedInSidebar,
42053 className,
42054 ...props
42055}) {
42056 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
42057 placement: "bottom",
42058 offset: 8,
42059 // Disabling resize as it would otherwise cause the popover to show
42060 // scrollbars while dragging the color picker's handle close to the
42061 // popover edge.
42062 resize: false
42063 }), []);
42064 const mergedClassName = dist_clsx("components-custom-gradient-picker__control-point-dropdown", className);
42065 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomColorPickerDropdown, {
42066 isRenderedInSidebar,
42067 popoverProps,
42068 className: mergedClassName,
42069 ...props
42070 });
42071}
42072function ControlPoints({
42073 disableRemove,
42074 disableAlpha,
42075 gradientPickerDomRef,
42076 ignoreMarkerPosition,
42077 value: controlPoints,
42078 onChange,
42079 onStartControlPointChange,
42080 onStopControlPointChange,
42081 __experimentalIsRenderedInSidebar
42082}) {
42083 const controlPointMoveStateRef = (0,external_wp_element_namespaceObject.useRef)();
42084 const onMouseMove = (event) => {
42085 if (controlPointMoveStateRef.current === void 0 || gradientPickerDomRef.current === null) {
42086 return;
42087 }
42088 const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current);
42089 const {
42090 initialPosition,
42091 index,
42092 significantMoveHappened
42093 } = controlPointMoveStateRef.current;
42094 if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {
42095 controlPointMoveStateRef.current.significantMoveHappened = true;
42096 }
42097 onChange(updateControlPointPosition(controlPoints, index, relativePosition));
42098 };
42099 const cleanEventListeners = () => {
42100 if (window && window.removeEventListener && controlPointMoveStateRef.current && controlPointMoveStateRef.current.listenersActivated) {
42101 window.removeEventListener("mousemove", onMouseMove);
42102 window.removeEventListener("mouseup", cleanEventListeners);
42103 onStopControlPointChange();
42104 controlPointMoveStateRef.current.listenersActivated = false;
42105 }
42106 };
42107 const cleanEventListenersRef = (0,external_wp_element_namespaceObject.useRef)();
42108 cleanEventListenersRef.current = cleanEventListeners;
42109 (0,external_wp_element_namespaceObject.useEffect)(() => {
42110 return () => {
42111 cleanEventListenersRef.current?.();
42112 };
42113 }, []);
42114 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
42115 children: controlPoints.map((point, index) => {
42116 const initialPosition = point?.position;
42117 return ignoreMarkerPosition !== initialPosition && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientColorPickerDropdown, {
42118 isRenderedInSidebar: __experimentalIsRenderedInSidebar,
42119 onClose: onStopControlPointChange,
42120 renderToggle: ({
42121 isOpen,
42122 onToggle
42123 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlPointButton, {
42124 onClick: () => {
42125 if (controlPointMoveStateRef.current && controlPointMoveStateRef.current.significantMoveHappened) {
42126 return;
42127 }
42128 if (isOpen) {
42129 onStopControlPointChange();
42130 } else {
42131 onStartControlPointChange();
42132 }
42133 onToggle();
42134 },
42135 onMouseDown: () => {
42136 if (window && window.addEventListener) {
42137 controlPointMoveStateRef.current = {
42138 initialPosition,
42139 index,
42140 significantMoveHappened: false,
42141 listenersActivated: true
42142 };
42143 onStartControlPointChange();
42144 window.addEventListener("mousemove", onMouseMove);
42145 window.addEventListener("mouseup", cleanEventListeners);
42146 }
42147 },
42148 onKeyDown: (event) => {
42149 if (event.code === "ArrowLeft") {
42150 event.stopPropagation();
42151 onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position - KEYBOARD_CONTROL_POINT_VARIATION)));
42152 } else if (event.code === "ArrowRight") {
42153 event.stopPropagation();
42154 onChange(updateControlPointPosition(controlPoints, index, clampPercent(point.position + KEYBOARD_CONTROL_POINT_VARIATION)));
42155 }
42156 },
42157 isOpen,
42158 position: point.position,
42159 color: point.color
42160 }, index),
42161 renderContent: ({
42162 onClose
42163 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(dropdown_content_wrapper_default, {
42164 paddingSize: "none",
42165 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
42166 enableAlpha: !disableAlpha,
42167 color: point.color,
42168 onChange: (color) => {
42169 onChange(updateControlPointColor(controlPoints, index, w(color).toRgbString()));
42170 }
42171 }), !disableRemove && controlPoints.length > 2 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(h_stack_component_component_default, {
42172 className: "components-custom-gradient-picker__remove-control-point-wrapper",
42173 alignment: "center",
42174 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
42175 onClick: () => {
42176 onChange(removeControlPoint(controlPoints, index));
42177 onClose();
42178 },
42179 variant: "link",
42180 children: (0,external_wp_i18n_namespaceObject.__)("Remove Control Point")
42181 })
42182 })]
42183 }),
42184 style: {
42185 left: `${point.position}%`,
42186 transform: "translateX( -50% )"
42187 }
42188 }, index);
42189 })
42190 });
42191}
42192function InsertPoint({
42193 value: controlPoints,
42194 onChange,
42195 onOpenInserter,
42196 onCloseInserter,
42197 insertPosition,
42198 disableAlpha,
42199 __experimentalIsRenderedInSidebar
42200}) {
42201 const [alreadyInsertedPoint, setAlreadyInsertedPoint] = (0,external_wp_element_namespaceObject.useState)(false);
42202 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientColorPickerDropdown, {
42203 isRenderedInSidebar: __experimentalIsRenderedInSidebar,
42204 className: "components-custom-gradient-picker__inserter",
42205 onClose: () => {
42206 onCloseInserter();
42207 },
42208 renderToggle: ({
42209 isOpen,
42210 onToggle
42211 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
42212 __next40pxDefaultSize: true,
42213 "aria-expanded": isOpen,
42214 "aria-haspopup": "true",
42215 onClick: () => {
42216 if (isOpen) {
42217 onCloseInserter();
42218 } else {
42219 setAlreadyInsertedPoint(false);
42220 onOpenInserter();
42221 }
42222 onToggle();
42223 },
42224 className: "components-custom-gradient-picker__insert-point-dropdown",
42225 icon: plus_default
42226 }),
42227 renderContent: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_content_wrapper_default, {
42228 paddingSize: "none",
42229 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
42230 enableAlpha: !disableAlpha,
42231 onChange: (color) => {
42232 if (!alreadyInsertedPoint) {
42233 onChange(addControlPoint(controlPoints, insertPosition, w(color).toRgbString()));
42234 setAlreadyInsertedPoint(true);
42235 } else {
42236 onChange(updateControlPointColorByPosition(controlPoints, insertPosition, w(color).toRgbString()));
42237 }
42238 }
42239 })
42240 }),
42241 style: insertPosition !== null ? {
42242 left: `${insertPosition}%`,
42243 transform: "translateX( -50% )"
42244 } : void 0
42245 });
42246}
42247ControlPoints.InsertPoint = InsertPoint;
42248var control_points_default = ControlPoints;
42249
42250
42251;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/index.js
42252
42253
42254
42255
42256
42257
42258const customGradientBarReducer = (state, action) => {
42259 switch (action.type) {
42260 case "MOVE_INSERTER":
42261 if (state.id === "IDLE" || state.id === "MOVING_INSERTER") {
42262 return {
42263 id: "MOVING_INSERTER",
42264 insertPosition: action.insertPosition
42265 };
42266 }
42267 break;
42268 case "STOP_INSERTER_MOVE":
42269 if (state.id === "MOVING_INSERTER") {
42270 return {
42271 id: "IDLE"
42272 };
42273 }
42274 break;
42275 case "OPEN_INSERTER":
42276 if (state.id === "MOVING_INSERTER") {
42277 return {
42278 id: "INSERTING_CONTROL_POINT",
42279 insertPosition: state.insertPosition
42280 };
42281 }
42282 break;
42283 case "CLOSE_INSERTER":
42284 if (state.id === "INSERTING_CONTROL_POINT") {
42285 return {
42286 id: "IDLE"
42287 };
42288 }
42289 break;
42290 case "START_CONTROL_CHANGE":
42291 if (state.id === "IDLE") {
42292 return {
42293 id: "MOVING_CONTROL_POINT"
42294 };
42295 }
42296 break;
42297 case "STOP_CONTROL_CHANGE":
42298 if (state.id === "MOVING_CONTROL_POINT") {
42299 return {
42300 id: "IDLE"
42301 };
42302 }
42303 break;
42304 }
42305 return state;
42306};
42307const customGradientBarReducerInitialState = {
42308 id: "IDLE"
42309};
42310function CustomGradientBar({
42311 background,
42312 hasGradient,
42313 value: controlPoints,
42314 onChange,
42315 disableInserter = false,
42316 disableAlpha = false,
42317 __experimentalIsRenderedInSidebar = false
42318}) {
42319 const gradientMarkersContainerDomRef = (0,external_wp_element_namespaceObject.useRef)(null);
42320 const [gradientBarState, gradientBarStateDispatch] = (0,external_wp_element_namespaceObject.useReducer)(customGradientBarReducer, customGradientBarReducerInitialState);
42321 const onMouseEnterAndMove = (event) => {
42322 if (!gradientMarkersContainerDomRef.current) {
42323 return;
42324 }
42325 const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientMarkersContainerDomRef.current);
42326 if (controlPoints.some(({
42327 position
42328 }) => {
42329 return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
42330 })) {
42331 if (gradientBarState.id === "MOVING_INSERTER") {
42332 gradientBarStateDispatch({
42333 type: "STOP_INSERTER_MOVE"
42334 });
42335 }
42336 return;
42337 }
42338 gradientBarStateDispatch({
42339 type: "MOVE_INSERTER",
42340 insertPosition
42341 });
42342 };
42343 const onMouseLeave = () => {
42344 gradientBarStateDispatch({
42345 type: "STOP_INSERTER_MOVE"
42346 });
42347 };
42348 const isMovingInserter = gradientBarState.id === "MOVING_INSERTER";
42349 const isInsertingControlPoint = gradientBarState.id === "INSERTING_CONTROL_POINT";
42350 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
42351 className: dist_clsx("components-custom-gradient-picker__gradient-bar", {
42352 "has-gradient": hasGradient
42353 }),
42354 onMouseEnter: onMouseEnterAndMove,
42355 onMouseMove: onMouseEnterAndMove,
42356 onMouseLeave,
42357 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
42358 className: "components-custom-gradient-picker__gradient-bar-background",
42359 style: {
42360 background,
42361 opacity: hasGradient ? 1 : 0.4
42362 }
42363 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
42364 ref: gradientMarkersContainerDomRef,
42365 className: "components-custom-gradient-picker__markers-container",
42366 children: [!disableInserter && (isMovingInserter || isInsertingControlPoint) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(control_points_default.InsertPoint, {
42367 __experimentalIsRenderedInSidebar,
42368 disableAlpha,
42369 insertPosition: gradientBarState.insertPosition,
42370 value: controlPoints,
42371 onChange,
42372 onOpenInserter: () => {
42373 gradientBarStateDispatch({
42374 type: "OPEN_INSERTER"
42375 });
42376 },
42377 onCloseInserter: () => {
42378 gradientBarStateDispatch({
42379 type: "CLOSE_INSERTER"
42380 });
42381 }
42382 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(control_points_default, {
42383 __experimentalIsRenderedInSidebar,
42384 disableAlpha,
42385 disableRemove: disableInserter,
42386 gradientPickerDomRef: gradientMarkersContainerDomRef,
42387 ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : void 0,
42388 value: controlPoints,
42389 onChange,
42390 onStartControlPointChange: () => {
42391 gradientBarStateDispatch({
42392 type: "START_CONTROL_CHANGE"
42393 });
42394 },
42395 onStopControlPointChange: () => {
42396 gradientBarStateDispatch({
42397 type: "STOP_CONTROL_CHANGE"
42398 });
42399 }
42400 })]
42401 })]
42402 });
42403}
42404
42405
42406// EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js
42407var build_node = __webpack_require__(8924);
42408;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js
42409
42410const DEFAULT_GRADIENT = "linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)";
42411const DEFAULT_LINEAR_GRADIENT_ANGLE = 180;
42412const HORIZONTAL_GRADIENT_ORIENTATION = {
42413 type: "angular",
42414 value: "90"
42415};
42416const GRADIENT_OPTIONS = [{
42417 value: "linear-gradient",
42418 label: (0,external_wp_i18n_namespaceObject.__)("Linear")
42419}, {
42420 value: "radial-gradient",
42421 label: (0,external_wp_i18n_namespaceObject.__)("Radial")
42422}];
42423const DIRECTIONAL_ORIENTATION_ANGLE_MAP = {
42424 top: 0,
42425 "top right": 45,
42426 "right top": 45,
42427 right: 90,
42428 "right bottom": 135,
42429 "bottom right": 135,
42430 bottom: 180,
42431 "bottom left": 225,
42432 "left bottom": 225,
42433 left: 270,
42434 "top left": 315,
42435 "left top": 315
42436};
42437
42438
42439;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/serializer.js
42440function serializeGradientColor({
42441 type,
42442 value
42443}) {
42444 if (type === "literal") {
42445 return value;
42446 }
42447 if (type === "hex") {
42448 return `#${value}`;
42449 }
42450 if (type === "var") {
42451 return `var(${value})`;
42452 }
42453 if (type === "hsl") {
42454 const [hue, saturation, lightness] = value;
42455 return `hsl(${hue},${saturation}%,${lightness}%)`;
42456 }
42457 if (type === "hsla") {
42458 const [hue, saturation, lightness, alpha] = value;
42459 return `hsla(${hue},${saturation}%,${lightness}%,${alpha})`;
42460 }
42461 return `${type}(${value.join(",")})`;
42462}
42463function serializeGradientPosition(position) {
42464 if (!position) {
42465 return "";
42466 }
42467 const {
42468 value,
42469 type
42470 } = position;
42471 if (type === "calc") {
42472 return `calc(${value})`;
42473 }
42474 return `${value}${type}`;
42475}
42476function serializeGradientColorStop({
42477 type,
42478 value,
42479 length
42480}) {
42481 return `${serializeGradientColor({
42482 type,
42483 value
42484 })} ${serializeGradientPosition(length)}`;
42485}
42486function serializeGradientOrientation(orientation) {
42487 if (Array.isArray(orientation) || !orientation || orientation.type !== "angular") {
42488 return;
42489 }
42490 return `${orientation.value}deg`;
42491}
42492function serializeGradient({
42493 type,
42494 orientation,
42495 colorStops
42496}) {
42497 const serializedOrientation = serializeGradientOrientation(orientation);
42498 const serializedColorStops = colorStops.sort((colorStop1, colorStop2) => {
42499 const getNumericStopValue = (colorStop) => {
42500 return colorStop?.length?.value === void 0 ? 0 : parseInt(colorStop.length.value);
42501 };
42502 return getNumericStopValue(colorStop1) - getNumericStopValue(colorStop2);
42503 }).map(serializeGradientColorStop);
42504 return `${type}(${[serializedOrientation, ...serializedColorStops].filter(Boolean).join(",")})`;
42505}
42506
42507
42508;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/utils.js
42509
42510
42511
42512
42513
42514k([names]);
42515function getLinearGradientRepresentation(gradientAST) {
42516 return serializeGradient({
42517 type: "linear-gradient",
42518 orientation: HORIZONTAL_GRADIENT_ORIENTATION,
42519 colorStops: gradientAST.colorStops
42520 });
42521}
42522function hasUnsupportedLength(item) {
42523 return item.length === void 0 || item.length.type !== "%";
42524}
42525function getGradientAstWithDefault(value) {
42526 let gradientAST;
42527 let hasGradient = !!value;
42528 const valueToParse = value !== null && value !== void 0 ? value : DEFAULT_GRADIENT;
42529 try {
42530 gradientAST = build_node.parse(valueToParse)[0];
42531 } catch (error) {
42532 console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error", error);
42533 gradientAST = build_node.parse(DEFAULT_GRADIENT)[0];
42534 hasGradient = false;
42535 }
42536 if (!Array.isArray(gradientAST.orientation) && gradientAST.orientation?.type === "directional") {
42537 gradientAST.orientation = {
42538 type: "angular",
42539 value: DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString()
42540 };
42541 }
42542 if (gradientAST.colorStops.some(hasUnsupportedLength)) {
42543 const {
42544 colorStops
42545 } = gradientAST;
42546 const step = 100 / (colorStops.length - 1);
42547 colorStops.forEach((stop, index) => {
42548 stop.length = {
42549 value: `${step * index}`,
42550 type: "%"
42551 };
42552 });
42553 }
42554 return {
42555 gradientAST,
42556 hasGradient
42557 };
42558}
42559function getGradientAstWithControlPoints(gradientAST, newControlPoints) {
42560 return {
42561 ...gradientAST,
42562 colorStops: newControlPoints.map(({
42563 position,
42564 color
42565 }) => {
42566 const {
42567 r,
42568 g,
42569 b,
42570 a
42571 } = w(color).toRgb();
42572 return {
42573 length: {
42574 type: "%",
42575 value: position?.toString()
42576 },
42577 type: a < 1 ? "rgba" : "rgb",
42578 value: a < 1 ? [`${r}`, `${g}`, `${b}`, `${a}`] : [`${r}`, `${g}`, `${b}`]
42579 };
42580 })
42581 };
42582}
42583function getStopCssColor(colorStop) {
42584 switch (colorStop.type) {
42585 case "hex":
42586 return `#${colorStop.value}`;
42587 case "literal":
42588 return colorStop.value;
42589 case "var":
42590 return `${colorStop.type}(${colorStop.value})`;
42591 case "rgb":
42592 case "rgba":
42593 return `${colorStop.type}(${colorStop.value.join(",")})`;
42594 case "hsl": {
42595 const [hue, saturation, lightness] = colorStop.value;
42596 return `hsl(${hue},${saturation}%,${lightness}%)`;
42597 }
42598 case "hsla": {
42599 const [hue, saturation, lightness, alpha] = colorStop.value;
42600 return `hsla(${hue},${saturation}%,${lightness}%,${alpha})`;
42601 }
42602 default:
42603 return "transparent";
42604 }
42605}
42606
42607
42608;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js
42609
42610function custom_gradient_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
42611 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
42612}
42613
42614const SelectWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_block_component_component_default, true ? {
42615 target: "e10bzpgi1"
42616} : 0)( true ? {
42617 name: "1gvx10y",
42618 styles: "flex-grow:5"
42619} : 0);
42620const AccessoryWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_block_component_component_default, true ? {
42621 target: "e10bzpgi0"
42622} : 0)( true ? {
42623 name: "1gvx10y",
42624 styles: "flex-grow:5"
42625} : 0);
42626
42627
42628;// ./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js
42629
42630
42631
42632
42633
42634
42635
42636
42637
42638
42639
42640const GradientAnglePicker = ({
42641 gradientAST,
42642 hasGradient,
42643 onChange
42644}) => {
42645 var _gradientAST$orientat;
42646 const angle = (_gradientAST$orientat = gradientAST?.orientation?.value) !== null && _gradientAST$orientat !== void 0 ? _gradientAST$orientat : DEFAULT_LINEAR_GRADIENT_ANGLE;
42647 const onAngleChange = (newAngle) => {
42648 onChange(serializeGradient({
42649 ...gradientAST,
42650 orientation: {
42651 type: "angular",
42652 value: `${newAngle}`
42653 }
42654 }));
42655 };
42656 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(angle_picker_control_default, {
42657 onChange: onAngleChange,
42658 value: hasGradient ? angle : ""
42659 });
42660};
42661const GradientTypePicker = ({
42662 gradientAST,
42663 hasGradient,
42664 onChange
42665}) => {
42666 const {
42667 type
42668 } = gradientAST;
42669 const onSetLinearGradient = () => {
42670 onChange(serializeGradient({
42671 ...gradientAST,
42672 orientation: gradientAST.orientation ? void 0 : HORIZONTAL_GRADIENT_ORIENTATION,
42673 type: "linear-gradient"
42674 }));
42675 };
42676 const onSetRadialGradient = () => {
42677 const {
42678 orientation,
42679 ...restGradientAST
42680 } = gradientAST;
42681 onChange(serializeGradient({
42682 ...restGradientAST,
42683 type: "radial-gradient"
42684 }));
42685 };
42686 const handleOnChange = (next) => {
42687 if (next === "linear-gradient") {
42688 onSetLinearGradient();
42689 }
42690 if (next === "radial-gradient") {
42691 onSetRadialGradient();
42692 }
42693 };
42694 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
42695 __nextHasNoMarginBottom: true,
42696 className: "components-custom-gradient-picker__type-picker",
42697 label: (0,external_wp_i18n_namespaceObject.__)("Type"),
42698 labelPosition: "top",
42699 onChange: handleOnChange,
42700 options: GRADIENT_OPTIONS,
42701 size: "__unstable-large",
42702 value: hasGradient ? type : void 0
42703 });
42704};
42705function CustomGradientPicker({
42706 value,
42707 onChange,
42708 enableAlpha = true,
42709 __experimentalIsRenderedInSidebar = false
42710}) {
42711 const {
42712 gradientAST,
42713 hasGradient
42714 } = getGradientAstWithDefault(value);
42715 const background = getLinearGradientRepresentation(gradientAST);
42716 const controlPoints = gradientAST.colorStops.map((colorStop) => {
42717 return {
42718 color: getStopCssColor(colorStop),
42719 // Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,
42720 // TypeScript doesn't know that `colorStop.length` is not undefined here.
42721 // @ts-expect-error
42722 position: parseInt(colorStop.length.value)
42723 };
42724 });
42725 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
42726 spacing: 4,
42727 className: "components-custom-gradient-picker",
42728 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomGradientBar, {
42729 __experimentalIsRenderedInSidebar,
42730 disableAlpha: !enableAlpha,
42731 background,
42732 hasGradient,
42733 value: controlPoints,
42734 onChange: (newControlPoints) => {
42735 onChange(serializeGradient(getGradientAstWithControlPoints(gradientAST, newControlPoints)));
42736 }
42737 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
42738 gap: 3,
42739 className: "components-custom-gradient-picker__ui-line",
42740 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectWrapper, {
42741 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientTypePicker, {
42742 gradientAST,
42743 hasGradient,
42744 onChange
42745 })
42746 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessoryWrapper, {
42747 children: gradientAST.type === "linear-gradient" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GradientAnglePicker, {
42748 gradientAST,
42749 hasGradient,
42750 onChange
42751 })
42752 })]
42753 })]
42754 });
42755}
42756var custom_gradient_picker_default = CustomGradientPicker;
42757
42758
42759;// ./node_modules/@wordpress/components/build-module/gradient-picker/index.js
42760
42761
42762
42763
42764
42765
42766
42767
42768const isMultipleOriginObject = (obj) => Array.isArray(obj.gradients) && !("gradient" in obj);
42769const isMultipleOriginArray = (arr) => {
42770 return arr.length > 0 && arr.every((gradientObj) => isMultipleOriginObject(gradientObj));
42771};
42772function SingleOrigin({
42773 className,
42774 clearGradient,
42775 gradients,
42776 onChange,
42777 value,
42778 ...additionalProps
42779}) {
42780 const gradientOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
42781 return gradients.map(({
42782 gradient,
42783 name,
42784 slug
42785 }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
42786 value: gradient,
42787 isSelected: value === gradient,
42788 tooltipText: name || // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
42789 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient code: %s"), gradient),
42790 style: {
42791 color: "rgba( 0,0,0,0 )",
42792 background: gradient
42793 },
42794 onClick: value === gradient ? clearGradient : () => onChange(gradient, index),
42795 "aria-label": name ? (
42796 // translators: %s: The name of the gradient e.g: "Angular red to blue".
42797 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient: %s"), name)
42798 ) : (
42799 // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
42800 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Gradient code: %s"), gradient)
42801 )
42802 }, slug));
42803 }, [gradients, value, onChange, clearGradient]);
42804 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.OptionGroup, {
42805 className,
42806 options: gradientOptions,
42807 ...additionalProps
42808 });
42809}
42810function MultipleOrigin({
42811 className,
42812 clearGradient,
42813 gradients,
42814 onChange,
42815 value,
42816 headingLevel
42817}) {
42818 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MultipleOrigin);
42819 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
42820 spacing: 3,
42821 className,
42822 children: gradients.map(({
42823 name,
42824 gradients: gradientSet
42825 }, index) => {
42826 const id = `color-palette-${instanceId}-${index}`;
42827 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
42828 spacing: 2,
42829 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorHeading, {
42830 level: headingLevel,
42831 id,
42832 children: name
42833 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleOrigin, {
42834 clearGradient,
42835 gradients: gradientSet,
42836 onChange: (gradient) => onChange(gradient, index),
42837 value,
42838 "aria-labelledby": id
42839 })]
42840 }, index);
42841 })
42842 });
42843}
42844function Component(props) {
42845 const {
42846 asButtons,
42847 loop,
42848 actions,
42849 headingLevel,
42850 "aria-label": ariaLabel,
42851 "aria-labelledby": ariaLabelledby,
42852 ...additionalProps
42853 } = props;
42854 const options = isMultipleOriginArray(props.gradients) ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MultipleOrigin, {
42855 headingLevel,
42856 ...additionalProps
42857 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleOrigin, {
42858 ...additionalProps
42859 });
42860 const {
42861 metaProps,
42862 labelProps
42863 } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
42864 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
42865 ...metaProps,
42866 ...labelProps,
42867 actions,
42868 options
42869 });
42870}
42871function GradientPicker({
42872 className,
42873 gradients = [],
42874 onChange,
42875 value,
42876 clearable = true,
42877 enableAlpha = true,
42878 disableCustomGradients = false,
42879 __experimentalIsRenderedInSidebar,
42880 headingLevel = 2,
42881 ...additionalProps
42882}) {
42883 const clearGradient = (0,external_wp_element_namespaceObject.useCallback)(() => onChange(void 0), [onChange]);
42884 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
42885 spacing: gradients.length ? 4 : 0,
42886 children: [!disableCustomGradients && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_gradient_picker_default, {
42887 __experimentalIsRenderedInSidebar,
42888 enableAlpha,
42889 value,
42890 onChange
42891 }), (gradients.length > 0 || clearable) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
42892 ...additionalProps,
42893 className,
42894 clearGradient,
42895 gradients,
42896 onChange,
42897 value,
42898 actions: clearable && !disableCustomGradients && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
42899 onClick: clearGradient,
42900 accessibleWhenDisabled: true,
42901 disabled: !value,
42902 children: (0,external_wp_i18n_namespaceObject.__)("Clear")
42903 }),
42904 headingLevel
42905 })]
42906 });
42907}
42908var gradient_picker_default = GradientPicker;
42909
42910
42911;// ./node_modules/@wordpress/icons/build-module/library/menu.js
42912
42913
42914var menu_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) });
42915
42916
42917;// external ["wp","dom"]
42918const external_wp_dom_namespaceObject = window["wp"]["dom"];
42919;// ./node_modules/@wordpress/components/build-module/navigable-container/container.js
42920
42921
42922
42923const container_noop = () => {
42924};
42925const MENU_ITEM_ROLES = ["menuitem", "menuitemradio", "menuitemcheckbox"];
42926function cycleValue(value, total, offset) {
42927 const nextValue = value + offset;
42928 if (nextValue < 0) {
42929 return total + nextValue;
42930 } else if (nextValue >= total) {
42931 return nextValue - total;
42932 }
42933 return nextValue;
42934}
42935class NavigableContainer extends external_wp_element_namespaceObject.Component {
42936 constructor(args) {
42937 super(args);
42938 this.onKeyDown = this.onKeyDown.bind(this);
42939 this.bindContainer = this.bindContainer.bind(this);
42940 this.getFocusableContext = this.getFocusableContext.bind(this);
42941 this.getFocusableIndex = this.getFocusableIndex.bind(this);
42942 }
42943 componentDidMount() {
42944 if (!this.container) {
42945 return;
42946 }
42947 this.container.addEventListener("keydown", this.onKeyDown);
42948 }
42949 componentWillUnmount() {
42950 if (!this.container) {
42951 return;
42952 }
42953 this.container.removeEventListener("keydown", this.onKeyDown);
42954 }
42955 bindContainer(ref) {
42956 const {
42957 forwardedRef
42958 } = this.props;
42959 this.container = ref;
42960 if (typeof forwardedRef === "function") {
42961 forwardedRef(ref);
42962 } else if (forwardedRef && "current" in forwardedRef) {
42963 forwardedRef.current = ref;
42964 }
42965 }
42966 getFocusableContext(target) {
42967 if (!this.container) {
42968 return null;
42969 }
42970 const {
42971 onlyBrowserTabstops
42972 } = this.props;
42973 const finder = onlyBrowserTabstops ? external_wp_dom_namespaceObject.focus.tabbable : external_wp_dom_namespaceObject.focus.focusable;
42974 const focusables = finder.find(this.container);
42975 const index = this.getFocusableIndex(focusables, target);
42976 if (index > -1 && target) {
42977 return {
42978 index,
42979 target,
42980 focusables
42981 };
42982 }
42983 return null;
42984 }
42985 getFocusableIndex(focusables, target) {
42986 return focusables.indexOf(target);
42987 }
42988 onKeyDown(event) {
42989 if (this.props.onKeyDown) {
42990 this.props.onKeyDown(event);
42991 }
42992 const {
42993 getFocusableContext
42994 } = this;
42995 const {
42996 cycle = true,
42997 eventToOffset,
42998 onNavigate = container_noop,
42999 stopNavigationEvents
43000 } = this.props;
43001 const offset = eventToOffset(event);
43002 if (offset !== void 0 && stopNavigationEvents) {
43003 event.stopImmediatePropagation();
43004 const targetRole = event.target?.getAttribute("role");
43005 const targetHasMenuItemRole = !!targetRole && MENU_ITEM_ROLES.includes(targetRole);
43006 if (targetHasMenuItemRole) {
43007 event.preventDefault();
43008 }
43009 }
43010 if (!offset) {
43011 return;
43012 }
43013 const activeElement = event.target?.ownerDocument?.activeElement;
43014 if (!activeElement) {
43015 return;
43016 }
43017 const context = getFocusableContext(activeElement);
43018 if (!context) {
43019 return;
43020 }
43021 const {
43022 index,
43023 focusables
43024 } = context;
43025 const nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
43026 if (nextIndex >= 0 && nextIndex < focusables.length) {
43027 focusables[nextIndex].focus();
43028 onNavigate(nextIndex, focusables[nextIndex]);
43029 if (event.code === "Tab") {
43030 event.preventDefault();
43031 }
43032 }
43033 }
43034 render() {
43035 const {
43036 children,
43037 stopNavigationEvents,
43038 eventToOffset,
43039 onNavigate,
43040 onKeyDown,
43041 cycle,
43042 onlyBrowserTabstops,
43043 forwardedRef,
43044 ...restProps
43045 } = this.props;
43046 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
43047 ref: this.bindContainer,
43048 ...restProps,
43049 children
43050 });
43051 }
43052}
43053const forwardedNavigableContainer = (props, ref) => {
43054 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableContainer, {
43055 ...props,
43056 forwardedRef: ref
43057 });
43058};
43059forwardedNavigableContainer.displayName = "NavigableContainer";
43060var container_default = (0,external_wp_element_namespaceObject.forwardRef)(forwardedNavigableContainer);
43061
43062
43063;// ./node_modules/@wordpress/components/build-module/navigable-container/menu.js
43064
43065
43066
43067function UnforwardedNavigableMenu({
43068 role = "menu",
43069 orientation = "vertical",
43070 ...rest
43071}, ref) {
43072 const eventToOffset = (evt) => {
43073 const {
43074 code
43075 } = evt;
43076 let next = ["ArrowDown"];
43077 let previous = ["ArrowUp"];
43078 if (orientation === "horizontal") {
43079 next = ["ArrowRight"];
43080 previous = ["ArrowLeft"];
43081 }
43082 if (orientation === "both") {
43083 next = ["ArrowRight", "ArrowDown"];
43084 previous = ["ArrowLeft", "ArrowUp"];
43085 }
43086 if (next.includes(code)) {
43087 return 1;
43088 } else if (previous.includes(code)) {
43089 return -1;
43090 } else if (["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(code)) {
43091 return 0;
43092 }
43093 return void 0;
43094 };
43095 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(container_default, {
43096 ref,
43097 stopNavigationEvents: true,
43098 onlyBrowserTabstops: false,
43099 role,
43100 "aria-orientation": role !== "presentation" && (orientation === "vertical" || orientation === "horizontal") ? orientation : void 0,
43101 eventToOffset,
43102 ...rest
43103 });
43104}
43105const NavigableMenu = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigableMenu);
43106var menu_menu_default = NavigableMenu;
43107
43108
43109;// ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js
43110
43111
43112
43113
43114
43115
43116
43117function dropdown_menu_mergeProps(defaultProps = {}, props = {}) {
43118 const mergedProps = {
43119 ...defaultProps,
43120 ...props
43121 };
43122 if (props.className && defaultProps.className) {
43123 mergedProps.className = dist_clsx(props.className, defaultProps.className);
43124 }
43125 return mergedProps;
43126}
43127function dropdown_menu_isFunction(maybeFunc) {
43128 return typeof maybeFunc === "function";
43129}
43130function UnconnectedDropdownMenu(dropdownMenuProps) {
43131 const {
43132 children,
43133 className,
43134 controls,
43135 icon = menu_default,
43136 label,
43137 popoverProps,
43138 toggleProps,
43139 menuProps,
43140 disableOpenOnArrowDown = false,
43141 text,
43142 noIcons,
43143 open,
43144 defaultOpen,
43145 onToggle: onToggleProp,
43146 // Context
43147 variant
43148 } = useContextSystem(dropdownMenuProps, "DropdownMenu");
43149 if (!controls?.length && !dropdown_menu_isFunction(children)) {
43150 return null;
43151 }
43152 let controlSets;
43153 if (controls?.length) {
43154 controlSets = controls;
43155 if (!Array.isArray(controlSets[0])) {
43156 controlSets = [controls];
43157 }
43158 }
43159 const mergedPopoverProps = dropdown_menu_mergeProps({
43160 className: "components-dropdown-menu__popover",
43161 variant
43162 }, popoverProps);
43163 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_default, {
43164 className,
43165 popoverProps: mergedPopoverProps,
43166 renderToggle: ({
43167 isOpen,
43168 onToggle
43169 }) => {
43170 var _toggleProps$showTool;
43171 const openOnArrowDown = (event) => {
43172 if (disableOpenOnArrowDown) {
43173 return;
43174 }
43175 if (!isOpen && event.code === "ArrowDown") {
43176 event.preventDefault();
43177 onToggle();
43178 }
43179 };
43180 const {
43181 as: Toggle = button_default,
43182 ...restToggleProps
43183 } = toggleProps !== null && toggleProps !== void 0 ? toggleProps : {};
43184 const mergedToggleProps = dropdown_menu_mergeProps({
43185 className: dist_clsx("components-dropdown-menu__toggle", {
43186 "is-opened": isOpen
43187 })
43188 }, restToggleProps);
43189 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Toggle, {
43190 ...mergedToggleProps,
43191 icon,
43192 onClick: (event) => {
43193 onToggle();
43194 if (mergedToggleProps.onClick) {
43195 mergedToggleProps.onClick(event);
43196 }
43197 },
43198 onKeyDown: (event) => {
43199 openOnArrowDown(event);
43200 if (mergedToggleProps.onKeyDown) {
43201 mergedToggleProps.onKeyDown(event);
43202 }
43203 },
43204 "aria-haspopup": "true",
43205 "aria-expanded": isOpen,
43206 label,
43207 text,
43208 showTooltip: (_toggleProps$showTool = toggleProps?.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true,
43209 children: mergedToggleProps.children
43210 });
43211 },
43212 renderContent: (props) => {
43213 const mergedMenuProps = dropdown_menu_mergeProps({
43214 "aria-label": label,
43215 className: dist_clsx("components-dropdown-menu__menu", {
43216 "no-icons": noIcons
43217 })
43218 }, menuProps);
43219 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_menu_default, {
43220 ...mergedMenuProps,
43221 role: "menu",
43222 children: [dropdown_menu_isFunction(children) ? children(props) : null, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43223 __next40pxDefaultSize: true,
43224 onClick: (event) => {
43225 event.stopPropagation();
43226 props.onClose();
43227 if (control.onClick) {
43228 control.onClick();
43229 }
43230 },
43231 className: dist_clsx("components-dropdown-menu__menu-item", {
43232 "has-separator": indexOfSet > 0 && indexOfControl === 0,
43233 "is-active": control.isActive,
43234 "is-icon-only": !control.title
43235 }),
43236 icon: control.icon,
43237 label: control.label,
43238 "aria-checked": control.role === "menuitemcheckbox" || control.role === "menuitemradio" ? control.isActive : void 0,
43239 role: control.role === "menuitemcheckbox" || control.role === "menuitemradio" ? control.role : "menuitem",
43240 accessibleWhenDisabled: true,
43241 disabled: control.isDisabled,
43242 children: control.title
43243 }, [indexOfSet, indexOfControl].join())))]
43244 });
43245 },
43246 open,
43247 defaultOpen,
43248 onToggle: onToggleProp
43249 });
43250}
43251const DropdownMenu = contextConnectWithoutRef(UnconnectedDropdownMenu, "DropdownMenu");
43252var dropdown_menu_default = DropdownMenu;
43253
43254
43255;// ./node_modules/@wordpress/components/build-module/palette-edit/styles.js
43256
43257function palette_edit_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
43258 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
43259}
43260
43261
43262
43263
43264
43265
43266
43267
43268const IndicatorStyled = /* @__PURE__ */ emotion_styled_base_browser_esm(color_indicator_default, true ? {
43269 target: "e1lpqc908"
43270} : 0)("&&{flex-shrink:0;width:", space(6), ";height:", space(6), ";}" + ( true ? "" : 0));
43271const NameInputControl = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
43272 target: "e1lpqc907"
43273} : 0)(Container, "{background:", COLORS.gray[100], ";border-radius:", config_values_default.radiusXSmall, ";", Input, Input, Input, Input, "{height:", space(8), ";}", BackdropUI, BackdropUI, BackdropUI, "{border-color:transparent;box-shadow:none;}}" + ( true ? "" : 0));
43274const NameContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
43275 target: "e1lpqc906"
43276} : 0)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;" + ( true ? "" : 0));
43277const PaletteHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
43278 target: "e1lpqc905"
43279} : 0)("text-transform:uppercase;line-height:", space(6), ";font-weight:500;&&&{font-size:11px;margin-bottom:0;}" + ( true ? "" : 0));
43280const PaletteActionsContainer = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
43281 target: "e1lpqc904"
43282} : 0)("height:", space(6), ";display:flex;" + ( true ? "" : 0));
43283const PaletteEditContents = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
43284 target: "e1lpqc903"
43285} : 0)("margin-top:", space(2), ";" + ( true ? "" : 0));
43286const PaletteEditStyles = /* @__PURE__ */ emotion_styled_base_browser_esm(component_default, true ? {
43287 target: "e1lpqc902"
43288} : 0)( true ? {
43289 name: "u6wnko",
43290 styles: "&&&{.components-button.has-icon{min-width:0;padding:0;}}"
43291} : 0);
43292const DoneButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
43293 target: "e1lpqc901"
43294} : 0)("&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0));
43295const RemoveButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
43296 target: "e1lpqc900"
43297} : 0)("&&{margin-top:", space(1), ";}" + ( true ? "" : 0));
43298
43299
43300;// ./node_modules/@wordpress/components/build-module/palette-edit/index.js
43301
43302
43303
43304
43305
43306
43307
43308
43309
43310
43311
43312
43313
43314
43315
43316
43317
43318
43319
43320
43321
43322const DEFAULT_COLOR = "#000";
43323function NameInput({
43324 value,
43325 onChange,
43326 label
43327}) {
43328 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameInputControl, {
43329 size: "compact",
43330 label,
43331 hideLabelFromVision: true,
43332 value,
43333 onChange
43334 });
43335}
43336function deduplicateElementSlugs(elements) {
43337 const slugCounts = {};
43338 return elements.map((element) => {
43339 var _newSlug;
43340 let newSlug;
43341 const {
43342 slug
43343 } = element;
43344 slugCounts[slug] = (slugCounts[slug] || 0) + 1;
43345 if (slugCounts[slug] > 1) {
43346 newSlug = `${slug}-${slugCounts[slug] - 1}`;
43347 }
43348 return {
43349 ...element,
43350 slug: (_newSlug = newSlug) !== null && _newSlug !== void 0 ? _newSlug : slug
43351 };
43352 });
43353}
43354function getNameAndSlugForPosition(elements, slugPrefix) {
43355 const nameRegex = new RegExp(`^${slugPrefix}color-([\\d]+)$`);
43356 const position = elements.reduce((previousValue, currentValue) => {
43357 if (typeof currentValue?.slug === "string") {
43358 const matches = currentValue?.slug.match(nameRegex);
43359 if (matches) {
43360 const id = parseInt(matches[1], 10);
43361 if (id >= previousValue) {
43362 return id + 1;
43363 }
43364 }
43365 }
43366 return previousValue;
43367 }, 1);
43368 return {
43369 name: (0,external_wp_i18n_namespaceObject.sprintf)(
43370 /* translators: %d: is an id for a custom color */
43371 (0,external_wp_i18n_namespaceObject.__)("Color %d"),
43372 position
43373 ),
43374 slug: `${slugPrefix}color-${position}`
43375 };
43376}
43377function ColorPickerPopover({
43378 isGradient,
43379 element,
43380 onChange,
43381 popoverProps: receivedPopoverProps,
43382 onClose = () => {
43383 }
43384}) {
43385 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
43386 shift: true,
43387 offset: 20,
43388 // Disabling resize as it would otherwise cause the popover to show
43389 // scrollbars while dragging the color picker's handle close to the
43390 // popover edge.
43391 resize: false,
43392 placement: "left-start",
43393 ...receivedPopoverProps,
43394 className: dist_clsx("components-palette-edit__popover", receivedPopoverProps?.className)
43395 }), [receivedPopoverProps]);
43396 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(popover_default, {
43397 ...popoverProps,
43398 onClose,
43399 children: [!isGradient && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LegacyAdapter, {
43400 color: element.color,
43401 enableAlpha: true,
43402 onChange: (newColor) => {
43403 onChange({
43404 ...element,
43405 color: newColor
43406 });
43407 }
43408 }), isGradient && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
43409 className: "components-palette-edit__popover-gradient-picker",
43410 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_gradient_picker_default, {
43411 __experimentalIsRenderedInSidebar: true,
43412 value: element.gradient,
43413 onChange: (newGradient) => {
43414 onChange({
43415 ...element,
43416 gradient: newGradient
43417 });
43418 }
43419 })
43420 })]
43421 });
43422}
43423function palette_edit_Option({
43424 canOnlyChangeValues,
43425 element,
43426 onChange,
43427 onRemove,
43428 popoverProps: receivedPopoverProps,
43429 slugPrefix,
43430 isGradient
43431}) {
43432 const value = isGradient ? element.gradient : element.color;
43433 const [isEditingColor, setIsEditingColor] = (0,external_wp_element_namespaceObject.useState)(false);
43434 const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
43435 const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
43436 ...receivedPopoverProps,
43437 // Use the custom palette color item as the popover anchor.
43438 anchor: popoverAnchor
43439 }), [popoverAnchor, receivedPopoverProps]);
43440 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(item_component_component_default, {
43441 ref: setPopoverAnchor,
43442 size: "small",
43443 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
43444 justify: "flex-start",
43445 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43446 size: "small",
43447 onClick: () => {
43448 setIsEditingColor(true);
43449 },
43450 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
43451 // translators: %s is a color or gradient name, e.g. "Red".
43452 (0,external_wp_i18n_namespaceObject.__)("Edit: %s"),
43453 element.name.trim().length ? element.name : value || ""
43454 ),
43455 style: {
43456 padding: 0
43457 },
43458 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(IndicatorStyled, {
43459 colorValue: value
43460 })
43461 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
43462 children: !canOnlyChangeValues ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameInput, {
43463 label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Gradient name") : (0,external_wp_i18n_namespaceObject.__)("Color name"),
43464 value: element.name,
43465 onChange: (nextName) => onChange({
43466 ...element,
43467 name: nextName,
43468 slug: slugPrefix + kebabCase(nextName !== null && nextName !== void 0 ? nextName : "")
43469 })
43470 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NameContainer, {
43471 children: element.name.trim().length ? element.name : (
43472 /* Fall back to non-breaking space to maintain height */
43473 "\xA0"
43474 )
43475 })
43476 }), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
43477 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RemoveButton, {
43478 size: "small",
43479 icon: line_solid_default,
43480 label: (0,external_wp_i18n_namespaceObject.sprintf)(
43481 // translators: %s is a color or gradient name, e.g. "Red".
43482 (0,external_wp_i18n_namespaceObject.__)("Remove color: %s"),
43483 element.name.trim().length ? element.name : value || ""
43484 ),
43485 onClick: onRemove
43486 })
43487 })]
43488 }), isEditingColor && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPickerPopover, {
43489 isGradient,
43490 onChange,
43491 element,
43492 popoverProps,
43493 onClose: () => setIsEditingColor(false)
43494 })]
43495 });
43496}
43497function PaletteEditListView({
43498 elements,
43499 onChange,
43500 canOnlyChangeValues,
43501 slugPrefix,
43502 isGradient,
43503 popoverProps,
43504 addColorRef
43505}) {
43506 const elementsReferenceRef = (0,external_wp_element_namespaceObject.useRef)();
43507 (0,external_wp_element_namespaceObject.useEffect)(() => {
43508 elementsReferenceRef.current = elements;
43509 }, [elements]);
43510 const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)((updatedElements) => onChange(deduplicateElementSlugs(updatedElements)), 100);
43511 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
43512 spacing: 3,
43513 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_group_component_component_default, {
43514 isRounded: true,
43515 isBordered: true,
43516 isSeparated: true,
43517 children: elements.map((element, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(palette_edit_Option, {
43518 isGradient,
43519 canOnlyChangeValues,
43520 element,
43521 onChange: (newElement) => {
43522 debounceOnChange(elements.map((currentElement, currentIndex) => {
43523 if (currentIndex === index) {
43524 return newElement;
43525 }
43526 return currentElement;
43527 }));
43528 },
43529 onRemove: () => {
43530 const newElements = elements.filter((_currentElement, currentIndex) => {
43531 if (currentIndex === index) {
43532 return false;
43533 }
43534 return true;
43535 });
43536 onChange(newElements.length ? newElements : void 0);
43537 addColorRef.current?.focus();
43538 },
43539 slugPrefix,
43540 popoverProps
43541 }, index))
43542 })
43543 });
43544}
43545const EMPTY_ARRAY = [];
43546function PaletteEdit({
43547 gradients,
43548 colors = EMPTY_ARRAY,
43549 onChange,
43550 paletteLabel,
43551 paletteLabelHeadingLevel = 2,
43552 emptyMessage,
43553 canOnlyChangeValues,
43554 canReset,
43555 slugPrefix = "",
43556 popoverProps
43557}) {
43558 const isGradient = !!gradients;
43559 const elements = isGradient ? gradients : colors;
43560 const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(false);
43561 const [editingElement, setEditingElement] = (0,external_wp_element_namespaceObject.useState)(null);
43562 const isAdding = isEditing && !!editingElement && elements[editingElement] && !elements[editingElement].slug;
43563 const elementsLength = elements.length;
43564 const hasElements = elementsLength > 0;
43565 const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)(onChange, 100);
43566 const onSelectPaletteItem = (0,external_wp_element_namespaceObject.useCallback)((value, newEditingElementIndex) => {
43567 const selectedElement = newEditingElementIndex === void 0 ? void 0 : elements[newEditingElementIndex];
43568 const key = isGradient ? "gradient" : "color";
43569 if (!!selectedElement && selectedElement[key] === value) {
43570 setEditingElement(newEditingElementIndex);
43571 } else {
43572 setIsEditing(true);
43573 }
43574 }, [isGradient, elements]);
43575 const addColorRef = (0,external_wp_element_namespaceObject.useRef)(null);
43576 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteEditStyles, {
43577 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
43578 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteHeading, {
43579 level: paletteLabelHeadingLevel,
43580 children: paletteLabel
43581 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteActionsContainer, {
43582 children: [hasElements && isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DoneButton, {
43583 size: "small",
43584 onClick: () => {
43585 setIsEditing(false);
43586 setEditingElement(null);
43587 },
43588 children: (0,external_wp_i18n_namespaceObject.__)("Done")
43589 }), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43590 ref: addColorRef,
43591 size: "small",
43592 isPressed: isAdding,
43593 icon: plus_default,
43594 label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Add gradient") : (0,external_wp_i18n_namespaceObject.__)("Add color"),
43595 onClick: () => {
43596 const {
43597 name,
43598 slug
43599 } = getNameAndSlugForPosition(elements, slugPrefix);
43600 if (!!gradients) {
43601 onChange([...gradients, {
43602 gradient: DEFAULT_GRADIENT,
43603 name,
43604 slug
43605 }]);
43606 } else {
43607 onChange([...colors, {
43608 color: DEFAULT_COLOR,
43609 name,
43610 slug
43611 }]);
43612 }
43613 setIsEditing(true);
43614 setEditingElement(elements.length);
43615 }
43616 }), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
43617 icon: more_vertical_default,
43618 label: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Gradient options") : (0,external_wp_i18n_namespaceObject.__)("Color options"),
43619 toggleProps: {
43620 size: "small"
43621 },
43622 children: ({
43623 onClose
43624 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
43625 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_menu_default, {
43626 role: "menu",
43627 children: [!isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43628 __next40pxDefaultSize: true,
43629 variant: "tertiary",
43630 onClick: () => {
43631 setIsEditing(true);
43632 onClose();
43633 },
43634 className: "components-palette-edit__menu-button",
43635 children: (0,external_wp_i18n_namespaceObject.__)("Show details")
43636 }), !canOnlyChangeValues && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43637 __next40pxDefaultSize: true,
43638 variant: "tertiary",
43639 onClick: () => {
43640 setEditingElement(null);
43641 setIsEditing(false);
43642 onChange();
43643 onClose();
43644 },
43645 className: "components-palette-edit__menu-button",
43646 children: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Remove all gradients") : (0,external_wp_i18n_namespaceObject.__)("Remove all colors")
43647 }), canReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
43648 __next40pxDefaultSize: true,
43649 className: "components-palette-edit__menu-button",
43650 variant: "tertiary",
43651 onClick: () => {
43652 setEditingElement(null);
43653 onChange();
43654 onClose();
43655 },
43656 children: isGradient ? (0,external_wp_i18n_namespaceObject.__)("Reset gradient") : (0,external_wp_i18n_namespaceObject.__)("Reset colors")
43657 })]
43658 })
43659 })
43660 })]
43661 })]
43662 }), hasElements && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(PaletteEditContents, {
43663 children: [isEditing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteEditListView, {
43664 canOnlyChangeValues,
43665 elements,
43666 onChange,
43667 slugPrefix,
43668 isGradient,
43669 popoverProps,
43670 addColorRef
43671 }), !isEditing && editingElement !== null && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPickerPopover, {
43672 isGradient,
43673 onClose: () => setEditingElement(null),
43674 onChange: (newElement) => {
43675 debounceOnChange(
43676 // @ts-expect-error TODO: Don't know how to resolve
43677 elements.map((currentElement, currentIndex) => {
43678 if (currentIndex === editingElement) {
43679 return newElement;
43680 }
43681 return currentElement;
43682 })
43683 );
43684 },
43685 element: elements[editingElement !== null && editingElement !== void 0 ? editingElement : -1],
43686 popoverProps
43687 }), !isEditing && (isGradient ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(gradient_picker_default, {
43688 gradients,
43689 onChange: onSelectPaletteItem,
43690 clearable: false,
43691 disableCustomGradients: true
43692 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
43693 colors,
43694 onChange: onSelectPaletteItem,
43695 clearable: false,
43696 disableCustomColors: true
43697 }))]
43698 }), !hasElements && emptyMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaletteEditContents, {
43699 children: emptyMessage
43700 })]
43701 });
43702}
43703var palette_edit_default = PaletteEdit;
43704
43705
43706;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
43707
43708
43709var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });
43710
43711
43712;// ./node_modules/@wordpress/components/build-module/combobox-control/styles.js
43713
43714
43715
43716
43717const deprecatedDefaultSize = ({
43718 __next40pxDefaultSize
43719}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css("height:28px;padding-left:", space(1), ";padding-right:", space(1), ";" + ( true ? "" : 0), true ? "" : 0);
43720const InputWrapperFlex = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
43721 target: "evuatpg0"
43722} : 0)("height:38px;padding-left:", space(2), ";padding-right:", space(2), ";", deprecatedDefaultSize, ";" + ( true ? "" : 0));
43723
43724
43725;// ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js
43726
43727
43728
43729function UnForwardedTokenInput(props, ref) {
43730 const {
43731 value,
43732 isExpanded,
43733 instanceId,
43734 selectedSuggestionIndex,
43735 className,
43736 onChange,
43737 onFocus,
43738 onBlur,
43739 ...restProps
43740 } = props;
43741 const [hasFocus, setHasFocus] = (0,external_wp_element_namespaceObject.useState)(false);
43742 const size = value ? value.length + 1 : 0;
43743 const onChangeHandler = (event) => {
43744 if (onChange) {
43745 onChange({
43746 value: event.target.value
43747 });
43748 }
43749 };
43750 const onFocusHandler = (e) => {
43751 setHasFocus(true);
43752 onFocus?.(e);
43753 };
43754 const onBlurHandler = (e) => {
43755 setHasFocus(false);
43756 onBlur?.(e);
43757 };
43758 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
43759 ref,
43760 id: `components-form-token-input-${instanceId}`,
43761 type: "text",
43762 ...restProps,
43763 value: value || "",
43764 onChange: onChangeHandler,
43765 onFocus: onFocusHandler,
43766 onBlur: onBlurHandler,
43767 size,
43768 className: dist_clsx(className, "components-form-token-field__input"),
43769 autoComplete: "off",
43770 role: "combobox",
43771 "aria-expanded": isExpanded,
43772 "aria-autocomplete": "list",
43773 "aria-owns": isExpanded ? `components-form-token-suggestions-${instanceId}` : void 0,
43774 "aria-activedescendant": (
43775 // Only add the `aria-activedescendant` attribute when:
43776 // - the user is actively interacting with the input (`hasFocus`)
43777 // - there is a selected suggestion (`selectedSuggestionIndex !== -1`)
43778 // - the list of suggestions are rendered in the DOM (`isExpanded`)
43779 hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : void 0
43780 ),
43781 "aria-describedby": `components-form-token-suggestions-howto-${instanceId}`
43782 });
43783}
43784const TokenInput = (0,external_wp_element_namespaceObject.forwardRef)(UnForwardedTokenInput);
43785var token_input_default = TokenInput;
43786
43787
43788;// ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js
43789
43790
43791
43792
43793const handleMouseDown = (e) => {
43794 e.preventDefault();
43795};
43796function SuggestionsList({
43797 selectedIndex,
43798 scrollIntoView,
43799 match,
43800 onHover,
43801 onSelect,
43802 suggestions = [],
43803 displayTransform,
43804 instanceId,
43805 __experimentalRenderItem
43806}) {
43807 const listRef = (0,external_wp_compose_namespaceObject.useRefEffect)((listNode) => {
43808 if (selectedIndex > -1 && scrollIntoView && listNode.children[selectedIndex]) {
43809 listNode.children[selectedIndex].scrollIntoView({
43810 behavior: "instant",
43811 block: "nearest",
43812 inline: "nearest"
43813 });
43814 }
43815 }, [selectedIndex, scrollIntoView]);
43816 const handleHover = (suggestion) => {
43817 return () => {
43818 onHover?.(suggestion);
43819 };
43820 };
43821 const handleClick = (suggestion) => {
43822 return () => {
43823 onSelect?.(suggestion);
43824 };
43825 };
43826 const computeSuggestionMatch = (suggestion) => {
43827 const matchText = displayTransform(match).normalize("NFKC").toLocaleLowerCase();
43828 if (matchText.length === 0) {
43829 return null;
43830 }
43831 const transformedSuggestion = displayTransform(suggestion);
43832 const indexOfMatch = transformedSuggestion.normalize("NFKC").toLocaleLowerCase().indexOf(matchText);
43833 return {
43834 suggestionBeforeMatch: transformedSuggestion.substring(0, indexOfMatch),
43835 suggestionMatch: transformedSuggestion.substring(indexOfMatch, indexOfMatch + matchText.length),
43836 suggestionAfterMatch: transformedSuggestion.substring(indexOfMatch + matchText.length)
43837 };
43838 };
43839 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
43840 ref: listRef,
43841 className: "components-form-token-field__suggestions-list",
43842 id: `components-form-token-suggestions-${instanceId}`,
43843 role: "listbox",
43844 children: [suggestions.map((suggestion, index) => {
43845 const matchText = computeSuggestionMatch(suggestion);
43846 const isSelected = index === selectedIndex;
43847 const isDisabled = typeof suggestion === "object" && suggestion?.disabled;
43848 const key = typeof suggestion === "object" && "value" in suggestion ? suggestion?.value : displayTransform(suggestion);
43849 const className = dist_clsx("components-form-token-field__suggestion", {
43850 "is-selected": isSelected
43851 });
43852 let output;
43853 if (typeof __experimentalRenderItem === "function") {
43854 output = __experimentalRenderItem({
43855 item: suggestion
43856 });
43857 } else if (matchText) {
43858 output = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
43859 "aria-label": displayTransform(suggestion),
43860 children: [matchText.suggestionBeforeMatch, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
43861 className: "components-form-token-field__suggestion-match",
43862 children: matchText.suggestionMatch
43863 }), matchText.suggestionAfterMatch]
43864 });
43865 } else {
43866 output = displayTransform(suggestion);
43867 }
43868 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
43869 id: `components-form-token-suggestions-${instanceId}-${index}`,
43870 role: "option",
43871 className,
43872 onMouseDown: handleMouseDown,
43873 onClick: handleClick(suggestion),
43874 onMouseEnter: handleHover(suggestion),
43875 "aria-selected": index === selectedIndex,
43876 "aria-disabled": isDisabled,
43877 children: output
43878 }, key);
43879 }), suggestions.length === 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
43880 className: "components-form-token-field__suggestion is-empty",
43881 children: (0,external_wp_i18n_namespaceObject.__)("No items found")
43882 })]
43883 });
43884}
43885var suggestions_list_default = SuggestionsList;
43886
43887
43888;// ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
43889
43890
43891
43892var with_focus_outside_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => (props) => {
43893 const [handleFocusOutside, setHandleFocusOutside] = (0,external_wp_element_namespaceObject.useState)(void 0);
43894 const bindFocusOutsideHandler = (0,external_wp_element_namespaceObject.useCallback)((node) => setHandleFocusOutside(() => node?.handleFocusOutside ? node.handleFocusOutside.bind(node) : void 0), []);
43895 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
43896 ...(0,external_wp_compose_namespaceObject.__experimentalUseFocusOutside)(handleFocusOutside),
43897 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
43898 ref: bindFocusOutsideHandler,
43899 ...props
43900 })
43901 });
43902}, "withFocusOutside");
43903
43904
43905;// ./node_modules/@wordpress/components/build-module/spinner/styles.js
43906
43907function spinner_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
43908 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
43909}
43910
43911
43912const spinAnimation = emotion_react_browser_esm_keyframes`
43913 from {
43914 transform: rotate(0deg);
43915 }
43916 to {
43917 transform: rotate(360deg);
43918 }
43919 `;
43920const StyledSpinner = /* @__PURE__ */ emotion_styled_base_browser_esm("svg", true ? {
43921 target: "ea4tfvq2"
43922} : 0)("width:", config_values_default.spinnerSize, "px;height:", config_values_default.spinnerSize, "px;display:inline-block;margin:5px 11px 0;position:relative;color:", COLORS.theme.accent, ";overflow:visible;opacity:1;background-color:transparent;" + ( true ? "" : 0));
43923const commonPathProps = true ? {
43924 name: "9s4963",
43925 styles: "fill:transparent;stroke-width:1.5px"
43926} : 0;
43927const SpinnerTrack = /* @__PURE__ */ emotion_styled_base_browser_esm("circle", true ? {
43928 target: "ea4tfvq1"
43929} : 0)(commonPathProps, ";stroke:", COLORS.gray[300], ";" + ( true ? "" : 0));
43930const SpinnerIndicator = /* @__PURE__ */ emotion_styled_base_browser_esm("path", true ? {
43931 target: "ea4tfvq0"
43932} : 0)(commonPathProps, ";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ", spinAnimation, ";" + ( true ? "" : 0));
43933
43934
43935;// ./node_modules/@wordpress/components/build-module/spinner/index.js
43936
43937
43938
43939
43940function UnforwardedSpinner({
43941 className,
43942 ...props
43943}, forwardedRef) {
43944 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(StyledSpinner, {
43945 className: dist_clsx("components-spinner", className),
43946 viewBox: "0 0 100 100",
43947 width: "16",
43948 height: "16",
43949 xmlns: "http://www.w3.org/2000/svg",
43950 role: "presentation",
43951 focusable: "false",
43952 ...props,
43953 ref: forwardedRef,
43954 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinnerTrack, {
43955 cx: "50",
43956 cy: "50",
43957 r: "50",
43958 vectorEffect: "non-scaling-stroke"
43959 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SpinnerIndicator, {
43960 d: "m 50 0 a 50 50 0 0 1 50 50",
43961 vectorEffect: "non-scaling-stroke"
43962 })]
43963 });
43964}
43965const Spinner = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSpinner);
43966var spinner_default = Spinner;
43967
43968
43969;// ./node_modules/@wordpress/components/build-module/combobox-control/index.js
43970
43971
43972
43973
43974
43975
43976
43977
43978
43979
43980
43981
43982
43983
43984
43985
43986
43987
43988
43989
43990const combobox_control_noop = () => {
43991};
43992const DetectOutside = with_focus_outside_default(class extends external_wp_element_namespaceObject.Component {
43993 handleFocusOutside(event) {
43994 this.props.onFocusOutside(event);
43995 }
43996 render() {
43997 return this.props.children;
43998 }
43999});
44000const getIndexOfMatchingSuggestion = (selectedSuggestion, matchingSuggestions) => selectedSuggestion === null ? -1 : matchingSuggestions.indexOf(selectedSuggestion);
44001function ComboboxControl(props) {
44002 var _currentOption$label;
44003 const {
44004 __nextHasNoMarginBottom = false,
44005 __next40pxDefaultSize = false,
44006 value: valueProp,
44007 label,
44008 options,
44009 onChange: onChangeProp,
44010 onFilterValueChange = combobox_control_noop,
44011 hideLabelFromVision,
44012 help,
44013 allowReset = true,
44014 className,
44015 isLoading = false,
44016 messages = {
44017 selected: (0,external_wp_i18n_namespaceObject.__)("Item selected.")
44018 },
44019 __experimentalRenderItem,
44020 expandOnFocus = true,
44021 placeholder
44022 } = useDeprecated36pxDefaultSizeProp(props);
44023 const [value, setValue] = useControlledValue({
44024 value: valueProp,
44025 onChange: onChangeProp
44026 });
44027 const currentOption = options.find((option) => option.value === value);
44028 const currentLabel = (_currentOption$label = currentOption?.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : "";
44029 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ComboboxControl, "combobox-control");
44030 const [selectedSuggestion, setSelectedSuggestion] = (0,external_wp_element_namespaceObject.useState)(currentOption || null);
44031 const [isExpanded, setIsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
44032 const [inputHasFocus, setInputHasFocus] = (0,external_wp_element_namespaceObject.useState)(false);
44033 const [inputValue, setInputValue] = (0,external_wp_element_namespaceObject.useState)("");
44034 const inputContainer = (0,external_wp_element_namespaceObject.useRef)(null);
44035 const matchingSuggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
44036 const startsWithMatch = [];
44037 const containsMatch = [];
44038 const match = normalizeTextString(inputValue);
44039 options.forEach((option) => {
44040 const index = normalizeTextString(option.label).indexOf(match);
44041 if (index === 0) {
44042 startsWithMatch.push(option);
44043 } else if (index > 0) {
44044 containsMatch.push(option);
44045 }
44046 });
44047 return startsWithMatch.concat(containsMatch);
44048 }, [inputValue, options]);
44049 const onSuggestionSelected = (newSelectedSuggestion) => {
44050 if (newSelectedSuggestion.disabled) {
44051 return;
44052 }
44053 setValue(newSelectedSuggestion.value);
44054 (0,external_wp_a11y_namespaceObject.speak)(messages.selected, "assertive");
44055 setSelectedSuggestion(newSelectedSuggestion);
44056 setInputValue("");
44057 setIsExpanded(false);
44058 };
44059 const handleArrowNavigation = (offset = 1) => {
44060 const index = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions);
44061 let nextIndex = index + offset;
44062 if (nextIndex < 0) {
44063 nextIndex = matchingSuggestions.length - 1;
44064 } else if (nextIndex >= matchingSuggestions.length) {
44065 nextIndex = 0;
44066 }
44067 setSelectedSuggestion(matchingSuggestions[nextIndex]);
44068 setIsExpanded(true);
44069 };
44070 const onKeyDown = withIgnoreIMEEvents((event) => {
44071 let preventDefault = false;
44072 if (event.defaultPrevented) {
44073 return;
44074 }
44075 switch (event.code) {
44076 case "Enter":
44077 if (selectedSuggestion) {
44078 onSuggestionSelected(selectedSuggestion);
44079 preventDefault = true;
44080 }
44081 break;
44082 case "ArrowUp":
44083 handleArrowNavigation(-1);
44084 preventDefault = true;
44085 break;
44086 case "ArrowDown":
44087 handleArrowNavigation(1);
44088 preventDefault = true;
44089 break;
44090 case "Escape":
44091 setIsExpanded(false);
44092 setSelectedSuggestion(null);
44093 preventDefault = true;
44094 break;
44095 default:
44096 break;
44097 }
44098 if (preventDefault) {
44099 event.preventDefault();
44100 }
44101 });
44102 const onBlur = () => {
44103 setInputHasFocus(false);
44104 };
44105 const onFocus = () => {
44106 setInputHasFocus(true);
44107 if (expandOnFocus) {
44108 setIsExpanded(true);
44109 }
44110 onFilterValueChange("");
44111 setInputValue("");
44112 };
44113 const onClick = () => {
44114 setIsExpanded(true);
44115 };
44116 const onFocusOutside = () => {
44117 setIsExpanded(false);
44118 };
44119 const onInputChange = (event) => {
44120 const text = event.value;
44121 setInputValue(text);
44122 onFilterValueChange(text);
44123 if (inputHasFocus) {
44124 setIsExpanded(true);
44125 }
44126 };
44127 const handleOnReset = () => {
44128 setValue(null);
44129 inputContainer.current?.focus();
44130 };
44131 const handleResetStopPropagation = (event) => {
44132 event.stopPropagation();
44133 };
44134 (0,external_wp_element_namespaceObject.useEffect)(() => {
44135 const hasMatchingSuggestions = matchingSuggestions.length > 0;
44136 const hasSelectedMatchingSuggestions = getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions) > 0;
44137 if (hasMatchingSuggestions && !hasSelectedMatchingSuggestions) {
44138 setSelectedSuggestion(matchingSuggestions[0]);
44139 }
44140 }, [matchingSuggestions, selectedSuggestion]);
44141 (0,external_wp_element_namespaceObject.useEffect)(() => {
44142 const hasMatchingSuggestions = matchingSuggestions.length > 0;
44143 if (isExpanded) {
44144 const message = hasMatchingSuggestions ? (0,external_wp_i18n_namespaceObject.sprintf)(
44145 /* translators: %d: number of results. */
44146 (0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", matchingSuggestions.length),
44147 matchingSuggestions.length
44148 ) : (0,external_wp_i18n_namespaceObject.__)("No results.");
44149 (0,external_wp_a11y_namespaceObject.speak)(message, "polite");
44150 }
44151 }, [matchingSuggestions, isExpanded]);
44152 maybeWarnDeprecated36pxSize({
44153 componentName: "ComboboxControl",
44154 __next40pxDefaultSize,
44155 size: void 0
44156 });
44157 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DetectOutside, {
44158 onFocusOutside,
44159 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
44160 __nextHasNoMarginBottom,
44161 __associatedWPComponentName: "ComboboxControl",
44162 className: dist_clsx(className, "components-combobox-control"),
44163 label,
44164 id: `components-form-token-input-${instanceId}`,
44165 hideLabelFromVision,
44166 help,
44167 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
44168 className: "components-combobox-control__suggestions-container",
44169 tabIndex: -1,
44170 onKeyDown,
44171 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapperFlex, {
44172 __next40pxDefaultSize,
44173 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
44174 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(token_input_default, {
44175 className: "components-combobox-control__input",
44176 instanceId,
44177 ref: inputContainer,
44178 placeholder,
44179 value: isExpanded ? inputValue : currentLabel,
44180 onFocus,
44181 onBlur,
44182 onClick,
44183 isExpanded,
44184 selectedSuggestionIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
44185 onChange: onInputChange
44186 })
44187 }), isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spinner_default, {}), allowReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
44188 size: "small",
44189 icon: close_small_default,
44190 disabled: !value,
44191 onClick: handleOnReset,
44192 onKeyDown: handleResetStopPropagation,
44193 label: (0,external_wp_i18n_namespaceObject.__)("Reset")
44194 })]
44195 }), isExpanded && !isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(suggestions_list_default, {
44196 instanceId,
44197 match: {
44198 label: inputValue,
44199 value: ""
44200 },
44201 displayTransform: (suggestion) => suggestion.label,
44202 suggestions: matchingSuggestions,
44203 selectedIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions),
44204 onHover: setSelectedSuggestion,
44205 onSelect: onSuggestionSelected,
44206 scrollIntoView: true,
44207 __experimentalRenderItem
44208 })]
44209 })
44210 })
44211 });
44212}
44213var combobox_control_default = ComboboxControl;
44214
44215
44216;// ./node_modules/@wordpress/components/build-module/composite/legacy/index.js
44217
44218
44219
44220
44221
44222
44223function mapLegacyStatePropsToComponentProps(legacyProps) {
44224 if (legacyProps.state) {
44225 const {
44226 state,
44227 ...rest
44228 } = legacyProps;
44229 const {
44230 store,
44231 ...props
44232 } = mapLegacyStatePropsToComponentProps(state);
44233 return {
44234 ...rest,
44235 ...props,
44236 store
44237 };
44238 }
44239 return legacyProps;
44240}
44241const LEGACY_TO_NEW_DISPLAY_NAME = {
44242 __unstableComposite: "Composite",
44243 __unstableCompositeGroup: "Composite.Group or Composite.Row",
44244 __unstableCompositeItem: "Composite.Item",
44245 __unstableUseCompositeState: "Composite"
44246};
44247function proxyComposite(ProxiedComponent, propMap = {}) {
44248 var _ProxiedComponent$dis;
44249 const displayName = (_ProxiedComponent$dis = ProxiedComponent.displayName) !== null && _ProxiedComponent$dis !== void 0 ? _ProxiedComponent$dis : "";
44250 const Component = (legacyProps) => {
44251 external_wp_deprecated_default()(`wp.components.${displayName}`, {
44252 since: "6.7",
44253 alternative: LEGACY_TO_NEW_DISPLAY_NAME.hasOwnProperty(displayName) ? LEGACY_TO_NEW_DISPLAY_NAME[displayName] : void 0
44254 });
44255 const {
44256 store,
44257 ...rest
44258 } = mapLegacyStatePropsToComponentProps(legacyProps);
44259 let props = rest;
44260 props = {
44261 ...props,
44262 id: (0,external_wp_compose_namespaceObject.useInstanceId)(store, props.baseId, props.id)
44263 };
44264 Object.entries(propMap).forEach(([from, to]) => {
44265 if (props.hasOwnProperty(from)) {
44266 Object.assign(props, {
44267 [to]: props[from]
44268 });
44269 delete props[from];
44270 }
44271 });
44272 delete props.baseId;
44273 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ProxiedComponent, {
44274 ...props,
44275 store
44276 });
44277 };
44278 Component.displayName = displayName;
44279 return Component;
44280}
44281const UnproxiedCompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(({
44282 role,
44283 ...props
44284}, ref) => {
44285 const Component = role === "row" ? composite_Composite.Row : composite_Composite.Group;
44286 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
44287 ref,
44288 role,
44289 ...props
44290 });
44291});
44292const legacy_Composite = proxyComposite(Object.assign(composite_Composite, {
44293 displayName: "__unstableComposite"
44294}), {
44295 baseId: "id"
44296});
44297const legacy_CompositeGroup = proxyComposite(Object.assign(UnproxiedCompositeGroup, {
44298 displayName: "__unstableCompositeGroup"
44299}));
44300const legacy_CompositeItem = proxyComposite(Object.assign(composite_Composite.Item, {
44301 displayName: "__unstableCompositeItem"
44302}), {
44303 focusable: "accessibleWhenDisabled"
44304});
44305function useCompositeState(legacyStateOptions = {}) {
44306 external_wp_deprecated_default()(`wp.components.__unstableUseCompositeState`, {
44307 since: "6.7",
44308 alternative: LEGACY_TO_NEW_DISPLAY_NAME.__unstableUseCompositeState
44309 });
44310 const {
44311 baseId,
44312 currentId: defaultActiveId,
44313 orientation,
44314 rtl = false,
44315 loop: focusLoop = false,
44316 wrap: focusWrap = false,
44317 shift: focusShift = false,
44318 // eslint-disable-next-line camelcase
44319 unstable_virtual: virtualFocus
44320 } = legacyStateOptions;
44321 return {
44322 baseId: (0,external_wp_compose_namespaceObject.useInstanceId)(legacy_Composite, "composite", baseId),
44323 store: useCompositeStore({
44324 defaultActiveId,
44325 rtl,
44326 orientation,
44327 focusLoop,
44328 focusShift,
44329 focusWrap,
44330 virtualFocus
44331 })
44332 };
44333}
44334
44335
44336;// ./node_modules/@wordpress/components/build-module/modal/aria-helper.js
44337const LIVE_REGION_ARIA_ROLES = /* @__PURE__ */ new Set(["alert", "status", "log", "marquee", "timer"]);
44338const hiddenElementsByDepth = [];
44339function modalize(modalElement) {
44340 const elements = Array.from(document.body.children);
44341 const hiddenElements = [];
44342 hiddenElementsByDepth.push(hiddenElements);
44343 for (const element of elements) {
44344 if (element === modalElement) {
44345 continue;
44346 }
44347 if (elementShouldBeHidden(element)) {
44348 element.setAttribute("aria-hidden", "true");
44349 hiddenElements.push(element);
44350 }
44351 }
44352}
44353function elementShouldBeHidden(element) {
44354 const role = element.getAttribute("role");
44355 return !(element.tagName === "SCRIPT" || element.hasAttribute("hidden") || element.hasAttribute("aria-hidden") || element.hasAttribute("aria-live") || role && LIVE_REGION_ARIA_ROLES.has(role));
44356}
44357function unmodalize() {
44358 const hiddenElements = hiddenElementsByDepth.pop();
44359 if (!hiddenElements) {
44360 return;
44361 }
44362 for (const element of hiddenElements) {
44363 element.removeAttribute("aria-hidden");
44364 }
44365}
44366
44367
44368;// ./node_modules/@wordpress/components/build-module/modal/use-modal-exit-animation.js
44369
44370
44371
44372
44373const FRAME_ANIMATION_DURATION = config_values_default.transitionDuration;
44374const FRAME_ANIMATION_DURATION_NUMBER = Number.parseInt(config_values_default.transitionDuration);
44375const EXIT_ANIMATION_NAME = "components-modal__disappear-animation";
44376function useModalExitAnimation() {
44377 const frameRef = (0,external_wp_element_namespaceObject.useRef)();
44378 const [isAnimatingOut, setIsAnimatingOut] = (0,external_wp_element_namespaceObject.useState)(false);
44379 const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
44380 const closeModal = (0,external_wp_element_namespaceObject.useCallback)(() => new Promise((closeModalResolve) => {
44381 const frameEl = frameRef.current;
44382 if (isReducedMotion) {
44383 closeModalResolve();
44384 return;
44385 }
44386 if (!frameEl) {
44387 true ? external_wp_warning_default()("wp.components.Modal: the Modal component can't be closed with an exit animation because of a missing reference to the modal frame element.") : 0;
44388 closeModalResolve();
44389 return;
44390 }
44391 let handleAnimationEnd;
44392 const startAnimation = () => new Promise((animationResolve) => {
44393 handleAnimationEnd = (e) => {
44394 if (e.animationName === EXIT_ANIMATION_NAME) {
44395 animationResolve();
44396 }
44397 };
44398 frameEl.addEventListener("animationend", handleAnimationEnd);
44399 setIsAnimatingOut(true);
44400 });
44401 const animationTimeout = () => new Promise((timeoutResolve) => {
44402 setTimeout(
44403 () => timeoutResolve(),
44404 // Allow an extra 20% of the animation duration for the
44405 // animationend event to fire, in case the animation frame is
44406 // slightly delayes by some other events in the event loop.
44407 FRAME_ANIMATION_DURATION_NUMBER * 1.2
44408 );
44409 });
44410 Promise.race([startAnimation(), animationTimeout()]).then(() => {
44411 if (handleAnimationEnd) {
44412 frameEl.removeEventListener("animationend", handleAnimationEnd);
44413 }
44414 setIsAnimatingOut(false);
44415 closeModalResolve();
44416 });
44417 }), [isReducedMotion]);
44418 return {
44419 overlayClassname: isAnimatingOut ? "is-animating-out" : void 0,
44420 frameRef,
44421 frameStyle: {
44422 "--modal-frame-animation-duration": `${FRAME_ANIMATION_DURATION}`
44423 },
44424 closeModal
44425 };
44426}
44427
44428
44429;// ./node_modules/@wordpress/components/build-module/modal/index.js
44430
44431
44432
44433
44434
44435
44436
44437
44438
44439
44440
44441
44442
44443const ModalContext = (0,external_wp_element_namespaceObject.createContext)(/* @__PURE__ */ new Set());
44444ModalContext.displayName = "ModalContext";
44445const bodyOpenClasses = /* @__PURE__ */ new Map();
44446function UnforwardedModal(props, forwardedRef) {
44447 const {
44448 bodyOpenClassName = "modal-open",
44449 role = "dialog",
44450 title = null,
44451 focusOnMount = true,
44452 shouldCloseOnEsc = true,
44453 shouldCloseOnClickOutside = true,
44454 isDismissible = true,
44455 /* Accessibility. */
44456 aria = {
44457 labelledby: void 0,
44458 describedby: void 0
44459 },
44460 onRequestClose,
44461 icon,
44462 closeButtonLabel,
44463 children,
44464 style,
44465 overlayClassName: overlayClassnameProp,
44466 className,
44467 contentLabel,
44468 onKeyDown,
44469 isFullScreen = false,
44470 size,
44471 headerActions = null,
44472 __experimentalHideHeader = false
44473 } = props;
44474 const ref = (0,external_wp_element_namespaceObject.useRef)();
44475 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Modal);
44476 const headingId = title ? `components-modal-header-${instanceId}` : aria.labelledby;
44477 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)(focusOnMount === "firstContentElement" ? "firstElement" : focusOnMount);
44478 const constrainedTabbingRef = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)();
44479 const focusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
44480 const contentRef = (0,external_wp_element_namespaceObject.useRef)(null);
44481 const childrenContainerRef = (0,external_wp_element_namespaceObject.useRef)(null);
44482 const [hasScrolledContent, setHasScrolledContent] = (0,external_wp_element_namespaceObject.useState)(false);
44483 const [hasScrollableContent, setHasScrollableContent] = (0,external_wp_element_namespaceObject.useState)(false);
44484 let sizeClass;
44485 if (isFullScreen || size === "fill") {
44486 sizeClass = "is-full-screen";
44487 } else if (size) {
44488 sizeClass = `has-size-${size}`;
44489 }
44490 const isContentScrollable = (0,external_wp_element_namespaceObject.useCallback)(() => {
44491 if (!contentRef.current) {
44492 return;
44493 }
44494 const closestScrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(contentRef.current);
44495 if (contentRef.current === closestScrollContainer) {
44496 setHasScrollableContent(true);
44497 } else {
44498 setHasScrollableContent(false);
44499 }
44500 }, [contentRef]);
44501 (0,external_wp_element_namespaceObject.useEffect)(() => {
44502 modalize(ref.current);
44503 return () => unmodalize();
44504 }, []);
44505 const onRequestCloseRef = (0,external_wp_element_namespaceObject.useRef)();
44506 (0,external_wp_element_namespaceObject.useEffect)(() => {
44507 onRequestCloseRef.current = onRequestClose;
44508 }, [onRequestClose]);
44509 const dismissers = (0,external_wp_element_namespaceObject.useContext)(ModalContext);
44510 const [nestedDismissers] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new Set());
44511 (0,external_wp_element_namespaceObject.useEffect)(() => {
44512 dismissers.add(onRequestCloseRef);
44513 for (const dismisser of dismissers) {
44514 if (dismisser !== onRequestCloseRef) {
44515 dismisser.current?.();
44516 }
44517 }
44518 return () => {
44519 for (const dismisser of nestedDismissers) {
44520 dismisser.current?.();
44521 }
44522 dismissers.delete(onRequestCloseRef);
44523 };
44524 }, [dismissers, nestedDismissers]);
44525 (0,external_wp_element_namespaceObject.useEffect)(() => {
44526 var _bodyOpenClasses$get;
44527 const theClass = bodyOpenClassName;
44528 const oneMore = 1 + ((_bodyOpenClasses$get = bodyOpenClasses.get(theClass)) !== null && _bodyOpenClasses$get !== void 0 ? _bodyOpenClasses$get : 0);
44529 bodyOpenClasses.set(theClass, oneMore);
44530 document.body.classList.add(bodyOpenClassName);
44531 return () => {
44532 const oneLess = bodyOpenClasses.get(theClass) - 1;
44533 if (oneLess === 0) {
44534 document.body.classList.remove(theClass);
44535 bodyOpenClasses.delete(theClass);
44536 } else {
44537 bodyOpenClasses.set(theClass, oneLess);
44538 }
44539 };
44540 }, [bodyOpenClassName]);
44541 const {
44542 closeModal,
44543 frameRef,
44544 frameStyle,
44545 overlayClassname
44546 } = useModalExitAnimation();
44547 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
44548 if (!window.ResizeObserver || !childrenContainerRef.current) {
44549 return;
44550 }
44551 const resizeObserver = new ResizeObserver(isContentScrollable);
44552 resizeObserver.observe(childrenContainerRef.current);
44553 isContentScrollable();
44554 return () => {
44555 resizeObserver.disconnect();
44556 };
44557 }, [isContentScrollable, childrenContainerRef]);
44558 function handleEscapeKeyDown(event) {
44559 if (shouldCloseOnEsc && (event.code === "Escape" || event.key === "Escape") && !event.defaultPrevented) {
44560 event.preventDefault();
44561 closeModal().then(() => onRequestClose(event));
44562 }
44563 }
44564 const onContentContainerScroll = (0,external_wp_element_namespaceObject.useCallback)((e) => {
44565 var _e$currentTarget$scro;
44566 const scrollY = (_e$currentTarget$scro = e?.currentTarget?.scrollTop) !== null && _e$currentTarget$scro !== void 0 ? _e$currentTarget$scro : -1;
44567 if (!hasScrolledContent && scrollY > 0) {
44568 setHasScrolledContent(true);
44569 } else if (hasScrolledContent && scrollY <= 0) {
44570 setHasScrolledContent(false);
44571 }
44572 }, [hasScrolledContent]);
44573 let pressTarget = null;
44574 const overlayPressHandlers = {
44575 onPointerDown: (event) => {
44576 if (event.target === event.currentTarget) {
44577 pressTarget = event.target;
44578 event.preventDefault();
44579 }
44580 },
44581 // Closes the modal with two exceptions. 1. Opening the context menu on
44582 // the overlay. 2. Pressing on the overlay then dragging the pointer
44583 // over the modal and releasing. Due to the modal being a child of the
44584 // overlay, such a gesture is a `click` on the overlay and cannot be
44585 // excepted by a `click` handler. Thus the tactic of handling
44586 // `pointerup` and comparing its target to that of the `pointerdown`.
44587 onPointerUp: ({
44588 target,
44589 button
44590 }) => {
44591 const isSameTarget = target === pressTarget;
44592 pressTarget = null;
44593 if (button === 0 && isSameTarget) {
44594 closeModal().then(() => onRequestClose());
44595 }
44596 }
44597 };
44598 const modal = (
44599 // eslint-disable-next-line jsx-a11y/no-static-element-interactions
44600 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
44601 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]),
44602 className: dist_clsx("components-modal__screen-overlay", overlayClassname, overlayClassnameProp),
44603 onKeyDown: withIgnoreIMEEvents(handleEscapeKeyDown),
44604 ...shouldCloseOnClickOutside ? overlayPressHandlers : {},
44605 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider_default, {
44606 document,
44607 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
44608 className: dist_clsx("components-modal__frame", sizeClass, className),
44609 style: {
44610 ...frameStyle,
44611 ...style
44612 },
44613 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([frameRef, constrainedTabbingRef, focusReturnRef, focusOnMount !== "firstContentElement" ? focusOnMountRef : null]),
44614 role,
44615 "aria-label": contentLabel,
44616 "aria-labelledby": contentLabel ? void 0 : headingId,
44617 "aria-describedby": aria.describedby,
44618 tabIndex: -1,
44619 onKeyDown,
44620 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
44621 className: dist_clsx("components-modal__content", {
44622 "hide-header": __experimentalHideHeader,
44623 "is-scrollable": hasScrollableContent,
44624 "has-scrolled-content": hasScrolledContent
44625 }),
44626 role: "document",
44627 onScroll: onContentContainerScroll,
44628 ref: contentRef,
44629 "aria-label": hasScrollableContent ? (0,external_wp_i18n_namespaceObject.__)("Scrollable section") : void 0,
44630 tabIndex: hasScrollableContent ? 0 : void 0,
44631 children: [!__experimentalHideHeader && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
44632 className: "components-modal__header",
44633 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
44634 className: "components-modal__header-heading-container",
44635 children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
44636 className: "components-modal__icon-container",
44637 "aria-hidden": true,
44638 children: icon
44639 }), title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
44640 id: headingId,
44641 className: "components-modal__header-heading",
44642 children: title
44643 })]
44644 }), headerActions, isDismissible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
44645 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
44646 marginBottom: 0,
44647 marginLeft: 2
44648 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
44649 size: "compact",
44650 onClick: (event) => closeModal().then(() => onRequestClose(event)),
44651 icon: close_default,
44652 label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)("Close")
44653 })]
44654 })]
44655 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
44656 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([childrenContainerRef, focusOnMount === "firstContentElement" ? focusOnMountRef : null]),
44657 children
44658 })]
44659 })
44660 })
44661 })
44662 })
44663 );
44664 return (0,external_wp_element_namespaceObject.createPortal)(/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalContext.Provider, {
44665 value: nestedDismissers,
44666 children: modal
44667 }), document.body);
44668}
44669const Modal = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedModal);
44670var modal_default = Modal;
44671
44672
44673;// ./node_modules/@wordpress/components/build-module/confirm-dialog/styles.js
44674function confirm_dialog_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
44675 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
44676}
44677
44678const styles_wrapper = true ? {
44679 name: "7g5ii0",
44680 styles: "&&{z-index:1000001;}"
44681} : 0;
44682
44683
44684;// ./node_modules/@wordpress/components/build-module/confirm-dialog/component.js
44685
44686
44687
44688
44689
44690
44691
44692
44693
44694
44695
44696const UnconnectedConfirmDialog = (props, forwardedRef) => {
44697 const {
44698 isOpen: isOpenProp,
44699 onConfirm,
44700 onCancel,
44701 children,
44702 confirmButtonText,
44703 cancelButtonText,
44704 ...otherProps
44705 } = useContextSystem(props, "ConfirmDialog");
44706 const cx = useCx();
44707 const wrapperClassName = cx(styles_wrapper);
44708 const cancelButtonRef = (0,external_wp_element_namespaceObject.useRef)();
44709 const confirmButtonRef = (0,external_wp_element_namespaceObject.useRef)();
44710 const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)();
44711 const [shouldSelfClose, setShouldSelfClose] = (0,external_wp_element_namespaceObject.useState)();
44712 (0,external_wp_element_namespaceObject.useEffect)(() => {
44713 const isIsOpenSet = typeof isOpenProp !== "undefined";
44714 setIsOpen(isIsOpenSet ? isOpenProp : true);
44715 setShouldSelfClose(!isIsOpenSet);
44716 }, [isOpenProp]);
44717 const handleEvent = (0,external_wp_element_namespaceObject.useCallback)((callback) => (event) => {
44718 callback?.(event);
44719 if (shouldSelfClose) {
44720 setIsOpen(false);
44721 }
44722 }, [shouldSelfClose, setIsOpen]);
44723 const handleEnter = (0,external_wp_element_namespaceObject.useCallback)((event) => {
44724 const isConfirmOrCancelButton = event.target === cancelButtonRef.current || event.target === confirmButtonRef.current;
44725 if (!isConfirmOrCancelButton && event.key === "Enter") {
44726 handleEvent(onConfirm)(event);
44727 }
44728 }, [handleEvent, onConfirm]);
44729 const cancelLabel = cancelButtonText !== null && cancelButtonText !== void 0 ? cancelButtonText : (0,external_wp_i18n_namespaceObject.__)("Cancel");
44730 const confirmLabel = confirmButtonText !== null && confirmButtonText !== void 0 ? confirmButtonText : (0,external_wp_i18n_namespaceObject.__)("OK");
44731 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
44732 children: isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(modal_default, {
44733 onRequestClose: handleEvent(onCancel),
44734 onKeyDown: handleEnter,
44735 closeButtonLabel: cancelLabel,
44736 isDismissible: true,
44737 ref: forwardedRef,
44738 overlayClassName: wrapperClassName,
44739 __experimentalHideHeader: true,
44740 ...otherProps,
44741 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
44742 spacing: 8,
44743 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
44744 children
44745 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
44746 direction: "row",
44747 justify: "flex-end",
44748 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
44749 __next40pxDefaultSize: true,
44750 ref: cancelButtonRef,
44751 variant: "tertiary",
44752 onClick: handleEvent(onCancel),
44753 children: cancelLabel
44754 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
44755 __next40pxDefaultSize: true,
44756 ref: confirmButtonRef,
44757 variant: "primary",
44758 onClick: handleEvent(onConfirm),
44759 children: confirmLabel
44760 })]
44761 })]
44762 })
44763 })
44764 });
44765};
44766const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, "ConfirmDialog");
44767var confirm_dialog_component_component_default = ConfirmDialog;
44768
44769
44770;// ./node_modules/@ariakit/react-core/esm/__chunks/VEVQD5MH.js
44771"use client";
44772
44773
44774
44775
44776// src/combobox/combobox-context.tsx
44777
44778var ComboboxListRoleContext = (0,external_React_.createContext)(
44779 void 0
44780);
44781var VEVQD5MH_ctx = createStoreContext(
44782 [PopoverContextProvider, CompositeContextProvider],
44783 [PopoverScopedContextProvider, CompositeScopedContextProvider]
44784);
44785var useComboboxContext = VEVQD5MH_ctx.useContext;
44786var useComboboxScopedContext = VEVQD5MH_ctx.useScopedContext;
44787var useComboboxProviderContext = VEVQD5MH_ctx.useProviderContext;
44788var ComboboxContextProvider = VEVQD5MH_ctx.ContextProvider;
44789var ComboboxScopedContextProvider = VEVQD5MH_ctx.ScopedContextProvider;
44790var ComboboxItemValueContext = (0,external_React_.createContext)(
44791 void 0
44792);
44793var ComboboxItemCheckedContext = (0,external_React_.createContext)(false);
44794
44795
44796
44797;// ./node_modules/@ariakit/core/esm/select/select-store.js
44798"use client";
44799
44800
44801
44802
44803
44804
44805
44806
44807
44808
44809
44810// src/select/select-store.ts
44811function createSelectStore(_a = {}) {
44812 var _b = _a, {
44813 combobox
44814 } = _b, props = _3YLGPPWQ_objRest(_b, [
44815 "combobox"
44816 ]);
44817 const store = mergeStore(
44818 props.store,
44819 omit2(combobox, [
44820 "value",
44821 "items",
44822 "renderedItems",
44823 "baseElement",
44824 "arrowElement",
44825 "anchorElement",
44826 "contentElement",
44827 "popoverElement",
44828 "disclosureElement"
44829 ])
44830 );
44831 throwOnConflictingProps(props, store);
44832 const syncState = store.getState();
44833 const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
44834 store,
44835 virtualFocus: defaultValue(
44836 props.virtualFocus,
44837 syncState.virtualFocus,
44838 true
44839 ),
44840 includesBaseElement: defaultValue(
44841 props.includesBaseElement,
44842 syncState.includesBaseElement,
44843 false
44844 ),
44845 activeId: defaultValue(
44846 props.activeId,
44847 syncState.activeId,
44848 props.defaultActiveId,
44849 null
44850 ),
44851 orientation: defaultValue(
44852 props.orientation,
44853 syncState.orientation,
44854 "vertical"
44855 )
44856 }));
44857 const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
44858 store,
44859 placement: defaultValue(
44860 props.placement,
44861 syncState.placement,
44862 "bottom-start"
44863 )
44864 }));
44865 const initialValue = new String("");
44866 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), popover.getState()), {
44867 value: defaultValue(
44868 props.value,
44869 syncState.value,
44870 props.defaultValue,
44871 initialValue
44872 ),
44873 setValueOnMove: defaultValue(
44874 props.setValueOnMove,
44875 syncState.setValueOnMove,
44876 false
44877 ),
44878 labelElement: defaultValue(syncState.labelElement, null),
44879 selectElement: defaultValue(syncState.selectElement, null),
44880 listElement: defaultValue(syncState.listElement, null)
44881 });
44882 const select = createStore(initialState, composite, popover, store);
44883 setup(
44884 select,
44885 () => sync(select, ["value", "items"], (state) => {
44886 if (state.value !== initialValue) return;
44887 if (!state.items.length) return;
44888 const item = state.items.find(
44889 (item2) => !item2.disabled && item2.value != null
44890 );
44891 if ((item == null ? void 0 : item.value) == null) return;
44892 select.setState("value", item.value);
44893 })
44894 );
44895 setup(
44896 select,
44897 () => sync(select, ["mounted"], (state) => {
44898 if (state.mounted) return;
44899 select.setState("activeId", initialState.activeId);
44900 })
44901 );
44902 setup(
44903 select,
44904 () => sync(select, ["mounted", "items", "value"], (state) => {
44905 if (combobox) return;
44906 if (state.mounted) return;
44907 const values = toArray(state.value);
44908 const lastValue = values[values.length - 1];
44909 if (lastValue == null) return;
44910 const item = state.items.find(
44911 (item2) => !item2.disabled && item2.value === lastValue
44912 );
44913 if (!item) return;
44914 select.setState("activeId", item.id);
44915 })
44916 );
44917 setup(
44918 select,
44919 () => batch(select, ["setValueOnMove", "moves"], (state) => {
44920 const { mounted, value, activeId } = select.getState();
44921 if (!state.setValueOnMove && mounted) return;
44922 if (Array.isArray(value)) return;
44923 if (!state.moves) return;
44924 if (!activeId) return;
44925 const item = composite.item(activeId);
44926 if (!item || item.disabled || item.value == null) return;
44927 select.setState("value", item.value);
44928 })
44929 );
44930 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), popover), select), {
44931 combobox,
44932 setValue: (value) => select.setState("value", value),
44933 setLabelElement: (element) => select.setState("labelElement", element),
44934 setSelectElement: (element) => select.setState("selectElement", element),
44935 setListElement: (element) => select.setState("listElement", element)
44936 });
44937}
44938
44939
44940;// ./node_modules/@ariakit/react-core/esm/__chunks/S5WQ44SQ.js
44941"use client";
44942
44943
44944
44945
44946
44947
44948
44949// src/select/select-store.ts
44950
44951function useSelectStoreOptions(props) {
44952 const combobox = useComboboxProviderContext();
44953 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
44954 combobox: props.combobox !== void 0 ? props.combobox : combobox
44955 });
44956 return useCompositeStoreOptions(props);
44957}
44958function useSelectStoreProps(store, update, props) {
44959 useUpdateEffect(update, [props.combobox]);
44960 useStoreProps(store, props, "value", "setValue");
44961 useStoreProps(store, props, "setValueOnMove");
44962 return Object.assign(
44963 usePopoverStoreProps(
44964 useCompositeStoreProps(store, update, props),
44965 update,
44966 props
44967 ),
44968 { combobox: props.combobox }
44969 );
44970}
44971function useSelectStore(props = {}) {
44972 props = useSelectStoreOptions(props);
44973 const [store, update] = YV4JVR4I_useStore(createSelectStore, props);
44974 return useSelectStoreProps(store, update, props);
44975}
44976
44977
44978
44979;// ./node_modules/@ariakit/react-core/esm/__chunks/KPEX55MY.js
44980"use client";
44981
44982
44983
44984
44985// src/select/select-context.tsx
44986
44987var KPEX55MY_ctx = createStoreContext(
44988 [PopoverContextProvider, CompositeContextProvider],
44989 [PopoverScopedContextProvider, CompositeScopedContextProvider]
44990);
44991var useSelectContext = KPEX55MY_ctx.useContext;
44992var useSelectScopedContext = KPEX55MY_ctx.useScopedContext;
44993var useSelectProviderContext = KPEX55MY_ctx.useProviderContext;
44994var SelectContextProvider = KPEX55MY_ctx.ContextProvider;
44995var SelectScopedContextProvider = KPEX55MY_ctx.ScopedContextProvider;
44996var SelectItemCheckedContext = (0,external_React_.createContext)(false);
44997var SelectHeadingContext = (0,external_React_.createContext)(null);
44998
44999
45000
45001;// ./node_modules/@ariakit/react-core/esm/select/select-label.js
45002"use client";
45003
45004
45005
45006
45007
45008
45009
45010
45011
45012
45013
45014// src/select/select-label.tsx
45015
45016var select_label_TagName = "div";
45017var useSelectLabel = createHook(
45018 function useSelectLabel2(_a) {
45019 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
45020 const context = useSelectProviderContext();
45021 store = store || context;
45022 invariant(
45023 store,
45024 false && 0
45025 );
45026 const id = useId(props.id);
45027 const onClickProp = props.onClick;
45028 const onClick = useEvent((event) => {
45029 onClickProp == null ? void 0 : onClickProp(event);
45030 if (event.defaultPrevented) return;
45031 queueMicrotask(() => {
45032 const select = store == null ? void 0 : store.getState().selectElement;
45033 select == null ? void 0 : select.focus();
45034 });
45035 });
45036 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45037 id
45038 }, props), {
45039 ref: useMergeRefs(store.setLabelElement, props.ref),
45040 onClick,
45041 style: _3YLGPPWQ_spreadValues({
45042 cursor: "default"
45043 }, props.style)
45044 });
45045 return removeUndefinedValues(props);
45046 }
45047);
45048var SelectLabel = memo2(
45049 forwardRef2(function SelectLabel2(props) {
45050 const htmlProps = useSelectLabel(props);
45051 return LMDWO4NN_createElement(select_label_TagName, htmlProps);
45052 })
45053);
45054
45055
45056;// ./node_modules/@ariakit/react-core/esm/__chunks/X5NMLKT6.js
45057"use client";
45058
45059
45060
45061
45062
45063// src/button/button.tsx
45064
45065
45066var X5NMLKT6_TagName = "button";
45067var useButton = createHook(
45068 function useButton2(props) {
45069 const ref = (0,external_React_.useRef)(null);
45070 const tagName = useTagName(ref, X5NMLKT6_TagName);
45071 const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(
45072 () => !!tagName && isButton({ tagName, type: props.type })
45073 );
45074 (0,external_React_.useEffect)(() => {
45075 if (!ref.current) return;
45076 setIsNativeButton(isButton(ref.current));
45077 }, []);
45078 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45079 role: !isNativeButton && tagName !== "a" ? "button" : void 0
45080 }, props), {
45081 ref: useMergeRefs(ref, props.ref)
45082 });
45083 props = useCommand(props);
45084 return props;
45085 }
45086);
45087var X5NMLKT6_Button = forwardRef2(function Button2(props) {
45088 const htmlProps = useButton(props);
45089 return LMDWO4NN_createElement(X5NMLKT6_TagName, htmlProps);
45090});
45091
45092
45093
45094;// ./node_modules/@ariakit/react-core/esm/__chunks/P4IRICAX.js
45095"use client";
45096
45097
45098
45099
45100
45101
45102// src/disclosure/disclosure.tsx
45103
45104
45105var P4IRICAX_TagName = "button";
45106var P4IRICAX_symbol = Symbol("disclosure");
45107var useDisclosure = createHook(
45108 function useDisclosure2(_a) {
45109 var _b = _a, { store, toggleOnClick = true } = _b, props = __objRest(_b, ["store", "toggleOnClick"]);
45110 const context = useDisclosureProviderContext();
45111 store = store || context;
45112 invariant(
45113 store,
45114 false && 0
45115 );
45116 const ref = (0,external_React_.useRef)(null);
45117 const [expanded, setExpanded] = (0,external_React_.useState)(false);
45118 const disclosureElement = store.useState("disclosureElement");
45119 const open = store.useState("open");
45120 (0,external_React_.useEffect)(() => {
45121 let isCurrentDisclosure = disclosureElement === ref.current;
45122 if (!(disclosureElement == null ? void 0 : disclosureElement.isConnected)) {
45123 store == null ? void 0 : store.setDisclosureElement(ref.current);
45124 isCurrentDisclosure = true;
45125 }
45126 setExpanded(open && isCurrentDisclosure);
45127 }, [disclosureElement, store, open]);
45128 const onClickProp = props.onClick;
45129 const toggleOnClickProp = useBooleanEvent(toggleOnClick);
45130 const [isDuplicate, metadataProps] = useMetadataProps(props, P4IRICAX_symbol, true);
45131 const onClick = useEvent((event) => {
45132 onClickProp == null ? void 0 : onClickProp(event);
45133 if (event.defaultPrevented) return;
45134 if (isDuplicate) return;
45135 if (!toggleOnClickProp(event)) return;
45136 store == null ? void 0 : store.setDisclosureElement(event.currentTarget);
45137 store == null ? void 0 : store.toggle();
45138 });
45139 const contentElement = store.useState("contentElement");
45140 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({
45141 "aria-expanded": expanded,
45142 "aria-controls": contentElement == null ? void 0 : contentElement.id
45143 }, metadataProps), props), {
45144 ref: useMergeRefs(ref, props.ref),
45145 onClick
45146 });
45147 props = useButton(props);
45148 return props;
45149 }
45150);
45151var Disclosure = forwardRef2(function Disclosure2(props) {
45152 const htmlProps = useDisclosure(props);
45153 return LMDWO4NN_createElement(P4IRICAX_TagName, htmlProps);
45154});
45155
45156
45157
45158;// ./node_modules/@ariakit/react-core/esm/__chunks/AXB53BZF.js
45159"use client";
45160
45161
45162
45163
45164
45165// src/dialog/dialog-disclosure.tsx
45166
45167
45168var AXB53BZF_TagName = "button";
45169var useDialogDisclosure = createHook(
45170 function useDialogDisclosure2(_a) {
45171 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
45172 const context = useDialogProviderContext();
45173 store = store || context;
45174 invariant(
45175 store,
45176 false && 0
45177 );
45178 const contentElement = store.useState("contentElement");
45179 props = _3YLGPPWQ_spreadValues({
45180 "aria-haspopup": getPopupRole(contentElement, "dialog")
45181 }, props);
45182 props = useDisclosure(_3YLGPPWQ_spreadValues({ store }, props));
45183 return props;
45184 }
45185);
45186var DialogDisclosure = forwardRef2(function DialogDisclosure2(props) {
45187 const htmlProps = useDialogDisclosure(props);
45188 return LMDWO4NN_createElement(AXB53BZF_TagName, htmlProps);
45189});
45190
45191
45192
45193;// ./node_modules/@ariakit/react-core/esm/__chunks/OMU7RWRV.js
45194"use client";
45195
45196
45197
45198
45199
45200// src/popover/popover-anchor.tsx
45201var OMU7RWRV_TagName = "div";
45202var usePopoverAnchor = createHook(
45203 function usePopoverAnchor2(_a) {
45204 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
45205 const context = usePopoverProviderContext();
45206 store = store || context;
45207 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
45208 ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref)
45209 });
45210 return props;
45211 }
45212);
45213var PopoverAnchor = forwardRef2(function PopoverAnchor2(props) {
45214 const htmlProps = usePopoverAnchor(props);
45215 return LMDWO4NN_createElement(OMU7RWRV_TagName, htmlProps);
45216});
45217
45218
45219
45220;// ./node_modules/@ariakit/react-core/esm/__chunks/QYJ6MIDR.js
45221"use client";
45222
45223
45224
45225
45226
45227
45228
45229// src/popover/popover-disclosure.tsx
45230
45231
45232var QYJ6MIDR_TagName = "button";
45233var usePopoverDisclosure = createHook(function usePopoverDisclosure2(_a) {
45234 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
45235 const context = usePopoverProviderContext();
45236 store = store || context;
45237 invariant(
45238 store,
45239 false && 0
45240 );
45241 const onClickProp = props.onClick;
45242 const onClick = useEvent((event) => {
45243 store == null ? void 0 : store.setAnchorElement(event.currentTarget);
45244 onClickProp == null ? void 0 : onClickProp(event);
45245 });
45246 props = useWrapElement(
45247 props,
45248 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverScopedContextProvider, { value: store, children: element }),
45249 [store]
45250 );
45251 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
45252 onClick
45253 });
45254 props = usePopoverAnchor(_3YLGPPWQ_spreadValues({ store }, props));
45255 props = useDialogDisclosure(_3YLGPPWQ_spreadValues({ store }, props));
45256 return props;
45257});
45258var PopoverDisclosure = forwardRef2(function PopoverDisclosure2(props) {
45259 const htmlProps = usePopoverDisclosure(props);
45260 return LMDWO4NN_createElement(QYJ6MIDR_TagName, htmlProps);
45261});
45262
45263
45264
45265;// ./node_modules/@ariakit/react-core/esm/__chunks/DR55NYVS.js
45266"use client";
45267
45268
45269
45270
45271// src/popover/popover-disclosure-arrow.tsx
45272
45273
45274
45275var DR55NYVS_TagName = "span";
45276var pointsMap = {
45277 top: "4,10 8,6 12,10",
45278 right: "6,4 10,8 6,12",
45279 bottom: "4,6 8,10 12,6",
45280 left: "10,4 6,8 10,12"
45281};
45282var usePopoverDisclosureArrow = createHook(function usePopoverDisclosureArrow2(_a) {
45283 var _b = _a, { store, placement } = _b, props = __objRest(_b, ["store", "placement"]);
45284 const context = usePopoverContext();
45285 store = store || context;
45286 invariant(
45287 store,
45288 false && 0
45289 );
45290 const position = store.useState((state) => placement || state.placement);
45291 const dir = position.split("-")[0];
45292 const points = pointsMap[dir];
45293 const children = (0,external_React_.useMemo)(
45294 () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
45295 "svg",
45296 {
45297 display: "block",
45298 fill: "none",
45299 stroke: "currentColor",
45300 strokeLinecap: "round",
45301 strokeLinejoin: "round",
45302 strokeWidth: 1.5,
45303 viewBox: "0 0 16 16",
45304 height: "1em",
45305 width: "1em",
45306 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("polyline", { points })
45307 }
45308 ),
45309 [points]
45310 );
45311 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45312 children,
45313 "aria-hidden": true
45314 }, props), {
45315 style: _3YLGPPWQ_spreadValues({
45316 width: "1em",
45317 height: "1em",
45318 pointerEvents: "none"
45319 }, props.style)
45320 });
45321 return removeUndefinedValues(props);
45322});
45323var PopoverDisclosureArrow = forwardRef2(
45324 function PopoverDisclosureArrow2(props) {
45325 const htmlProps = usePopoverDisclosureArrow(props);
45326 return LMDWO4NN_createElement(DR55NYVS_TagName, htmlProps);
45327 }
45328);
45329
45330
45331
45332;// ./node_modules/@ariakit/react-core/esm/__chunks/UD53QJDV.js
45333"use client";
45334
45335
45336
45337
45338
45339// src/select/select-arrow.tsx
45340var UD53QJDV_TagName = "span";
45341var useSelectArrow = createHook(
45342 function useSelectArrow2(_a) {
45343 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
45344 const context = useSelectContext();
45345 store = store || context;
45346 props = usePopoverDisclosureArrow(_3YLGPPWQ_spreadValues({ store }, props));
45347 return props;
45348 }
45349);
45350var SelectArrow = forwardRef2(function SelectArrow2(props) {
45351 const htmlProps = useSelectArrow(props);
45352 return LMDWO4NN_createElement(UD53QJDV_TagName, htmlProps);
45353});
45354
45355
45356
45357;// ./node_modules/@ariakit/react-core/esm/select/select.js
45358"use client";
45359
45360
45361
45362
45363
45364
45365
45366
45367
45368
45369
45370
45371
45372
45373
45374
45375
45376
45377
45378
45379
45380
45381
45382// src/select/select.tsx
45383
45384
45385
45386
45387
45388
45389var select_TagName = "button";
45390function getSelectedValues(select) {
45391 return Array.from(select.selectedOptions).map((option) => option.value);
45392}
45393function nextWithValue(store, next) {
45394 return () => {
45395 const nextId = next();
45396 if (!nextId) return;
45397 let i = 0;
45398 let nextItem = store.item(nextId);
45399 const firstItem = nextItem;
45400 while (nextItem && nextItem.value == null) {
45401 const nextId2 = next(++i);
45402 if (!nextId2) return;
45403 nextItem = store.item(nextId2);
45404 if (nextItem === firstItem) break;
45405 }
45406 return nextItem == null ? void 0 : nextItem.id;
45407 };
45408}
45409var useSelect = createHook(function useSelect2(_a) {
45410 var _b = _a, {
45411 store,
45412 name,
45413 form,
45414 required,
45415 showOnKeyDown = true,
45416 moveOnKeyDown = true,
45417 toggleOnPress = true,
45418 toggleOnClick = toggleOnPress
45419 } = _b, props = __objRest(_b, [
45420 "store",
45421 "name",
45422 "form",
45423 "required",
45424 "showOnKeyDown",
45425 "moveOnKeyDown",
45426 "toggleOnPress",
45427 "toggleOnClick"
45428 ]);
45429 const context = useSelectProviderContext();
45430 store = store || context;
45431 invariant(
45432 store,
45433 false && 0
45434 );
45435 const onKeyDownProp = props.onKeyDown;
45436 const showOnKeyDownProp = useBooleanEvent(showOnKeyDown);
45437 const moveOnKeyDownProp = useBooleanEvent(moveOnKeyDown);
45438 const placement = store.useState("placement");
45439 const dir = placement.split("-")[0];
45440 const value = store.useState("value");
45441 const multiSelectable = Array.isArray(value);
45442 const onKeyDown = useEvent((event) => {
45443 var _a2;
45444 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
45445 if (event.defaultPrevented) return;
45446 if (!store) return;
45447 const { orientation, items: items2, activeId } = store.getState();
45448 const isVertical = orientation !== "horizontal";
45449 const isHorizontal = orientation !== "vertical";
45450 const isGrid = !!((_a2 = items2.find((item) => !item.disabled && item.value != null)) == null ? void 0 : _a2.rowId);
45451 const moveKeyMap = {
45452 ArrowUp: (isGrid || isVertical) && nextWithValue(store, store.up),
45453 ArrowRight: (isGrid || isHorizontal) && nextWithValue(store, store.next),
45454 ArrowDown: (isGrid || isVertical) && nextWithValue(store, store.down),
45455 ArrowLeft: (isGrid || isHorizontal) && nextWithValue(store, store.previous)
45456 };
45457 const getId = moveKeyMap[event.key];
45458 if (getId && moveOnKeyDownProp(event)) {
45459 event.preventDefault();
45460 store.move(getId());
45461 }
45462 const isTopOrBottom = dir === "top" || dir === "bottom";
45463 const isLeft = dir === "left";
45464 const isRight = dir === "right";
45465 const canShowKeyMap = {
45466 ArrowDown: isTopOrBottom,
45467 ArrowUp: isTopOrBottom,
45468 ArrowLeft: isLeft,
45469 ArrowRight: isRight
45470 };
45471 const canShow = canShowKeyMap[event.key];
45472 if (canShow && showOnKeyDownProp(event)) {
45473 event.preventDefault();
45474 store.move(activeId);
45475 queueBeforeEvent(event.currentTarget, "keyup", store.show);
45476 }
45477 });
45478 props = useWrapElement(
45479 props,
45480 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectScopedContextProvider, { value: store, children: element }),
45481 [store]
45482 );
45483 const [autofill, setAutofill] = (0,external_React_.useState)(false);
45484 const nativeSelectChangedRef = (0,external_React_.useRef)(false);
45485 (0,external_React_.useEffect)(() => {
45486 const nativeSelectChanged = nativeSelectChangedRef.current;
45487 nativeSelectChangedRef.current = false;
45488 if (nativeSelectChanged) return;
45489 setAutofill(false);
45490 }, [value]);
45491 const labelId = store.useState((state) => {
45492 var _a2;
45493 return (_a2 = state.labelElement) == null ? void 0 : _a2.id;
45494 });
45495 const label = props["aria-label"];
45496 const labelledBy = props["aria-labelledby"] || labelId;
45497 const items = store.useState((state) => {
45498 if (!name) return;
45499 return state.items;
45500 });
45501 const values = (0,external_React_.useMemo)(() => {
45502 return [...new Set(items == null ? void 0 : items.map((i) => i.value).filter((v) => v != null))];
45503 }, [items]);
45504 props = useWrapElement(
45505 props,
45506 (element) => {
45507 if (!name) return element;
45508 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
45509 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
45510 "select",
45511 {
45512 style: {
45513 border: 0,
45514 clip: "rect(0 0 0 0)",
45515 height: "1px",
45516 margin: "-1px",
45517 overflow: "hidden",
45518 padding: 0,
45519 position: "absolute",
45520 whiteSpace: "nowrap",
45521 width: "1px"
45522 },
45523 tabIndex: -1,
45524 "aria-hidden": true,
45525 "aria-label": label,
45526 "aria-labelledby": labelledBy,
45527 name,
45528 form,
45529 required,
45530 value,
45531 multiple: multiSelectable,
45532 onFocus: () => {
45533 var _a2;
45534 return (_a2 = store == null ? void 0 : store.getState().selectElement) == null ? void 0 : _a2.focus();
45535 },
45536 onChange: (event) => {
45537 nativeSelectChangedRef.current = true;
45538 setAutofill(true);
45539 store == null ? void 0 : store.setValue(
45540 multiSelectable ? getSelectedValues(event.target) : event.target.value
45541 );
45542 },
45543 children: [
45544 toArray(value).map((value2) => {
45545 if (value2 == null) return null;
45546 if (values.includes(value2)) return null;
45547 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { value: value2, children: value2 }, value2);
45548 }),
45549 values.map((value2) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { value: value2, children: value2 }, value2))
45550 ]
45551 }
45552 ),
45553 element
45554 ] });
45555 },
45556 [
45557 store,
45558 label,
45559 labelledBy,
45560 name,
45561 form,
45562 required,
45563 value,
45564 multiSelectable,
45565 values
45566 ]
45567 );
45568 const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
45569 value,
45570 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectArrow, {})
45571 ] });
45572 const contentElement = store.useState("contentElement");
45573 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45574 role: "combobox",
45575 "aria-autocomplete": "none",
45576 "aria-labelledby": labelId,
45577 "aria-haspopup": getPopupRole(contentElement, "listbox"),
45578 "data-autofill": autofill || void 0,
45579 "data-name": name,
45580 children
45581 }, props), {
45582 ref: useMergeRefs(store.setSelectElement, props.ref),
45583 onKeyDown
45584 });
45585 props = usePopoverDisclosure(_3YLGPPWQ_spreadValues({ store, toggleOnClick }, props));
45586 props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store }, props));
45587 return props;
45588});
45589var select_Select = forwardRef2(function Select2(props) {
45590 const htmlProps = useSelect(props);
45591 return LMDWO4NN_createElement(select_TagName, htmlProps);
45592});
45593
45594
45595;// ./node_modules/@ariakit/react-core/esm/__chunks/XRBJGF7I.js
45596"use client";
45597
45598
45599
45600
45601
45602
45603
45604
45605// src/select/select-list.tsx
45606
45607
45608
45609
45610var XRBJGF7I_TagName = "div";
45611var SelectListContext = (0,external_React_.createContext)(null);
45612var useSelectList = createHook(
45613 function useSelectList2(_a) {
45614 var _b = _a, {
45615 store,
45616 resetOnEscape = true,
45617 hideOnEnter = true,
45618 focusOnMove = true,
45619 composite,
45620 alwaysVisible
45621 } = _b, props = __objRest(_b, [
45622 "store",
45623 "resetOnEscape",
45624 "hideOnEnter",
45625 "focusOnMove",
45626 "composite",
45627 "alwaysVisible"
45628 ]);
45629 const context = useSelectContext();
45630 store = store || context;
45631 invariant(
45632 store,
45633 false && 0
45634 );
45635 const id = useId(props.id);
45636 const value = store.useState("value");
45637 const multiSelectable = Array.isArray(value);
45638 const [defaultValue, setDefaultValue] = (0,external_React_.useState)(value);
45639 const mounted = store.useState("mounted");
45640 (0,external_React_.useEffect)(() => {
45641 if (mounted) return;
45642 setDefaultValue(value);
45643 }, [mounted, value]);
45644 resetOnEscape = resetOnEscape && !multiSelectable;
45645 const onKeyDownProp = props.onKeyDown;
45646 const resetOnEscapeProp = useBooleanEvent(resetOnEscape);
45647 const hideOnEnterProp = useBooleanEvent(hideOnEnter);
45648 const onKeyDown = useEvent((event) => {
45649 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
45650 if (event.defaultPrevented) return;
45651 if (event.key === "Escape" && resetOnEscapeProp(event)) {
45652 store == null ? void 0 : store.setValue(defaultValue);
45653 }
45654 if (event.key === " " || event.key === "Enter") {
45655 if (isSelfTarget(event) && hideOnEnterProp(event)) {
45656 event.preventDefault();
45657 store == null ? void 0 : store.hide();
45658 }
45659 }
45660 });
45661 const headingContext = (0,external_React_.useContext)(SelectHeadingContext);
45662 const headingState = (0,external_React_.useState)();
45663 const [headingId, setHeadingId] = headingContext || headingState;
45664 const headingContextValue = (0,external_React_.useMemo)(
45665 () => [headingId, setHeadingId],
45666 [headingId]
45667 );
45668 const [childStore, setChildStore] = (0,external_React_.useState)(null);
45669 const setStore = (0,external_React_.useContext)(SelectListContext);
45670 (0,external_React_.useEffect)(() => {
45671 if (!setStore) return;
45672 setStore(store);
45673 return () => setStore(null);
45674 }, [setStore, store]);
45675 props = useWrapElement(
45676 props,
45677 (element2) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectListContext.Provider, { value: setChildStore, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectHeadingContext.Provider, { value: headingContextValue, children: element2 }) }) }),
45678 [store, headingContextValue]
45679 );
45680 const hasCombobox = !!store.combobox;
45681 composite = composite != null ? composite : !hasCombobox && childStore !== store;
45682 const [element, setElement] = useTransactionState(
45683 composite ? store.setListElement : null
45684 );
45685 const role = useAttribute(element, "role", props.role);
45686 const isCompositeRole = role === "listbox" || role === "menu" || role === "tree" || role === "grid";
45687 const ariaMultiSelectable = composite || isCompositeRole ? multiSelectable || void 0 : void 0;
45688 const hidden = isHidden(mounted, props.hidden, alwaysVisible);
45689 const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style;
45690 if (composite) {
45691 props = _3YLGPPWQ_spreadValues({
45692 role: "listbox",
45693 "aria-multiselectable": ariaMultiSelectable
45694 }, props);
45695 }
45696 const labelId = store.useState(
45697 (state) => {
45698 var _a2;
45699 return headingId || ((_a2 = state.labelElement) == null ? void 0 : _a2.id);
45700 }
45701 );
45702 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45703 id,
45704 "aria-labelledby": labelId,
45705 hidden
45706 }, props), {
45707 ref: useMergeRefs(setElement, props.ref),
45708 style,
45709 onKeyDown
45710 });
45711 props = useComposite(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store }, props), { composite }));
45712 props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store, typeahead: !hasCombobox }, props));
45713 return props;
45714 }
45715);
45716var SelectList = forwardRef2(function SelectList2(props) {
45717 const htmlProps = useSelectList(props);
45718 return LMDWO4NN_createElement(XRBJGF7I_TagName, htmlProps);
45719});
45720
45721
45722
45723;// ./node_modules/@ariakit/react-core/esm/select/select-popover.js
45724"use client";
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737
45738
45739
45740
45741
45742
45743
45744
45745
45746
45747
45748
45749
45750
45751
45752
45753
45754
45755
45756
45757
45758
45759
45760
45761
45762
45763
45764
45765
45766
45767
45768
45769
45770
45771// src/select/select-popover.tsx
45772var select_popover_TagName = "div";
45773var useSelectPopover = createHook(
45774 function useSelectPopover2(_a) {
45775 var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]);
45776 const context = useSelectProviderContext();
45777 store = store || context;
45778 props = useSelectList(_3YLGPPWQ_spreadValues({ store, alwaysVisible }, props));
45779 props = usePopover(_3YLGPPWQ_spreadValues({ store, alwaysVisible }, props));
45780 return props;
45781 }
45782);
45783var SelectPopover = createDialogComponent(
45784 forwardRef2(function SelectPopover2(props) {
45785 const htmlProps = useSelectPopover(props);
45786 return LMDWO4NN_createElement(select_popover_TagName, htmlProps);
45787 }),
45788 useSelectProviderContext
45789);
45790
45791
45792;// ./node_modules/@ariakit/react-core/esm/__chunks/YF2ICFG4.js
45793"use client";
45794
45795
45796
45797
45798
45799
45800
45801
45802// src/select/select-item.tsx
45803
45804
45805
45806
45807
45808var YF2ICFG4_TagName = "div";
45809function isSelected(storeValue, itemValue) {
45810 if (itemValue == null) return;
45811 if (storeValue == null) return false;
45812 if (Array.isArray(storeValue)) {
45813 return storeValue.includes(itemValue);
45814 }
45815 return storeValue === itemValue;
45816}
45817var useSelectItem = createHook(
45818 function useSelectItem2(_a) {
45819 var _b = _a, {
45820 store,
45821 value,
45822 getItem: getItemProp,
45823 hideOnClick,
45824 setValueOnClick = value != null,
45825 preventScrollOnKeyDown = true,
45826 focusOnHover = true
45827 } = _b, props = __objRest(_b, [
45828 "store",
45829 "value",
45830 "getItem",
45831 "hideOnClick",
45832 "setValueOnClick",
45833 "preventScrollOnKeyDown",
45834 "focusOnHover"
45835 ]);
45836 var _a2;
45837 const context = useSelectScopedContext();
45838 store = store || context;
45839 invariant(
45840 store,
45841 false && 0
45842 );
45843 const id = useId(props.id);
45844 const disabled = disabledFromProps(props);
45845 const { listElement, multiSelectable, selected, autoFocus } = useStoreStateObject(store, {
45846 listElement: "listElement",
45847 multiSelectable(state) {
45848 return Array.isArray(state.value);
45849 },
45850 selected(state) {
45851 return isSelected(state.value, value);
45852 },
45853 autoFocus(state) {
45854 if (value == null) return false;
45855 if (state.value == null) return false;
45856 if (state.activeId !== id && (store == null ? void 0 : store.item(state.activeId))) {
45857 return false;
45858 }
45859 if (Array.isArray(state.value)) {
45860 return state.value[state.value.length - 1] === value;
45861 }
45862 return state.value === value;
45863 }
45864 });
45865 const getItem = (0,external_React_.useCallback)(
45866 (item) => {
45867 const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), {
45868 value: disabled ? void 0 : value,
45869 children: value
45870 });
45871 if (getItemProp) {
45872 return getItemProp(nextItem);
45873 }
45874 return nextItem;
45875 },
45876 [disabled, value, getItemProp]
45877 );
45878 hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
45879 const onClickProp = props.onClick;
45880 const setValueOnClickProp = useBooleanEvent(setValueOnClick);
45881 const hideOnClickProp = useBooleanEvent(hideOnClick);
45882 const onClick = useEvent((event) => {
45883 onClickProp == null ? void 0 : onClickProp(event);
45884 if (event.defaultPrevented) return;
45885 if (isDownloading(event)) return;
45886 if (isOpeningInNewTab(event)) return;
45887 if (setValueOnClickProp(event) && value != null) {
45888 store == null ? void 0 : store.setValue((prevValue) => {
45889 if (!Array.isArray(prevValue)) return value;
45890 if (prevValue.includes(value)) {
45891 return prevValue.filter((v) => v !== value);
45892 }
45893 return [...prevValue, value];
45894 });
45895 }
45896 if (hideOnClickProp(event)) {
45897 store == null ? void 0 : store.hide();
45898 }
45899 });
45900 props = useWrapElement(
45901 props,
45902 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }),
45903 [selected]
45904 );
45905 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45906 id,
45907 role: getPopupItemRole(listElement),
45908 "aria-selected": selected,
45909 children: value
45910 }, props), {
45911 autoFocus: (_a2 = props.autoFocus) != null ? _a2 : autoFocus,
45912 onClick
45913 });
45914 props = useCompositeItem(_3YLGPPWQ_spreadValues({
45915 store,
45916 getItem,
45917 preventScrollOnKeyDown
45918 }, props));
45919 const focusOnHoverProp = useBooleanEvent(focusOnHover);
45920 props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45921 store
45922 }, props), {
45923 // We have to disable focusOnHover when the popup is closed, otherwise
45924 // the active item will change to null (the container) when the popup is
45925 // closed by clicking on an item.
45926 focusOnHover(event) {
45927 if (!focusOnHoverProp(event)) return false;
45928 const state = store == null ? void 0 : store.getState();
45929 return !!(state == null ? void 0 : state.open);
45930 }
45931 }));
45932 return props;
45933 }
45934);
45935var SelectItem = memo2(
45936 forwardRef2(function SelectItem2(props) {
45937 const htmlProps = useSelectItem(props);
45938 return LMDWO4NN_createElement(YF2ICFG4_TagName, htmlProps);
45939 })
45940);
45941
45942
45943
45944;// ./node_modules/@ariakit/react-core/esm/__chunks/EYKMH5G5.js
45945"use client";
45946
45947// src/checkbox/checkbox-checked-context.tsx
45948
45949var CheckboxCheckedContext = (0,external_React_.createContext)(false);
45950
45951
45952
45953;// ./node_modules/@ariakit/react-core/esm/__chunks/5JCRYSSV.js
45954"use client";
45955
45956
45957
45958
45959// src/checkbox/checkbox-check.tsx
45960
45961
45962
45963var _5JCRYSSV_TagName = "span";
45964var checkmark = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
45965 "svg",
45966 {
45967 display: "block",
45968 fill: "none",
45969 stroke: "currentColor",
45970 strokeLinecap: "round",
45971 strokeLinejoin: "round",
45972 strokeWidth: 1.5,
45973 viewBox: "0 0 16 16",
45974 height: "1em",
45975 width: "1em",
45976 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("polyline", { points: "4,8 7,12 12,4" })
45977 }
45978);
45979function getChildren(props) {
45980 if (props.checked) {
45981 return props.children || checkmark;
45982 }
45983 if (typeof props.children === "function") {
45984 return props.children;
45985 }
45986 return null;
45987}
45988var useCheckboxCheck = createHook(
45989 function useCheckboxCheck2(_a) {
45990 var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
45991 const context = (0,external_React_.useContext)(CheckboxCheckedContext);
45992 checked = checked != null ? checked : context;
45993 const children = getChildren({ checked, children: props.children });
45994 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
45995 "aria-hidden": true
45996 }, props), {
45997 children,
45998 style: _3YLGPPWQ_spreadValues({
45999 width: "1em",
46000 height: "1em",
46001 pointerEvents: "none"
46002 }, props.style)
46003 });
46004 return removeUndefinedValues(props);
46005 }
46006);
46007var CheckboxCheck = forwardRef2(function CheckboxCheck2(props) {
46008 const htmlProps = useCheckboxCheck(props);
46009 return LMDWO4NN_createElement(_5JCRYSSV_TagName, htmlProps);
46010});
46011
46012
46013
46014;// ./node_modules/@ariakit/react-core/esm/select/select-item-check.js
46015"use client";
46016
46017
46018
46019
46020
46021
46022
46023
46024
46025
46026
46027
46028
46029// src/select/select-item-check.tsx
46030
46031var select_item_check_TagName = "span";
46032var useSelectItemCheck = createHook(
46033 function useSelectItemCheck2(_a) {
46034 var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
46035 const context = (0,external_React_.useContext)(SelectItemCheckedContext);
46036 checked = checked != null ? checked : context;
46037 props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked }));
46038 return props;
46039 }
46040);
46041var SelectItemCheck = forwardRef2(function SelectItemCheck2(props) {
46042 const htmlProps = useSelectItemCheck(props);
46043 return LMDWO4NN_createElement(select_item_check_TagName, htmlProps);
46044});
46045
46046
46047;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/styles.js
46048
46049function custom_select_control_v2_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
46050 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
46051}
46052
46053
46054
46055
46056
46057
46058const ANIMATION_PARAMS = {
46059 SLIDE_AMOUNT: "2px",
46060 DURATION: "400ms",
46061 EASING: "cubic-bezier( 0.16, 1, 0.3, 1 )"
46062};
46063const INLINE_PADDING = {
46064 compact: config_values_default.controlPaddingXSmall,
46065 small: config_values_default.controlPaddingXSmall,
46066 default: config_values_default.controlPaddingX
46067};
46068const getSelectSize = (size, heightProperty) => {
46069 const sizes = {
46070 compact: {
46071 [heightProperty]: 32,
46072 paddingInlineStart: INLINE_PADDING.compact,
46073 paddingInlineEnd: INLINE_PADDING.compact + chevronIconSize
46074 },
46075 default: {
46076 [heightProperty]: 40,
46077 paddingInlineStart: INLINE_PADDING.default,
46078 paddingInlineEnd: INLINE_PADDING.default + chevronIconSize
46079 },
46080 small: {
46081 [heightProperty]: 24,
46082 paddingInlineStart: INLINE_PADDING.small,
46083 paddingInlineEnd: INLINE_PADDING.small + chevronIconSize
46084 }
46085 };
46086 return sizes[size] || sizes.default;
46087};
46088const getSelectItemSize = (size) => {
46089 const checkmarkCorrection = 6;
46090 const sizes = {
46091 compact: {
46092 paddingInlineStart: INLINE_PADDING.compact,
46093 paddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection
46094 },
46095 default: {
46096 paddingInlineStart: INLINE_PADDING.default,
46097 paddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection
46098 },
46099 small: {
46100 paddingInlineStart: INLINE_PADDING.small,
46101 paddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection
46102 }
46103 };
46104 return sizes[size] || sizes.default;
46105};
46106const styles_Select = /* @__PURE__ */ emotion_styled_base_browser_esm(select_Select, true ? {
46107 // Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
46108 shouldForwardProp: (prop) => prop !== "hasCustomRenderProp",
46109 target: "e1p3eej77"
46110} : 0)(({
46111 size,
46112 hasCustomRenderProp
46113}) => /* @__PURE__ */ emotion_react_browser_esm_css("display:block;background-color:", COLORS.theme.background, ";border:none;color:", COLORS.theme.foreground, ";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}", getSelectSize(size, hasCustomRenderProp ? "minHeight" : "height"), " ", !hasCustomRenderProp && truncateStyles, " ", fontSizeStyles({
46114 inputSize: size
46115}), ";" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0);
46116const slideDownAndFade = emotion_react_browser_esm_keyframes({
46117 "0%": {
46118 opacity: 0,
46119 transform: `translateY(-${ANIMATION_PARAMS.SLIDE_AMOUNT})`
46120 },
46121 "100%": {
46122 opacity: 1,
46123 transform: "translateY(0)"
46124 }
46125});
46126const styles_SelectPopover = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectPopover, true ? {
46127 target: "e1p3eej76"
46128} : 0)("display:flex;flex-direction:column;background-color:", COLORS.theme.background, ";border-radius:", config_values_default.radiusSmall, ";border:1px solid ", COLORS.theme.foreground, ";box-shadow:", config_values_default.elevationMedium, ";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:", ANIMATION_PARAMS.DURATION, ";animation-timing-function:", ANIMATION_PARAMS.EASING, ";animation-name:", slideDownAndFade, ";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}" + ( true ? "" : 0));
46129const styles_SelectItem = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectItem, true ? {
46130 target: "e1p3eej75"
46131} : 0)(({
46132 size
46133}) => /* @__PURE__ */ emotion_react_browser_esm_css("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:", config_values_default.fontSize, ";line-height:28px;padding-block:", space(2), ";scroll-margin:", space(1), ";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:", COLORS.theme.gray[300], ";}", getSelectItemSize(size), ";" + ( true ? "" : 0), true ? "" : 0), true ? "" : 0);
46134const truncateStyles = true ? {
46135 name: "1h52dri",
46136 styles: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap"
46137} : 0;
46138const SelectedExperimentalHintWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
46139 target: "e1p3eej74"
46140} : 0)(truncateStyles, ";" + ( true ? "" : 0));
46141const SelectedExperimentalHintItem = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
46142 target: "e1p3eej73"
46143} : 0)("color:", COLORS.theme.gray[600], ";margin-inline-start:", space(2), ";" + ( true ? "" : 0));
46144const WithHintItemWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
46145 target: "e1p3eej72"
46146} : 0)("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:", space(4), ";" + ( true ? "" : 0));
46147const WithHintItemHint = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
46148 target: "e1p3eej71"
46149} : 0)("color:", COLORS.theme.gray[600], ";text-align:initial;line-height:", config_values_default.fontLineHeightBase, ";padding-inline-end:", space(1), ";margin-block:", space(1), ";" + ( true ? "" : 0));
46150const SelectedItemCheck = /* @__PURE__ */ emotion_styled_base_browser_esm(SelectItemCheck, true ? {
46151 target: "e1p3eej70"
46152} : 0)("display:flex;align-items:center;margin-inline-start:", space(2), ";fill:currentColor;align-self:start;margin-block-start:2px;font-size:0;", WithHintItemWrapper, "~&,&:not(:empty){font-size:24px;}" + ( true ? "" : 0));
46153
46154
46155;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/custom-select.js
46156
46157
46158
46159
46160
46161
46162
46163
46164
46165const CustomSelectContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
46166CustomSelectContext.displayName = "CustomSelectContext";
46167function defaultRenderSelectedValue(value) {
46168 const isValueEmpty = Array.isArray(value) ? value.length === 0 : value === void 0 || value === null;
46169 if (isValueEmpty) {
46170 return (0,external_wp_i18n_namespaceObject.__)("Select an item");
46171 }
46172 if (Array.isArray(value)) {
46173 return value.length === 1 ? value[0] : (0,external_wp_i18n_namespaceObject.sprintf)(
46174 // translators: %d: number of items selected (it will always be 2 or more items)
46175 (0,external_wp_i18n_namespaceObject._n)("%d item selected", "%d items selected", value.length),
46176 value.length
46177 );
46178 }
46179 return value;
46180}
46181const CustomSelectButton = ({
46182 renderSelectedValue,
46183 size = "default",
46184 store,
46185 ...restProps
46186}) => {
46187 const {
46188 value: currentValue
46189 } = useStoreState(store);
46190 const computedRenderSelectedValue = (0,external_wp_element_namespaceObject.useMemo)(() => renderSelectedValue !== null && renderSelectedValue !== void 0 ? renderSelectedValue : defaultRenderSelectedValue, [renderSelectedValue]);
46191 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Select, {
46192 ...restProps,
46193 size,
46194 hasCustomRenderProp: !!renderSelectedValue,
46195 store,
46196 children: computedRenderSelectedValue(currentValue)
46197 });
46198};
46199function _CustomSelect(props) {
46200 const {
46201 children,
46202 hideLabelFromVision = false,
46203 label,
46204 size,
46205 store,
46206 className,
46207 isLegacy = false,
46208 ...restProps
46209 } = props;
46210 const onSelectPopoverKeyDown = (0,external_wp_element_namespaceObject.useCallback)((e) => {
46211 if (isLegacy) {
46212 e.stopPropagation();
46213 }
46214 }, [isLegacy]);
46215 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
46216 store,
46217 size
46218 }), [store, size]);
46219 return (
46220 // Where should `restProps` be forwarded to?
46221 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
46222 className,
46223 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectLabel, {
46224 store,
46225 render: hideLabelFromVision ? (
46226 // @ts-expect-error `children` are passed via the render prop
46227 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {})
46228 ) : (
46229 // @ts-expect-error `children` are passed via the render prop
46230 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
46231 as: "div"
46232 })
46233 ),
46234 children: label
46235 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(input_base_default, {
46236 __next40pxDefaultSize: true,
46237 size,
46238 suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(chevron_down_chevron_down_default, {}),
46239 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomSelectButton, {
46240 ...restProps,
46241 size,
46242 store,
46243 showOnKeyDown: !isLegacy
46244 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_SelectPopover, {
46245 gutter: 12,
46246 store,
46247 sameWidth: true,
46248 slide: false,
46249 onKeyDown: onSelectPopoverKeyDown,
46250 flip: !isLegacy,
46251 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomSelectContext.Provider, {
46252 value: contextValue,
46253 children
46254 })
46255 })]
46256 })]
46257 })
46258 );
46259}
46260var custom_select_default = _CustomSelect;
46261
46262
46263;// ./node_modules/@wordpress/components/build-module/custom-select-control-v2/item.js
46264
46265
46266
46267
46268
46269function CustomSelectItem({
46270 children,
46271 ...props
46272}) {
46273 var _customSelectContext$;
46274 const customSelectContext = (0,external_wp_element_namespaceObject.useContext)(CustomSelectContext);
46275 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_SelectItem, {
46276 store: customSelectContext?.store,
46277 size: (_customSelectContext$ = customSelectContext?.size) !== null && _customSelectContext$ !== void 0 ? _customSelectContext$ : "default",
46278 ...props,
46279 children: [children !== null && children !== void 0 ? children : props.value, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectedItemCheck, {
46280 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
46281 icon: check_default
46282 })
46283 })]
46284 });
46285}
46286CustomSelectItem.displayName = "CustomSelectControlV2.Item";
46287var item_default = CustomSelectItem;
46288
46289
46290;// ./node_modules/@wordpress/components/build-module/custom-select-control/index.js
46291
46292
46293
46294
46295
46296
46297
46298
46299
46300
46301function custom_select_control_useDeprecatedProps({
46302 __experimentalShowSelectedHint,
46303 ...otherProps
46304}) {
46305 return {
46306 showSelectedHint: __experimentalShowSelectedHint,
46307 ...otherProps
46308 };
46309}
46310function applyOptionDeprecations({
46311 __experimentalHint,
46312 ...rest
46313}) {
46314 return {
46315 hint: __experimentalHint,
46316 ...rest
46317 };
46318}
46319function getDescribedBy(currentValue, describedBy) {
46320 if (describedBy) {
46321 return describedBy;
46322 }
46323 return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Currently selected: %s"), currentValue);
46324}
46325function CustomSelectControl(props) {
46326 const {
46327 __next40pxDefaultSize = false,
46328 __shouldNotWarnDeprecated36pxSize,
46329 describedBy,
46330 options,
46331 onChange,
46332 size = "default",
46333 value,
46334 className: classNameProp,
46335 showSelectedHint = false,
46336 ...restProps
46337 } = custom_select_control_useDeprecatedProps(props);
46338 maybeWarnDeprecated36pxSize({
46339 componentName: "CustomSelectControl",
46340 __next40pxDefaultSize,
46341 size,
46342 __shouldNotWarnDeprecated36pxSize
46343 });
46344 const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(CustomSelectControl, "custom-select-control__description");
46345 const store = useSelectStore({
46346 async setValue(nextValue) {
46347 const nextOption = options.find((item) => item.name === nextValue);
46348 if (!onChange || !nextOption) {
46349 return;
46350 }
46351 await Promise.resolve();
46352 const state = store.getState();
46353 const changeObject = {
46354 highlightedIndex: state.renderedItems.findIndex((item) => item.value === nextValue),
46355 inputValue: "",
46356 isOpen: state.open,
46357 selectedItem: nextOption,
46358 type: ""
46359 };
46360 onChange(changeObject);
46361 },
46362 value: value?.name,
46363 // Setting the first option as a default value when no value is provided
46364 // is already done natively by the underlying Ariakit component,
46365 // but doing this explicitly avoids the `onChange` callback from firing
46366 // on initial render, thus making this implementation closer to the v1.
46367 defaultValue: options[0]?.name
46368 });
46369 const children = options.map(applyOptionDeprecations).map(({
46370 name,
46371 key,
46372 hint,
46373 style,
46374 className
46375 }) => {
46376 const withHint = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithHintItemWrapper, {
46377 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
46378 children: name
46379 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WithHintItemHint, {
46380 // Keeping the classname for legacy reasons
46381 className: "components-custom-select-control__item-hint",
46382 children: hint
46383 })]
46384 });
46385 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_default, {
46386 value: name,
46387 children: hint ? withHint : name,
46388 style,
46389 className: dist_clsx(
46390 className,
46391 // Keeping the classnames for legacy reasons
46392 "components-custom-select-control__item",
46393 {
46394 "has-hint": hint
46395 }
46396 )
46397 }, key);
46398 });
46399 const currentValue = useStoreState(store, "value");
46400 const renderSelectedValueHint = () => {
46401 const selectedOptionHint = options?.map(applyOptionDeprecations)?.find(({
46402 name
46403 }) => currentValue === name)?.hint;
46404 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(SelectedExperimentalHintWrapper, {
46405 children: [currentValue, selectedOptionHint && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectedExperimentalHintItem, {
46406 // Keeping the classname for legacy reasons
46407 className: "components-custom-select-control__hint",
46408 children: selectedOptionHint
46409 })]
46410 });
46411 };
46412 const translatedSize = (() => {
46413 if (__next40pxDefaultSize && size === "default" || size === "__unstable-large") {
46414 return "default";
46415 }
46416 if (!__next40pxDefaultSize && size === "default") {
46417 return "compact";
46418 }
46419 return size;
46420 })();
46421 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
46422 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(custom_select_default, {
46423 "aria-describedby": descriptionId,
46424 renderSelectedValue: showSelectedHint ? renderSelectedValueHint : void 0,
46425 size: translatedSize,
46426 store,
46427 className: dist_clsx(
46428 // Keeping the classname for legacy reasons
46429 "components-custom-select-control",
46430 classNameProp
46431 ),
46432 isLegacy: true,
46433 ...restProps,
46434 children
46435 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
46436 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
46437 id: descriptionId,
46438 children: getDescribedBy(currentValue, describedBy)
46439 })
46440 })]
46441 });
46442}
46443var custom_select_control_default = CustomSelectControl;
46444
46445
46446;// ./node_modules/date-fns/toDate.mjs
46447/**
46448 * @name toDate
46449 * @category Common Helpers
46450 * @summary Convert the given argument to an instance of Date.
46451 *
46452 * @description
46453 * Convert the given argument to an instance of Date.
46454 *
46455 * If the argument is an instance of Date, the function returns its clone.
46456 *
46457 * If the argument is a number, it is treated as a timestamp.
46458 *
46459 * If the argument is none of the above, the function returns Invalid Date.
46460 *
46461 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
46462 *
46463 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
46464 *
46465 * @param argument - The value to convert
46466 *
46467 * @returns The parsed date in the local time zone
46468 *
46469 * @example
46470 * // Clone the date:
46471 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
46472 * //=> Tue Feb 11 2014 11:30:30
46473 *
46474 * @example
46475 * // Convert the timestamp to date:
46476 * const result = toDate(1392098430000)
46477 * //=> Tue Feb 11 2014 11:30:30
46478 */
46479function toDate(argument) {
46480 const argStr = Object.prototype.toString.call(argument);
46481
46482 // Clone the date
46483 if (
46484 argument instanceof Date ||
46485 (typeof argument === "object" && argStr === "[object Date]")
46486 ) {
46487 // Prevent the date to lose the milliseconds when passed to new Date() in IE10
46488 return new argument.constructor(+argument);
46489 } else if (
46490 typeof argument === "number" ||
46491 argStr === "[object Number]" ||
46492 typeof argument === "string" ||
46493 argStr === "[object String]"
46494 ) {
46495 // TODO: Can we get rid of as?
46496 return new Date(argument);
46497 } else {
46498 // TODO: Can we get rid of as?
46499 return new Date(NaN);
46500 }
46501}
46502
46503// Fallback for modularized imports:
46504/* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
46505
46506;// ./node_modules/date-fns/startOfDay.mjs
46507
46508
46509/**
46510 * @name startOfDay
46511 * @category Day Helpers
46512 * @summary Return the start of a day for the given date.
46513 *
46514 * @description
46515 * Return the start of a day for the given date.
46516 * The result will be in the local timezone.
46517 *
46518 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
46519 *
46520 * @param date - The original date
46521 *
46522 * @returns The start of a day
46523 *
46524 * @example
46525 * // The start of a day for 2 September 2014 11:55:00:
46526 * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
46527 * //=> Tue Sep 02 2014 00:00:00
46528 */
46529function startOfDay(date) {
46530 const _date = toDate(date);
46531 _date.setHours(0, 0, 0, 0);
46532 return _date;
46533}
46534
46535// Fallback for modularized imports:
46536/* harmony default export */ const date_fns_startOfDay = ((/* unused pure expression or super */ null && (startOfDay)));
46537
46538;// ./node_modules/date-fns/constructFrom.mjs
46539/**
46540 * @name constructFrom
46541 * @category Generic Helpers
46542 * @summary Constructs a date using the reference date and the value
46543 *
46544 * @description
46545 * The function constructs a new date using the constructor from the reference
46546 * date and the given value. It helps to build generic functions that accept
46547 * date extensions.
46548 *
46549 * It defaults to `Date` if the passed reference date is a number or a string.
46550 *
46551 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
46552 *
46553 * @param date - The reference date to take constructor from
46554 * @param value - The value to create the date
46555 *
46556 * @returns Date initialized using the given date and value
46557 *
46558 * @example
46559 * import { constructFrom } from 'date-fns'
46560 *
46561 * // A function that clones a date preserving the original type
46562 * function cloneDate<DateType extends Date(date: DateType): DateType {
46563 * return constructFrom(
46564 * date, // Use contrustor from the given date
46565 * date.getTime() // Use the date value to create a new date
46566 * )
46567 * }
46568 */
46569function constructFrom(date, value) {
46570 if (date instanceof Date) {
46571 return new date.constructor(value);
46572 } else {
46573 return new Date(value);
46574 }
46575}
46576
46577// Fallback for modularized imports:
46578/* harmony default export */ const date_fns_constructFrom = ((/* unused pure expression or super */ null && (constructFrom)));
46579
46580;// ./node_modules/date-fns/addMonths.mjs
46581
46582
46583
46584/**
46585 * @name addMonths
46586 * @category Month Helpers
46587 * @summary Add the specified number of months to the given date.
46588 *
46589 * @description
46590 * Add the specified number of months to the given date.
46591 *
46592 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
46593 *
46594 * @param date - The date to be changed
46595 * @param amount - The amount of months to be added.
46596 *
46597 * @returns The new date with the months added
46598 *
46599 * @example
46600 * // Add 5 months to 1 September 2014:
46601 * const result = addMonths(new Date(2014, 8, 1), 5)
46602 * //=> Sun Feb 01 2015 00:00:00
46603 *
46604 * // Add one month to 30 January 2023:
46605 * const result = addMonths(new Date(2023, 0, 30), 1)
46606 * //=> Tue Feb 28 2023 00:00:00
46607 */
46608function addMonths(date, amount) {
46609 const _date = toDate(date);
46610 if (isNaN(amount)) return constructFrom(date, NaN);
46611 if (!amount) {
46612 // If 0 months, no-op to avoid changing times in the hour before end of DST
46613 return _date;
46614 }
46615 const dayOfMonth = _date.getDate();
46616
46617 // The JS Date object supports date math by accepting out-of-bounds values for
46618 // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
46619 // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
46620 // want except that dates will wrap around the end of a month, meaning that
46621 // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
46622 // we'll default to the end of the desired month by adding 1 to the desired
46623 // month and using a date of 0 to back up one day to the end of the desired
46624 // month.
46625 const endOfDesiredMonth = constructFrom(date, _date.getTime());
46626 endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
46627 const daysInMonth = endOfDesiredMonth.getDate();
46628 if (dayOfMonth >= daysInMonth) {
46629 // If we're already at the end of the month, then this is the correct date
46630 // and we're done.
46631 return endOfDesiredMonth;
46632 } else {
46633 // Otherwise, we now know that setting the original day-of-month value won't
46634 // cause an overflow, so set the desired day-of-month. Note that we can't
46635 // just set the date of `endOfDesiredMonth` because that object may have had
46636 // its time changed in the unusual case where where a DST transition was on
46637 // the last day of the month and its local time was in the hour skipped or
46638 // repeated next to a DST transition. So we use `date` instead which is
46639 // guaranteed to still have the original time.
46640 _date.setFullYear(
46641 endOfDesiredMonth.getFullYear(),
46642 endOfDesiredMonth.getMonth(),
46643 dayOfMonth,
46644 );
46645 return _date;
46646 }
46647}
46648
46649// Fallback for modularized imports:
46650/* harmony default export */ const date_fns_addMonths = ((/* unused pure expression or super */ null && (addMonths)));
46651
46652;// ./node_modules/date-fns/subMonths.mjs
46653
46654
46655/**
46656 * @name subMonths
46657 * @category Month Helpers
46658 * @summary Subtract the specified number of months from the given date.
46659 *
46660 * @description
46661 * Subtract the specified number of months from the given date.
46662 *
46663 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
46664 *
46665 * @param date - The date to be changed
46666 * @param amount - The amount of months to be subtracted.
46667 *
46668 * @returns The new date with the months subtracted
46669 *
46670 * @example
46671 * // Subtract 5 months from 1 February 2015:
46672 * const result = subMonths(new Date(2015, 1, 1), 5)
46673 * //=> Mon Sep 01 2014 00:00:00
46674 */
46675function subMonths(date, amount) {
46676 return addMonths(date, -amount);
46677}
46678
46679// Fallback for modularized imports:
46680/* harmony default export */ const date_fns_subMonths = ((/* unused pure expression or super */ null && (subMonths)));
46681
46682;// ./node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs
46683const formatDistanceLocale = {
46684 lessThanXSeconds: {
46685 one: "less than a second",
46686 other: "less than {{count}} seconds",
46687 },
46688
46689 xSeconds: {
46690 one: "1 second",
46691 other: "{{count}} seconds",
46692 },
46693
46694 halfAMinute: "half a minute",
46695
46696 lessThanXMinutes: {
46697 one: "less than a minute",
46698 other: "less than {{count}} minutes",
46699 },
46700
46701 xMinutes: {
46702 one: "1 minute",
46703 other: "{{count}} minutes",
46704 },
46705
46706 aboutXHours: {
46707 one: "about 1 hour",
46708 other: "about {{count}} hours",
46709 },
46710
46711 xHours: {
46712 one: "1 hour",
46713 other: "{{count}} hours",
46714 },
46715
46716 xDays: {
46717 one: "1 day",
46718 other: "{{count}} days",
46719 },
46720
46721 aboutXWeeks: {
46722 one: "about 1 week",
46723 other: "about {{count}} weeks",
46724 },
46725
46726 xWeeks: {
46727 one: "1 week",
46728 other: "{{count}} weeks",
46729 },
46730
46731 aboutXMonths: {
46732 one: "about 1 month",
46733 other: "about {{count}} months",
46734 },
46735
46736 xMonths: {
46737 one: "1 month",
46738 other: "{{count}} months",
46739 },
46740
46741 aboutXYears: {
46742 one: "about 1 year",
46743 other: "about {{count}} years",
46744 },
46745
46746 xYears: {
46747 one: "1 year",
46748 other: "{{count}} years",
46749 },
46750
46751 overXYears: {
46752 one: "over 1 year",
46753 other: "over {{count}} years",
46754 },
46755
46756 almostXYears: {
46757 one: "almost 1 year",
46758 other: "almost {{count}} years",
46759 },
46760};
46761
46762const formatDistance = (token, count, options) => {
46763 let result;
46764
46765 const tokenValue = formatDistanceLocale[token];
46766 if (typeof tokenValue === "string") {
46767 result = tokenValue;
46768 } else if (count === 1) {
46769 result = tokenValue.one;
46770 } else {
46771 result = tokenValue.other.replace("{{count}}", count.toString());
46772 }
46773
46774 if (options?.addSuffix) {
46775 if (options.comparison && options.comparison > 0) {
46776 return "in " + result;
46777 } else {
46778 return result + " ago";
46779 }
46780 }
46781
46782 return result;
46783};
46784
46785;// ./node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs
46786function buildFormatLongFn(args) {
46787 return (options = {}) => {
46788 // TODO: Remove String()
46789 const width = options.width ? String(options.width) : args.defaultWidth;
46790 const format = args.formats[width] || args.formats[args.defaultWidth];
46791 return format;
46792 };
46793}
46794
46795;// ./node_modules/date-fns/locale/en-US/_lib/formatLong.mjs
46796
46797
46798const dateFormats = {
46799 full: "EEEE, MMMM do, y",
46800 long: "MMMM do, y",
46801 medium: "MMM d, y",
46802 short: "MM/dd/yyyy",
46803};
46804
46805const timeFormats = {
46806 full: "h:mm:ss a zzzz",
46807 long: "h:mm:ss a z",
46808 medium: "h:mm:ss a",
46809 short: "h:mm a",
46810};
46811
46812const dateTimeFormats = {
46813 full: "{{date}} 'at' {{time}}",
46814 long: "{{date}} 'at' {{time}}",
46815 medium: "{{date}}, {{time}}",
46816 short: "{{date}}, {{time}}",
46817};
46818
46819const formatLong = {
46820 date: buildFormatLongFn({
46821 formats: dateFormats,
46822 defaultWidth: "full",
46823 }),
46824
46825 time: buildFormatLongFn({
46826 formats: timeFormats,
46827 defaultWidth: "full",
46828 }),
46829
46830 dateTime: buildFormatLongFn({
46831 formats: dateTimeFormats,
46832 defaultWidth: "full",
46833 }),
46834};
46835
46836;// ./node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs
46837const formatRelativeLocale = {
46838 lastWeek: "'last' eeee 'at' p",
46839 yesterday: "'yesterday at' p",
46840 today: "'today at' p",
46841 tomorrow: "'tomorrow at' p",
46842 nextWeek: "eeee 'at' p",
46843 other: "P",
46844};
46845
46846const formatRelative = (token, _date, _baseDate, _options) =>
46847 formatRelativeLocale[token];
46848
46849;// ./node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs
46850/* eslint-disable no-unused-vars */
46851
46852/**
46853 * The localize function argument callback which allows to convert raw value to
46854 * the actual type.
46855 *
46856 * @param value - The value to convert
46857 *
46858 * @returns The converted value
46859 */
46860
46861/**
46862 * The map of localized values for each width.
46863 */
46864
46865/**
46866 * The index type of the locale unit value. It types conversion of units of
46867 * values that don't start at 0 (i.e. quarters).
46868 */
46869
46870/**
46871 * Converts the unit value to the tuple of values.
46872 */
46873
46874/**
46875 * The tuple of localized era values. The first element represents BC,
46876 * the second element represents AD.
46877 */
46878
46879/**
46880 * The tuple of localized quarter values. The first element represents Q1.
46881 */
46882
46883/**
46884 * The tuple of localized day values. The first element represents Sunday.
46885 */
46886
46887/**
46888 * The tuple of localized month values. The first element represents January.
46889 */
46890
46891function buildLocalizeFn(args) {
46892 return (value, options) => {
46893 const context = options?.context ? String(options.context) : "standalone";
46894
46895 let valuesArray;
46896 if (context === "formatting" && args.formattingValues) {
46897 const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
46898 const width = options?.width ? String(options.width) : defaultWidth;
46899
46900 valuesArray =
46901 args.formattingValues[width] || args.formattingValues[defaultWidth];
46902 } else {
46903 const defaultWidth = args.defaultWidth;
46904 const width = options?.width ? String(options.width) : args.defaultWidth;
46905
46906 valuesArray = args.values[width] || args.values[defaultWidth];
46907 }
46908 const index = args.argumentCallback ? args.argumentCallback(value) : value;
46909
46910 // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
46911 return valuesArray[index];
46912 };
46913}
46914
46915;// ./node_modules/date-fns/locale/en-US/_lib/localize.mjs
46916
46917
46918const eraValues = {
46919 narrow: ["B", "A"],
46920 abbreviated: ["BC", "AD"],
46921 wide: ["Before Christ", "Anno Domini"],
46922};
46923
46924const quarterValues = {
46925 narrow: ["1", "2", "3", "4"],
46926 abbreviated: ["Q1", "Q2", "Q3", "Q4"],
46927 wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
46928};
46929
46930// Note: in English, the names of days of the week and months are capitalized.
46931// If you are making a new locale based on this one, check if the same is true for the language you're working on.
46932// Generally, formatted dates should look like they are in the middle of a sentence,
46933// e.g. in Spanish language the weekdays and months should be in the lowercase.
46934const monthValues = {
46935 narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
46936 abbreviated: [
46937 "Jan",
46938 "Feb",
46939 "Mar",
46940 "Apr",
46941 "May",
46942 "Jun",
46943 "Jul",
46944 "Aug",
46945 "Sep",
46946 "Oct",
46947 "Nov",
46948 "Dec",
46949 ],
46950
46951 wide: [
46952 "January",
46953 "February",
46954 "March",
46955 "April",
46956 "May",
46957 "June",
46958 "July",
46959 "August",
46960 "September",
46961 "October",
46962 "November",
46963 "December",
46964 ],
46965};
46966
46967const dayValues = {
46968 narrow: ["S", "M", "T", "W", "T", "F", "S"],
46969 short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
46970 abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
46971 wide: [
46972 "Sunday",
46973 "Monday",
46974 "Tuesday",
46975 "Wednesday",
46976 "Thursday",
46977 "Friday",
46978 "Saturday",
46979 ],
46980};
46981
46982const dayPeriodValues = {
46983 narrow: {
46984 am: "a",
46985 pm: "p",
46986 midnight: "mi",
46987 noon: "n",
46988 morning: "morning",
46989 afternoon: "afternoon",
46990 evening: "evening",
46991 night: "night",
46992 },
46993 abbreviated: {
46994 am: "AM",
46995 pm: "PM",
46996 midnight: "midnight",
46997 noon: "noon",
46998 morning: "morning",
46999 afternoon: "afternoon",
47000 evening: "evening",
47001 night: "night",
47002 },
47003 wide: {
47004 am: "a.m.",
47005 pm: "p.m.",
47006 midnight: "midnight",
47007 noon: "noon",
47008 morning: "morning",
47009 afternoon: "afternoon",
47010 evening: "evening",
47011 night: "night",
47012 },
47013};
47014
47015const formattingDayPeriodValues = {
47016 narrow: {
47017 am: "a",
47018 pm: "p",
47019 midnight: "mi",
47020 noon: "n",
47021 morning: "in the morning",
47022 afternoon: "in the afternoon",
47023 evening: "in the evening",
47024 night: "at night",
47025 },
47026 abbreviated: {
47027 am: "AM",
47028 pm: "PM",
47029 midnight: "midnight",
47030 noon: "noon",
47031 morning: "in the morning",
47032 afternoon: "in the afternoon",
47033 evening: "in the evening",
47034 night: "at night",
47035 },
47036 wide: {
47037 am: "a.m.",
47038 pm: "p.m.",
47039 midnight: "midnight",
47040 noon: "noon",
47041 morning: "in the morning",
47042 afternoon: "in the afternoon",
47043 evening: "in the evening",
47044 night: "at night",
47045 },
47046};
47047
47048const ordinalNumber = (dirtyNumber, _options) => {
47049 const number = Number(dirtyNumber);
47050
47051 // If ordinal numbers depend on context, for example,
47052 // if they are different for different grammatical genders,
47053 // use `options.unit`.
47054 //
47055 // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
47056 // 'day', 'hour', 'minute', 'second'.
47057
47058 const rem100 = number % 100;
47059 if (rem100 > 20 || rem100 < 10) {
47060 switch (rem100 % 10) {
47061 case 1:
47062 return number + "st";
47063 case 2:
47064 return number + "nd";
47065 case 3:
47066 return number + "rd";
47067 }
47068 }
47069 return number + "th";
47070};
47071
47072const localize = {
47073 ordinalNumber,
47074
47075 era: buildLocalizeFn({
47076 values: eraValues,
47077 defaultWidth: "wide",
47078 }),
47079
47080 quarter: buildLocalizeFn({
47081 values: quarterValues,
47082 defaultWidth: "wide",
47083 argumentCallback: (quarter) => quarter - 1,
47084 }),
47085
47086 month: buildLocalizeFn({
47087 values: monthValues,
47088 defaultWidth: "wide",
47089 }),
47090
47091 day: buildLocalizeFn({
47092 values: dayValues,
47093 defaultWidth: "wide",
47094 }),
47095
47096 dayPeriod: buildLocalizeFn({
47097 values: dayPeriodValues,
47098 defaultWidth: "wide",
47099 formattingValues: formattingDayPeriodValues,
47100 defaultFormattingWidth: "wide",
47101 }),
47102};
47103
47104;// ./node_modules/date-fns/locale/_lib/buildMatchFn.mjs
47105function buildMatchFn(args) {
47106 return (string, options = {}) => {
47107 const width = options.width;
47108
47109 const matchPattern =
47110 (width && args.matchPatterns[width]) ||
47111 args.matchPatterns[args.defaultMatchWidth];
47112 const matchResult = string.match(matchPattern);
47113
47114 if (!matchResult) {
47115 return null;
47116 }
47117 const matchedString = matchResult[0];
47118
47119 const parsePatterns =
47120 (width && args.parsePatterns[width]) ||
47121 args.parsePatterns[args.defaultParseWidth];
47122
47123 const key = Array.isArray(parsePatterns)
47124 ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
47125 : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
47126 findKey(parsePatterns, (pattern) => pattern.test(matchedString));
47127
47128 let value;
47129
47130 value = args.valueCallback ? args.valueCallback(key) : key;
47131 value = options.valueCallback
47132 ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
47133 options.valueCallback(value)
47134 : value;
47135
47136 const rest = string.slice(matchedString.length);
47137
47138 return { value, rest };
47139 };
47140}
47141
47142function findKey(object, predicate) {
47143 for (const key in object) {
47144 if (
47145 Object.prototype.hasOwnProperty.call(object, key) &&
47146 predicate(object[key])
47147 ) {
47148 return key;
47149 }
47150 }
47151 return undefined;
47152}
47153
47154function findIndex(array, predicate) {
47155 for (let key = 0; key < array.length; key++) {
47156 if (predicate(array[key])) {
47157 return key;
47158 }
47159 }
47160 return undefined;
47161}
47162
47163;// ./node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs
47164function buildMatchPatternFn(args) {
47165 return (string, options = {}) => {
47166 const matchResult = string.match(args.matchPattern);
47167 if (!matchResult) return null;
47168 const matchedString = matchResult[0];
47169
47170 const parseResult = string.match(args.parsePattern);
47171 if (!parseResult) return null;
47172 let value = args.valueCallback
47173 ? args.valueCallback(parseResult[0])
47174 : parseResult[0];
47175
47176 // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
47177 value = options.valueCallback ? options.valueCallback(value) : value;
47178
47179 const rest = string.slice(matchedString.length);
47180
47181 return { value, rest };
47182 };
47183}
47184
47185;// ./node_modules/date-fns/locale/en-US/_lib/match.mjs
47186
47187
47188
47189const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
47190const parseOrdinalNumberPattern = /\d+/i;
47191
47192const matchEraPatterns = {
47193 narrow: /^(b|a)/i,
47194 abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
47195 wide: /^(before christ|before common era|anno domini|common era)/i,
47196};
47197const parseEraPatterns = {
47198 any: [/^b/i, /^(a|c)/i],
47199};
47200
47201const matchQuarterPatterns = {
47202 narrow: /^[1234]/i,
47203 abbreviated: /^q[1234]/i,
47204 wide: /^[1234](th|st|nd|rd)? quarter/i,
47205};
47206const parseQuarterPatterns = {
47207 any: [/1/i, /2/i, /3/i, /4/i],
47208};
47209
47210const matchMonthPatterns = {
47211 narrow: /^[jfmasond]/i,
47212 abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
47213 wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
47214};
47215const parseMonthPatterns = {
47216 narrow: [
47217 /^j/i,
47218 /^f/i,
47219 /^m/i,
47220 /^a/i,
47221 /^m/i,
47222 /^j/i,
47223 /^j/i,
47224 /^a/i,
47225 /^s/i,
47226 /^o/i,
47227 /^n/i,
47228 /^d/i,
47229 ],
47230
47231 any: [
47232 /^ja/i,
47233 /^f/i,
47234 /^mar/i,
47235 /^ap/i,
47236 /^may/i,
47237 /^jun/i,
47238 /^jul/i,
47239 /^au/i,
47240 /^s/i,
47241 /^o/i,
47242 /^n/i,
47243 /^d/i,
47244 ],
47245};
47246
47247const matchDayPatterns = {
47248 narrow: /^[smtwf]/i,
47249 short: /^(su|mo|tu|we|th|fr|sa)/i,
47250 abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
47251 wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
47252};
47253const parseDayPatterns = {
47254 narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
47255 any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
47256};
47257
47258const matchDayPeriodPatterns = {
47259 narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
47260 any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
47261};
47262const parseDayPeriodPatterns = {
47263 any: {
47264 am: /^a/i,
47265 pm: /^p/i,
47266 midnight: /^mi/i,
47267 noon: /^no/i,
47268 morning: /morning/i,
47269 afternoon: /afternoon/i,
47270 evening: /evening/i,
47271 night: /night/i,
47272 },
47273};
47274
47275const match_match = {
47276 ordinalNumber: buildMatchPatternFn({
47277 matchPattern: matchOrdinalNumberPattern,
47278 parsePattern: parseOrdinalNumberPattern,
47279 valueCallback: (value) => parseInt(value, 10),
47280 }),
47281
47282 era: buildMatchFn({
47283 matchPatterns: matchEraPatterns,
47284 defaultMatchWidth: "wide",
47285 parsePatterns: parseEraPatterns,
47286 defaultParseWidth: "any",
47287 }),
47288
47289 quarter: buildMatchFn({
47290 matchPatterns: matchQuarterPatterns,
47291 defaultMatchWidth: "wide",
47292 parsePatterns: parseQuarterPatterns,
47293 defaultParseWidth: "any",
47294 valueCallback: (index) => index + 1,
47295 }),
47296
47297 month: buildMatchFn({
47298 matchPatterns: matchMonthPatterns,
47299 defaultMatchWidth: "wide",
47300 parsePatterns: parseMonthPatterns,
47301 defaultParseWidth: "any",
47302 }),
47303
47304 day: buildMatchFn({
47305 matchPatterns: matchDayPatterns,
47306 defaultMatchWidth: "wide",
47307 parsePatterns: parseDayPatterns,
47308 defaultParseWidth: "any",
47309 }),
47310
47311 dayPeriod: buildMatchFn({
47312 matchPatterns: matchDayPeriodPatterns,
47313 defaultMatchWidth: "any",
47314 parsePatterns: parseDayPeriodPatterns,
47315 defaultParseWidth: "any",
47316 }),
47317};
47318
47319;// ./node_modules/date-fns/locale/en-US.mjs
47320
47321
47322
47323
47324
47325
47326/**
47327 * @category Locales
47328 * @summary English locale (United States).
47329 * @language English
47330 * @iso-639-2 eng
47331 * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
47332 * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
47333 */
47334const enUS = {
47335 code: "en-US",
47336 formatDistance: formatDistance,
47337 formatLong: formatLong,
47338 formatRelative: formatRelative,
47339 localize: localize,
47340 match: match_match,
47341 options: {
47342 weekStartsOn: 0 /* Sunday */,
47343 firstWeekContainsDate: 1,
47344 },
47345};
47346
47347// Fallback for modularized imports:
47348/* harmony default export */ const en_US = ((/* unused pure expression or super */ null && (enUS)));
47349
47350;// ./node_modules/date-fns/_lib/defaultOptions.mjs
47351let defaultOptions_defaultOptions = {};
47352
47353function getDefaultOptions() {
47354 return defaultOptions_defaultOptions;
47355}
47356
47357function setDefaultOptions(newOptions) {
47358 defaultOptions_defaultOptions = newOptions;
47359}
47360
47361;// ./node_modules/date-fns/constants.mjs
47362/**
47363 * @module constants
47364 * @summary Useful constants
47365 * @description
47366 * Collection of useful date constants.
47367 *
47368 * The constants could be imported from `date-fns/constants`:
47369 *
47370 * ```ts
47371 * import { maxTime, minTime } from "./constants/date-fns/constants";
47372 *
47373 * function isAllowedTime(time) {
47374 * return time <= maxTime && time >= minTime;
47375 * }
47376 * ```
47377 */
47378
47379/**
47380 * @constant
47381 * @name daysInWeek
47382 * @summary Days in 1 week.
47383 */
47384const daysInWeek = 7;
47385
47386/**
47387 * @constant
47388 * @name daysInYear
47389 * @summary Days in 1 year.
47390 *
47391 * @description
47392 * How many days in a year.
47393 *
47394 * One years equals 365.2425 days according to the formula:
47395 *
47396 * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
47397 * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
47398 */
47399const daysInYear = 365.2425;
47400
47401/**
47402 * @constant
47403 * @name maxTime
47404 * @summary Maximum allowed time.
47405 *
47406 * @example
47407 * import { maxTime } from "./constants/date-fns/constants";
47408 *
47409 * const isValid = 8640000000000001 <= maxTime;
47410 * //=> false
47411 *
47412 * new Date(8640000000000001);
47413 * //=> Invalid Date
47414 */
47415const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
47416
47417/**
47418 * @constant
47419 * @name minTime
47420 * @summary Minimum allowed time.
47421 *
47422 * @example
47423 * import { minTime } from "./constants/date-fns/constants";
47424 *
47425 * const isValid = -8640000000000001 >= minTime;
47426 * //=> false
47427 *
47428 * new Date(-8640000000000001)
47429 * //=> Invalid Date
47430 */
47431const minTime = -maxTime;
47432
47433/**
47434 * @constant
47435 * @name millisecondsInWeek
47436 * @summary Milliseconds in 1 week.
47437 */
47438const millisecondsInWeek = 604800000;
47439
47440/**
47441 * @constant
47442 * @name millisecondsInDay
47443 * @summary Milliseconds in 1 day.
47444 */
47445const millisecondsInDay = 86400000;
47446
47447/**
47448 * @constant
47449 * @name millisecondsInMinute
47450 * @summary Milliseconds in 1 minute
47451 */
47452const millisecondsInMinute = 60000;
47453
47454/**
47455 * @constant
47456 * @name millisecondsInHour
47457 * @summary Milliseconds in 1 hour
47458 */
47459const millisecondsInHour = 3600000;
47460
47461/**
47462 * @constant
47463 * @name millisecondsInSecond
47464 * @summary Milliseconds in 1 second
47465 */
47466const millisecondsInSecond = 1000;
47467
47468/**
47469 * @constant
47470 * @name minutesInYear
47471 * @summary Minutes in 1 year.
47472 */
47473const minutesInYear = 525600;
47474
47475/**
47476 * @constant
47477 * @name minutesInMonth
47478 * @summary Minutes in 1 month.
47479 */
47480const minutesInMonth = 43200;
47481
47482/**
47483 * @constant
47484 * @name minutesInDay
47485 * @summary Minutes in 1 day.
47486 */
47487const minutesInDay = 1440;
47488
47489/**
47490 * @constant
47491 * @name minutesInHour
47492 * @summary Minutes in 1 hour.
47493 */
47494const minutesInHour = 60;
47495
47496/**
47497 * @constant
47498 * @name monthsInQuarter
47499 * @summary Months in 1 quarter.
47500 */
47501const monthsInQuarter = 3;
47502
47503/**
47504 * @constant
47505 * @name monthsInYear
47506 * @summary Months in 1 year.
47507 */
47508const monthsInYear = 12;
47509
47510/**
47511 * @constant
47512 * @name quartersInYear
47513 * @summary Quarters in 1 year
47514 */
47515const quartersInYear = 4;
47516
47517/**
47518 * @constant
47519 * @name secondsInHour
47520 * @summary Seconds in 1 hour.
47521 */
47522const secondsInHour = 3600;
47523
47524/**
47525 * @constant
47526 * @name secondsInMinute
47527 * @summary Seconds in 1 minute.
47528 */
47529const secondsInMinute = 60;
47530
47531/**
47532 * @constant
47533 * @name secondsInDay
47534 * @summary Seconds in 1 day.
47535 */
47536const secondsInDay = secondsInHour * 24;
47537
47538/**
47539 * @constant
47540 * @name secondsInWeek
47541 * @summary Seconds in 1 week.
47542 */
47543const secondsInWeek = secondsInDay * 7;
47544
47545/**
47546 * @constant
47547 * @name secondsInYear
47548 * @summary Seconds in 1 year.
47549 */
47550const secondsInYear = secondsInDay * daysInYear;
47551
47552/**
47553 * @constant
47554 * @name secondsInMonth
47555 * @summary Seconds in 1 month
47556 */
47557const secondsInMonth = secondsInYear / 12;
47558
47559/**
47560 * @constant
47561 * @name secondsInQuarter
47562 * @summary Seconds in 1 quarter.
47563 */
47564const secondsInQuarter = secondsInMonth * 3;
47565
47566;// ./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs
47567
47568
47569/**
47570 * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
47571 * They usually appear for dates that denote time before the timezones were introduced
47572 * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
47573 * and GMT+01:00:00 after that date)
47574 *
47575 * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
47576 * which would lead to incorrect calculations.
47577 *
47578 * This function returns the timezone offset in milliseconds that takes seconds in account.
47579 */
47580function getTimezoneOffsetInMilliseconds(date) {
47581 const _date = toDate(date);
47582 const utcDate = new Date(
47583 Date.UTC(
47584 _date.getFullYear(),
47585 _date.getMonth(),
47586 _date.getDate(),
47587 _date.getHours(),
47588 _date.getMinutes(),
47589 _date.getSeconds(),
47590 _date.getMilliseconds(),
47591 ),
47592 );
47593 utcDate.setUTCFullYear(_date.getFullYear());
47594 return +date - +utcDate;
47595}
47596
47597;// ./node_modules/date-fns/differenceInCalendarDays.mjs
47598
47599
47600
47601
47602/**
47603 * @name differenceInCalendarDays
47604 * @category Day Helpers
47605 * @summary Get the number of calendar days between the given dates.
47606 *
47607 * @description
47608 * Get the number of calendar days between the given dates. This means that the times are removed
47609 * from the dates and then the difference in days is calculated.
47610 *
47611 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47612 *
47613 * @param dateLeft - The later date
47614 * @param dateRight - The earlier date
47615 *
47616 * @returns The number of calendar days
47617 *
47618 * @example
47619 * // How many calendar days are between
47620 * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
47621 * const result = differenceInCalendarDays(
47622 * new Date(2012, 6, 2, 0, 0),
47623 * new Date(2011, 6, 2, 23, 0)
47624 * )
47625 * //=> 366
47626 * // How many calendar days are between
47627 * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
47628 * const result = differenceInCalendarDays(
47629 * new Date(2011, 6, 3, 0, 1),
47630 * new Date(2011, 6, 2, 23, 59)
47631 * )
47632 * //=> 1
47633 */
47634function differenceInCalendarDays(dateLeft, dateRight) {
47635 const startOfDayLeft = startOfDay(dateLeft);
47636 const startOfDayRight = startOfDay(dateRight);
47637
47638 const timestampLeft =
47639 +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
47640 const timestampRight =
47641 +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
47642
47643 // Round the number of days to the nearest integer because the number of
47644 // milliseconds in a day is not constant (e.g. it's different in the week of
47645 // the daylight saving time clock shift).
47646 return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
47647}
47648
47649// Fallback for modularized imports:
47650/* harmony default export */ const date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays)));
47651
47652;// ./node_modules/date-fns/startOfYear.mjs
47653
47654
47655
47656/**
47657 * @name startOfYear
47658 * @category Year Helpers
47659 * @summary Return the start of a year for the given date.
47660 *
47661 * @description
47662 * Return the start of a year for the given date.
47663 * The result will be in the local timezone.
47664 *
47665 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47666 *
47667 * @param date - The original date
47668 *
47669 * @returns The start of a year
47670 *
47671 * @example
47672 * // The start of a year for 2 September 2014 11:55:00:
47673 * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
47674 * //=> Wed Jan 01 2014 00:00:00
47675 */
47676function startOfYear(date) {
47677 const cleanDate = toDate(date);
47678 const _date = constructFrom(date, 0);
47679 _date.setFullYear(cleanDate.getFullYear(), 0, 1);
47680 _date.setHours(0, 0, 0, 0);
47681 return _date;
47682}
47683
47684// Fallback for modularized imports:
47685/* harmony default export */ const date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear)));
47686
47687;// ./node_modules/date-fns/getDayOfYear.mjs
47688
47689
47690
47691
47692/**
47693 * @name getDayOfYear
47694 * @category Day Helpers
47695 * @summary Get the day of the year of the given date.
47696 *
47697 * @description
47698 * Get the day of the year of the given date.
47699 *
47700 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47701 *
47702 * @param date - The given date
47703 *
47704 * @returns The day of year
47705 *
47706 * @example
47707 * // Which day of the year is 2 July 2014?
47708 * const result = getDayOfYear(new Date(2014, 6, 2))
47709 * //=> 183
47710 */
47711function getDayOfYear(date) {
47712 const _date = toDate(date);
47713 const diff = differenceInCalendarDays(_date, startOfYear(_date));
47714 const dayOfYear = diff + 1;
47715 return dayOfYear;
47716}
47717
47718// Fallback for modularized imports:
47719/* harmony default export */ const date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear)));
47720
47721;// ./node_modules/date-fns/startOfWeek.mjs
47722
47723
47724
47725/**
47726 * The {@link startOfWeek} function options.
47727 */
47728
47729/**
47730 * @name startOfWeek
47731 * @category Week Helpers
47732 * @summary Return the start of a week for the given date.
47733 *
47734 * @description
47735 * Return the start of a week for the given date.
47736 * The result will be in the local timezone.
47737 *
47738 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47739 *
47740 * @param date - The original date
47741 * @param options - An object with options
47742 *
47743 * @returns The start of a week
47744 *
47745 * @example
47746 * // The start of a week for 2 September 2014 11:55:00:
47747 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
47748 * //=> Sun Aug 31 2014 00:00:00
47749 *
47750 * @example
47751 * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
47752 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
47753 * //=> Mon Sep 01 2014 00:00:00
47754 */
47755function startOfWeek(date, options) {
47756 const defaultOptions = getDefaultOptions();
47757 const weekStartsOn =
47758 options?.weekStartsOn ??
47759 options?.locale?.options?.weekStartsOn ??
47760 defaultOptions.weekStartsOn ??
47761 defaultOptions.locale?.options?.weekStartsOn ??
47762 0;
47763
47764 const _date = toDate(date);
47765 const day = _date.getDay();
47766 const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
47767
47768 _date.setDate(_date.getDate() - diff);
47769 _date.setHours(0, 0, 0, 0);
47770 return _date;
47771}
47772
47773// Fallback for modularized imports:
47774/* harmony default export */ const date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek)));
47775
47776;// ./node_modules/date-fns/startOfISOWeek.mjs
47777
47778
47779/**
47780 * @name startOfISOWeek
47781 * @category ISO Week Helpers
47782 * @summary Return the start of an ISO week for the given date.
47783 *
47784 * @description
47785 * Return the start of an ISO week for the given date.
47786 * The result will be in the local timezone.
47787 *
47788 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
47789 *
47790 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47791 *
47792 * @param date - The original date
47793 *
47794 * @returns The start of an ISO week
47795 *
47796 * @example
47797 * // The start of an ISO week for 2 September 2014 11:55:00:
47798 * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
47799 * //=> Mon Sep 01 2014 00:00:00
47800 */
47801function startOfISOWeek(date) {
47802 return startOfWeek(date, { weekStartsOn: 1 });
47803}
47804
47805// Fallback for modularized imports:
47806/* harmony default export */ const date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek)));
47807
47808;// ./node_modules/date-fns/getISOWeekYear.mjs
47809
47810
47811
47812
47813/**
47814 * @name getISOWeekYear
47815 * @category ISO Week-Numbering Year Helpers
47816 * @summary Get the ISO week-numbering year of the given date.
47817 *
47818 * @description
47819 * Get the ISO week-numbering year of the given date,
47820 * which always starts 3 days before the year's first Thursday.
47821 *
47822 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
47823 *
47824 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47825 *
47826 * @param date - The given date
47827 *
47828 * @returns The ISO week-numbering year
47829 *
47830 * @example
47831 * // Which ISO-week numbering year is 2 January 2005?
47832 * const result = getISOWeekYear(new Date(2005, 0, 2))
47833 * //=> 2004
47834 */
47835function getISOWeekYear(date) {
47836 const _date = toDate(date);
47837 const year = _date.getFullYear();
47838
47839 const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
47840 fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
47841 fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
47842 const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
47843
47844 const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
47845 fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
47846 fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
47847 const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
47848
47849 if (_date.getTime() >= startOfNextYear.getTime()) {
47850 return year + 1;
47851 } else if (_date.getTime() >= startOfThisYear.getTime()) {
47852 return year;
47853 } else {
47854 return year - 1;
47855 }
47856}
47857
47858// Fallback for modularized imports:
47859/* harmony default export */ const date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear)));
47860
47861;// ./node_modules/date-fns/startOfISOWeekYear.mjs
47862
47863
47864
47865
47866/**
47867 * @name startOfISOWeekYear
47868 * @category ISO Week-Numbering Year Helpers
47869 * @summary Return the start of an ISO week-numbering year for the given date.
47870 *
47871 * @description
47872 * Return the start of an ISO week-numbering year,
47873 * which always starts 3 days before the year's first Thursday.
47874 * The result will be in the local timezone.
47875 *
47876 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
47877 *
47878 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47879 *
47880 * @param date - The original date
47881 *
47882 * @returns The start of an ISO week-numbering year
47883 *
47884 * @example
47885 * // The start of an ISO week-numbering year for 2 July 2005:
47886 * const result = startOfISOWeekYear(new Date(2005, 6, 2))
47887 * //=> Mon Jan 03 2005 00:00:00
47888 */
47889function startOfISOWeekYear(date) {
47890 const year = getISOWeekYear(date);
47891 const fourthOfJanuary = constructFrom(date, 0);
47892 fourthOfJanuary.setFullYear(year, 0, 4);
47893 fourthOfJanuary.setHours(0, 0, 0, 0);
47894 return startOfISOWeek(fourthOfJanuary);
47895}
47896
47897// Fallback for modularized imports:
47898/* harmony default export */ const date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear)));
47899
47900;// ./node_modules/date-fns/getISOWeek.mjs
47901
47902
47903
47904
47905
47906/**
47907 * @name getISOWeek
47908 * @category ISO Week Helpers
47909 * @summary Get the ISO week of the given date.
47910 *
47911 * @description
47912 * Get the ISO week of the given date.
47913 *
47914 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
47915 *
47916 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47917 *
47918 * @param date - The given date
47919 *
47920 * @returns The ISO week
47921 *
47922 * @example
47923 * // Which week of the ISO-week numbering year is 2 January 2005?
47924 * const result = getISOWeek(new Date(2005, 0, 2))
47925 * //=> 53
47926 */
47927function getISOWeek(date) {
47928 const _date = toDate(date);
47929 const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
47930
47931 // Round the number of weeks to the nearest integer because the number of
47932 // milliseconds in a week is not constant (e.g. it's different in the week of
47933 // the daylight saving time clock shift).
47934 return Math.round(diff / millisecondsInWeek) + 1;
47935}
47936
47937// Fallback for modularized imports:
47938/* harmony default export */ const date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek)));
47939
47940;// ./node_modules/date-fns/getWeekYear.mjs
47941
47942
47943
47944
47945
47946/**
47947 * The {@link getWeekYear} function options.
47948 */
47949
47950/**
47951 * @name getWeekYear
47952 * @category Week-Numbering Year Helpers
47953 * @summary Get the local week-numbering year of the given date.
47954 *
47955 * @description
47956 * Get the local week-numbering year of the given date.
47957 * The exact calculation depends on the values of
47958 * `options.weekStartsOn` (which is the index of the first day of the week)
47959 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
47960 * the first week of the week-numbering year)
47961 *
47962 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
47963 *
47964 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
47965 *
47966 * @param date - The given date
47967 * @param options - An object with options.
47968 *
47969 * @returns The local week-numbering year
47970 *
47971 * @example
47972 * // Which week numbering year is 26 December 2004 with the default settings?
47973 * const result = getWeekYear(new Date(2004, 11, 26))
47974 * //=> 2005
47975 *
47976 * @example
47977 * // Which week numbering year is 26 December 2004 if week starts on Saturday?
47978 * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
47979 * //=> 2004
47980 *
47981 * @example
47982 * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
47983 * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
47984 * //=> 2004
47985 */
47986function getWeekYear(date, options) {
47987 const _date = toDate(date);
47988 const year = _date.getFullYear();
47989
47990 const defaultOptions = getDefaultOptions();
47991 const firstWeekContainsDate =
47992 options?.firstWeekContainsDate ??
47993 options?.locale?.options?.firstWeekContainsDate ??
47994 defaultOptions.firstWeekContainsDate ??
47995 defaultOptions.locale?.options?.firstWeekContainsDate ??
47996 1;
47997
47998 const firstWeekOfNextYear = constructFrom(date, 0);
47999 firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
48000 firstWeekOfNextYear.setHours(0, 0, 0, 0);
48001 const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
48002
48003 const firstWeekOfThisYear = constructFrom(date, 0);
48004 firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
48005 firstWeekOfThisYear.setHours(0, 0, 0, 0);
48006 const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
48007
48008 if (_date.getTime() >= startOfNextYear.getTime()) {
48009 return year + 1;
48010 } else if (_date.getTime() >= startOfThisYear.getTime()) {
48011 return year;
48012 } else {
48013 return year - 1;
48014 }
48015}
48016
48017// Fallback for modularized imports:
48018/* harmony default export */ const date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear)));
48019
48020;// ./node_modules/date-fns/startOfWeekYear.mjs
48021
48022
48023
48024
48025
48026/**
48027 * The {@link startOfWeekYear} function options.
48028 */
48029
48030/**
48031 * @name startOfWeekYear
48032 * @category Week-Numbering Year Helpers
48033 * @summary Return the start of a local week-numbering year for the given date.
48034 *
48035 * @description
48036 * Return the start of a local week-numbering year.
48037 * The exact calculation depends on the values of
48038 * `options.weekStartsOn` (which is the index of the first day of the week)
48039 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
48040 * the first week of the week-numbering year)
48041 *
48042 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
48043 *
48044 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
48045 *
48046 * @param date - The original date
48047 * @param options - An object with options
48048 *
48049 * @returns The start of a week-numbering year
48050 *
48051 * @example
48052 * // The start of an a week-numbering year for 2 July 2005 with default settings:
48053 * const result = startOfWeekYear(new Date(2005, 6, 2))
48054 * //=> Sun Dec 26 2004 00:00:00
48055 *
48056 * @example
48057 * // The start of a week-numbering year for 2 July 2005
48058 * // if Monday is the first day of week
48059 * // and 4 January is always in the first week of the year:
48060 * const result = startOfWeekYear(new Date(2005, 6, 2), {
48061 * weekStartsOn: 1,
48062 * firstWeekContainsDate: 4
48063 * })
48064 * //=> Mon Jan 03 2005 00:00:00
48065 */
48066function startOfWeekYear(date, options) {
48067 const defaultOptions = getDefaultOptions();
48068 const firstWeekContainsDate =
48069 options?.firstWeekContainsDate ??
48070 options?.locale?.options?.firstWeekContainsDate ??
48071 defaultOptions.firstWeekContainsDate ??
48072 defaultOptions.locale?.options?.firstWeekContainsDate ??
48073 1;
48074
48075 const year = getWeekYear(date, options);
48076 const firstWeek = constructFrom(date, 0);
48077 firstWeek.setFullYear(year, 0, firstWeekContainsDate);
48078 firstWeek.setHours(0, 0, 0, 0);
48079 const _date = startOfWeek(firstWeek, options);
48080 return _date;
48081}
48082
48083// Fallback for modularized imports:
48084/* harmony default export */ const date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear)));
48085
48086;// ./node_modules/date-fns/getWeek.mjs
48087
48088
48089
48090
48091
48092/**
48093 * The {@link getWeek} function options.
48094 */
48095
48096/**
48097 * @name getWeek
48098 * @category Week Helpers
48099 * @summary Get the local week index of the given date.
48100 *
48101 * @description
48102 * Get the local week index of the given date.
48103 * The exact calculation depends on the values of
48104 * `options.weekStartsOn` (which is the index of the first day of the week)
48105 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
48106 * the first week of the week-numbering year)
48107 *
48108 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
48109 *
48110 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
48111 *
48112 * @param date - The given date
48113 * @param options - An object with options
48114 *
48115 * @returns The week
48116 *
48117 * @example
48118 * // Which week of the local week numbering year is 2 January 2005 with default options?
48119 * const result = getWeek(new Date(2005, 0, 2))
48120 * //=> 2
48121 *
48122 * @example
48123 * // Which week of the local week numbering year is 2 January 2005,
48124 * // if Monday is the first day of the week,
48125 * // and the first week of the year always contains 4 January?
48126 * const result = getWeek(new Date(2005, 0, 2), {
48127 * weekStartsOn: 1,
48128 * firstWeekContainsDate: 4
48129 * })
48130 * //=> 53
48131 */
48132
48133function getWeek(date, options) {
48134 const _date = toDate(date);
48135 const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
48136
48137 // Round the number of weeks to the nearest integer because the number of
48138 // milliseconds in a week is not constant (e.g. it's different in the week of
48139 // the daylight saving time clock shift).
48140 return Math.round(diff / millisecondsInWeek) + 1;
48141}
48142
48143// Fallback for modularized imports:
48144/* harmony default export */ const date_fns_getWeek = ((/* unused pure expression or super */ null && (getWeek)));
48145
48146;// ./node_modules/date-fns/_lib/addLeadingZeros.mjs
48147function addLeadingZeros(number, targetLength) {
48148 const sign = number < 0 ? "-" : "";
48149 const output = Math.abs(number).toString().padStart(targetLength, "0");
48150 return sign + output;
48151}
48152
48153;// ./node_modules/date-fns/_lib/format/lightFormatters.mjs
48154
48155
48156/*
48157 * | | Unit | | Unit |
48158 * |-----|--------------------------------|-----|--------------------------------|
48159 * | a | AM, PM | A* | |
48160 * | d | Day of month | D | |
48161 * | h | Hour [1-12] | H | Hour [0-23] |
48162 * | m | Minute | M | Month |
48163 * | s | Second | S | Fraction of second |
48164 * | y | Year (abs) | Y | |
48165 *
48166 * Letters marked by * are not implemented but reserved by Unicode standard.
48167 */
48168
48169const lightFormatters = {
48170 // Year
48171 y(date, token) {
48172 // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
48173 // | Year | y | yy | yyy | yyyy | yyyyy |
48174 // |----------|-------|----|-------|-------|-------|
48175 // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
48176 // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
48177 // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
48178 // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
48179 // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
48180
48181 const signedYear = date.getFullYear();
48182 // Returns 1 for 1 BC (which is year 0 in JavaScript)
48183 const year = signedYear > 0 ? signedYear : 1 - signedYear;
48184 return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
48185 },
48186
48187 // Month
48188 M(date, token) {
48189 const month = date.getMonth();
48190 return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
48191 },
48192
48193 // Day of the month
48194 d(date, token) {
48195 return addLeadingZeros(date.getDate(), token.length);
48196 },
48197
48198 // AM or PM
48199 a(date, token) {
48200 const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
48201
48202 switch (token) {
48203 case "a":
48204 case "aa":
48205 return dayPeriodEnumValue.toUpperCase();
48206 case "aaa":
48207 return dayPeriodEnumValue;
48208 case "aaaaa":
48209 return dayPeriodEnumValue[0];
48210 case "aaaa":
48211 default:
48212 return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
48213 }
48214 },
48215
48216 // Hour [1-12]
48217 h(date, token) {
48218 return addLeadingZeros(date.getHours() % 12 || 12, token.length);
48219 },
48220
48221 // Hour [0-23]
48222 H(date, token) {
48223 return addLeadingZeros(date.getHours(), token.length);
48224 },
48225
48226 // Minute
48227 m(date, token) {
48228 return addLeadingZeros(date.getMinutes(), token.length);
48229 },
48230
48231 // Second
48232 s(date, token) {
48233 return addLeadingZeros(date.getSeconds(), token.length);
48234 },
48235
48236 // Fraction of second
48237 S(date, token) {
48238 const numberOfDigits = token.length;
48239 const milliseconds = date.getMilliseconds();
48240 const fractionalSeconds = Math.trunc(
48241 milliseconds * Math.pow(10, numberOfDigits - 3),
48242 );
48243 return addLeadingZeros(fractionalSeconds, token.length);
48244 },
48245};
48246
48247;// ./node_modules/date-fns/_lib/format/formatters.mjs
48248
48249
48250
48251
48252
48253
48254
48255
48256const dayPeriodEnum = {
48257 am: "am",
48258 pm: "pm",
48259 midnight: "midnight",
48260 noon: "noon",
48261 morning: "morning",
48262 afternoon: "afternoon",
48263 evening: "evening",
48264 night: "night",
48265};
48266
48267/*
48268 * | | Unit | | Unit |
48269 * |-----|--------------------------------|-----|--------------------------------|
48270 * | a | AM, PM | A* | Milliseconds in day |
48271 * | b | AM, PM, noon, midnight | B | Flexible day period |
48272 * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
48273 * | d | Day of month | D | Day of year |
48274 * | e | Local day of week | E | Day of week |
48275 * | f | | F* | Day of week in month |
48276 * | g* | Modified Julian day | G | Era |
48277 * | h | Hour [1-12] | H | Hour [0-23] |
48278 * | i! | ISO day of week | I! | ISO week of year |
48279 * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
48280 * | k | Hour [1-24] | K | Hour [0-11] |
48281 * | l* | (deprecated) | L | Stand-alone month |
48282 * | m | Minute | M | Month |
48283 * | n | | N | |
48284 * | o! | Ordinal number modifier | O | Timezone (GMT) |
48285 * | p! | Long localized time | P! | Long localized date |
48286 * | q | Stand-alone quarter | Q | Quarter |
48287 * | r* | Related Gregorian year | R! | ISO week-numbering year |
48288 * | s | Second | S | Fraction of second |
48289 * | t! | Seconds timestamp | T! | Milliseconds timestamp |
48290 * | u | Extended year | U* | Cyclic year |
48291 * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
48292 * | w | Local week of year | W* | Week of month |
48293 * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
48294 * | y | Year (abs) | Y | Local week-numbering year |
48295 * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
48296 *
48297 * Letters marked by * are not implemented but reserved by Unicode standard.
48298 *
48299 * Letters marked by ! are non-standard, but implemented by date-fns:
48300 * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
48301 * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
48302 * i.e. 7 for Sunday, 1 for Monday, etc.
48303 * - `I` is ISO week of year, as opposed to `w` which is local week of year.
48304 * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
48305 * `R` is supposed to be used in conjunction with `I` and `i`
48306 * for universal ISO week-numbering date, whereas
48307 * `Y` is supposed to be used in conjunction with `w` and `e`
48308 * for week-numbering date specific to the locale.
48309 * - `P` is long localized date format
48310 * - `p` is long localized time format
48311 */
48312
48313const formatters = {
48314 // Era
48315 G: function (date, token, localize) {
48316 const era = date.getFullYear() > 0 ? 1 : 0;
48317 switch (token) {
48318 // AD, BC
48319 case "G":
48320 case "GG":
48321 case "GGG":
48322 return localize.era(era, { width: "abbreviated" });
48323 // A, B
48324 case "GGGGG":
48325 return localize.era(era, { width: "narrow" });
48326 // Anno Domini, Before Christ
48327 case "GGGG":
48328 default:
48329 return localize.era(era, { width: "wide" });
48330 }
48331 },
48332
48333 // Year
48334 y: function (date, token, localize) {
48335 // Ordinal number
48336 if (token === "yo") {
48337 const signedYear = date.getFullYear();
48338 // Returns 1 for 1 BC (which is year 0 in JavaScript)
48339 const year = signedYear > 0 ? signedYear : 1 - signedYear;
48340 return localize.ordinalNumber(year, { unit: "year" });
48341 }
48342
48343 return lightFormatters.y(date, token);
48344 },
48345
48346 // Local week-numbering year
48347 Y: function (date, token, localize, options) {
48348 const signedWeekYear = getWeekYear(date, options);
48349 // Returns 1 for 1 BC (which is year 0 in JavaScript)
48350 const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
48351
48352 // Two digit year
48353 if (token === "YY") {
48354 const twoDigitYear = weekYear % 100;
48355 return addLeadingZeros(twoDigitYear, 2);
48356 }
48357
48358 // Ordinal number
48359 if (token === "Yo") {
48360 return localize.ordinalNumber(weekYear, { unit: "year" });
48361 }
48362
48363 // Padding
48364 return addLeadingZeros(weekYear, token.length);
48365 },
48366
48367 // ISO week-numbering year
48368 R: function (date, token) {
48369 const isoWeekYear = getISOWeekYear(date);
48370
48371 // Padding
48372 return addLeadingZeros(isoWeekYear, token.length);
48373 },
48374
48375 // Extended year. This is a single number designating the year of this calendar system.
48376 // The main difference between `y` and `u` localizers are B.C. years:
48377 // | Year | `y` | `u` |
48378 // |------|-----|-----|
48379 // | AC 1 | 1 | 1 |
48380 // | BC 1 | 1 | 0 |
48381 // | BC 2 | 2 | -1 |
48382 // Also `yy` always returns the last two digits of a year,
48383 // while `uu` pads single digit years to 2 characters and returns other years unchanged.
48384 u: function (date, token) {
48385 const year = date.getFullYear();
48386 return addLeadingZeros(year, token.length);
48387 },
48388
48389 // Quarter
48390 Q: function (date, token, localize) {
48391 const quarter = Math.ceil((date.getMonth() + 1) / 3);
48392 switch (token) {
48393 // 1, 2, 3, 4
48394 case "Q":
48395 return String(quarter);
48396 // 01, 02, 03, 04
48397 case "QQ":
48398 return addLeadingZeros(quarter, 2);
48399 // 1st, 2nd, 3rd, 4th
48400 case "Qo":
48401 return localize.ordinalNumber(quarter, { unit: "quarter" });
48402 // Q1, Q2, Q3, Q4
48403 case "QQQ":
48404 return localize.quarter(quarter, {
48405 width: "abbreviated",
48406 context: "formatting",
48407 });
48408 // 1, 2, 3, 4 (narrow quarter; could be not numerical)
48409 case "QQQQQ":
48410 return localize.quarter(quarter, {
48411 width: "narrow",
48412 context: "formatting",
48413 });
48414 // 1st quarter, 2nd quarter, ...
48415 case "QQQQ":
48416 default:
48417 return localize.quarter(quarter, {
48418 width: "wide",
48419 context: "formatting",
48420 });
48421 }
48422 },
48423
48424 // Stand-alone quarter
48425 q: function (date, token, localize) {
48426 const quarter = Math.ceil((date.getMonth() + 1) / 3);
48427 switch (token) {
48428 // 1, 2, 3, 4
48429 case "q":
48430 return String(quarter);
48431 // 01, 02, 03, 04
48432 case "qq":
48433 return addLeadingZeros(quarter, 2);
48434 // 1st, 2nd, 3rd, 4th
48435 case "qo":
48436 return localize.ordinalNumber(quarter, { unit: "quarter" });
48437 // Q1, Q2, Q3, Q4
48438 case "qqq":
48439 return localize.quarter(quarter, {
48440 width: "abbreviated",
48441 context: "standalone",
48442 });
48443 // 1, 2, 3, 4 (narrow quarter; could be not numerical)
48444 case "qqqqq":
48445 return localize.quarter(quarter, {
48446 width: "narrow",
48447 context: "standalone",
48448 });
48449 // 1st quarter, 2nd quarter, ...
48450 case "qqqq":
48451 default:
48452 return localize.quarter(quarter, {
48453 width: "wide",
48454 context: "standalone",
48455 });
48456 }
48457 },
48458
48459 // Month
48460 M: function (date, token, localize) {
48461 const month = date.getMonth();
48462 switch (token) {
48463 case "M":
48464 case "MM":
48465 return lightFormatters.M(date, token);
48466 // 1st, 2nd, ..., 12th
48467 case "Mo":
48468 return localize.ordinalNumber(month + 1, { unit: "month" });
48469 // Jan, Feb, ..., Dec
48470 case "MMM":
48471 return localize.month(month, {
48472 width: "abbreviated",
48473 context: "formatting",
48474 });
48475 // J, F, ..., D
48476 case "MMMMM":
48477 return localize.month(month, {
48478 width: "narrow",
48479 context: "formatting",
48480 });
48481 // January, February, ..., December
48482 case "MMMM":
48483 default:
48484 return localize.month(month, { width: "wide", context: "formatting" });
48485 }
48486 },
48487
48488 // Stand-alone month
48489 L: function (date, token, localize) {
48490 const month = date.getMonth();
48491 switch (token) {
48492 // 1, 2, ..., 12
48493 case "L":
48494 return String(month + 1);
48495 // 01, 02, ..., 12
48496 case "LL":
48497 return addLeadingZeros(month + 1, 2);
48498 // 1st, 2nd, ..., 12th
48499 case "Lo":
48500 return localize.ordinalNumber(month + 1, { unit: "month" });
48501 // Jan, Feb, ..., Dec
48502 case "LLL":
48503 return localize.month(month, {
48504 width: "abbreviated",
48505 context: "standalone",
48506 });
48507 // J, F, ..., D
48508 case "LLLLL":
48509 return localize.month(month, {
48510 width: "narrow",
48511 context: "standalone",
48512 });
48513 // January, February, ..., December
48514 case "LLLL":
48515 default:
48516 return localize.month(month, { width: "wide", context: "standalone" });
48517 }
48518 },
48519
48520 // Local week of year
48521 w: function (date, token, localize, options) {
48522 const week = getWeek(date, options);
48523
48524 if (token === "wo") {
48525 return localize.ordinalNumber(week, { unit: "week" });
48526 }
48527
48528 return addLeadingZeros(week, token.length);
48529 },
48530
48531 // ISO week of year
48532 I: function (date, token, localize) {
48533 const isoWeek = getISOWeek(date);
48534
48535 if (token === "Io") {
48536 return localize.ordinalNumber(isoWeek, { unit: "week" });
48537 }
48538
48539 return addLeadingZeros(isoWeek, token.length);
48540 },
48541
48542 // Day of the month
48543 d: function (date, token, localize) {
48544 if (token === "do") {
48545 return localize.ordinalNumber(date.getDate(), { unit: "date" });
48546 }
48547
48548 return lightFormatters.d(date, token);
48549 },
48550
48551 // Day of year
48552 D: function (date, token, localize) {
48553 const dayOfYear = getDayOfYear(date);
48554
48555 if (token === "Do") {
48556 return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
48557 }
48558
48559 return addLeadingZeros(dayOfYear, token.length);
48560 },
48561
48562 // Day of week
48563 E: function (date, token, localize) {
48564 const dayOfWeek = date.getDay();
48565 switch (token) {
48566 // Tue
48567 case "E":
48568 case "EE":
48569 case "EEE":
48570 return localize.day(dayOfWeek, {
48571 width: "abbreviated",
48572 context: "formatting",
48573 });
48574 // T
48575 case "EEEEE":
48576 return localize.day(dayOfWeek, {
48577 width: "narrow",
48578 context: "formatting",
48579 });
48580 // Tu
48581 case "EEEEEE":
48582 return localize.day(dayOfWeek, {
48583 width: "short",
48584 context: "formatting",
48585 });
48586 // Tuesday
48587 case "EEEE":
48588 default:
48589 return localize.day(dayOfWeek, {
48590 width: "wide",
48591 context: "formatting",
48592 });
48593 }
48594 },
48595
48596 // Local day of week
48597 e: function (date, token, localize, options) {
48598 const dayOfWeek = date.getDay();
48599 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
48600 switch (token) {
48601 // Numerical value (Nth day of week with current locale or weekStartsOn)
48602 case "e":
48603 return String(localDayOfWeek);
48604 // Padded numerical value
48605 case "ee":
48606 return addLeadingZeros(localDayOfWeek, 2);
48607 // 1st, 2nd, ..., 7th
48608 case "eo":
48609 return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
48610 case "eee":
48611 return localize.day(dayOfWeek, {
48612 width: "abbreviated",
48613 context: "formatting",
48614 });
48615 // T
48616 case "eeeee":
48617 return localize.day(dayOfWeek, {
48618 width: "narrow",
48619 context: "formatting",
48620 });
48621 // Tu
48622 case "eeeeee":
48623 return localize.day(dayOfWeek, {
48624 width: "short",
48625 context: "formatting",
48626 });
48627 // Tuesday
48628 case "eeee":
48629 default:
48630 return localize.day(dayOfWeek, {
48631 width: "wide",
48632 context: "formatting",
48633 });
48634 }
48635 },
48636
48637 // Stand-alone local day of week
48638 c: function (date, token, localize, options) {
48639 const dayOfWeek = date.getDay();
48640 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
48641 switch (token) {
48642 // Numerical value (same as in `e`)
48643 case "c":
48644 return String(localDayOfWeek);
48645 // Padded numerical value
48646 case "cc":
48647 return addLeadingZeros(localDayOfWeek, token.length);
48648 // 1st, 2nd, ..., 7th
48649 case "co":
48650 return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
48651 case "ccc":
48652 return localize.day(dayOfWeek, {
48653 width: "abbreviated",
48654 context: "standalone",
48655 });
48656 // T
48657 case "ccccc":
48658 return localize.day(dayOfWeek, {
48659 width: "narrow",
48660 context: "standalone",
48661 });
48662 // Tu
48663 case "cccccc":
48664 return localize.day(dayOfWeek, {
48665 width: "short",
48666 context: "standalone",
48667 });
48668 // Tuesday
48669 case "cccc":
48670 default:
48671 return localize.day(dayOfWeek, {
48672 width: "wide",
48673 context: "standalone",
48674 });
48675 }
48676 },
48677
48678 // ISO day of week
48679 i: function (date, token, localize) {
48680 const dayOfWeek = date.getDay();
48681 const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
48682 switch (token) {
48683 // 2
48684 case "i":
48685 return String(isoDayOfWeek);
48686 // 02
48687 case "ii":
48688 return addLeadingZeros(isoDayOfWeek, token.length);
48689 // 2nd
48690 case "io":
48691 return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
48692 // Tue
48693 case "iii":
48694 return localize.day(dayOfWeek, {
48695 width: "abbreviated",
48696 context: "formatting",
48697 });
48698 // T
48699 case "iiiii":
48700 return localize.day(dayOfWeek, {
48701 width: "narrow",
48702 context: "formatting",
48703 });
48704 // Tu
48705 case "iiiiii":
48706 return localize.day(dayOfWeek, {
48707 width: "short",
48708 context: "formatting",
48709 });
48710 // Tuesday
48711 case "iiii":
48712 default:
48713 return localize.day(dayOfWeek, {
48714 width: "wide",
48715 context: "formatting",
48716 });
48717 }
48718 },
48719
48720 // AM or PM
48721 a: function (date, token, localize) {
48722 const hours = date.getHours();
48723 const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
48724
48725 switch (token) {
48726 case "a":
48727 case "aa":
48728 return localize.dayPeriod(dayPeriodEnumValue, {
48729 width: "abbreviated",
48730 context: "formatting",
48731 });
48732 case "aaa":
48733 return localize
48734 .dayPeriod(dayPeriodEnumValue, {
48735 width: "abbreviated",
48736 context: "formatting",
48737 })
48738 .toLowerCase();
48739 case "aaaaa":
48740 return localize.dayPeriod(dayPeriodEnumValue, {
48741 width: "narrow",
48742 context: "formatting",
48743 });
48744 case "aaaa":
48745 default:
48746 return localize.dayPeriod(dayPeriodEnumValue, {
48747 width: "wide",
48748 context: "formatting",
48749 });
48750 }
48751 },
48752
48753 // AM, PM, midnight, noon
48754 b: function (date, token, localize) {
48755 const hours = date.getHours();
48756 let dayPeriodEnumValue;
48757 if (hours === 12) {
48758 dayPeriodEnumValue = dayPeriodEnum.noon;
48759 } else if (hours === 0) {
48760 dayPeriodEnumValue = dayPeriodEnum.midnight;
48761 } else {
48762 dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
48763 }
48764
48765 switch (token) {
48766 case "b":
48767 case "bb":
48768 return localize.dayPeriod(dayPeriodEnumValue, {
48769 width: "abbreviated",
48770 context: "formatting",
48771 });
48772 case "bbb":
48773 return localize
48774 .dayPeriod(dayPeriodEnumValue, {
48775 width: "abbreviated",
48776 context: "formatting",
48777 })
48778 .toLowerCase();
48779 case "bbbbb":
48780 return localize.dayPeriod(dayPeriodEnumValue, {
48781 width: "narrow",
48782 context: "formatting",
48783 });
48784 case "bbbb":
48785 default:
48786 return localize.dayPeriod(dayPeriodEnumValue, {
48787 width: "wide",
48788 context: "formatting",
48789 });
48790 }
48791 },
48792
48793 // in the morning, in the afternoon, in the evening, at night
48794 B: function (date, token, localize) {
48795 const hours = date.getHours();
48796 let dayPeriodEnumValue;
48797 if (hours >= 17) {
48798 dayPeriodEnumValue = dayPeriodEnum.evening;
48799 } else if (hours >= 12) {
48800 dayPeriodEnumValue = dayPeriodEnum.afternoon;
48801 } else if (hours >= 4) {
48802 dayPeriodEnumValue = dayPeriodEnum.morning;
48803 } else {
48804 dayPeriodEnumValue = dayPeriodEnum.night;
48805 }
48806
48807 switch (token) {
48808 case "B":
48809 case "BB":
48810 case "BBB":
48811 return localize.dayPeriod(dayPeriodEnumValue, {
48812 width: "abbreviated",
48813 context: "formatting",
48814 });
48815 case "BBBBB":
48816 return localize.dayPeriod(dayPeriodEnumValue, {
48817 width: "narrow",
48818 context: "formatting",
48819 });
48820 case "BBBB":
48821 default:
48822 return localize.dayPeriod(dayPeriodEnumValue, {
48823 width: "wide",
48824 context: "formatting",
48825 });
48826 }
48827 },
48828
48829 // Hour [1-12]
48830 h: function (date, token, localize) {
48831 if (token === "ho") {
48832 let hours = date.getHours() % 12;
48833 if (hours === 0) hours = 12;
48834 return localize.ordinalNumber(hours, { unit: "hour" });
48835 }
48836
48837 return lightFormatters.h(date, token);
48838 },
48839
48840 // Hour [0-23]
48841 H: function (date, token, localize) {
48842 if (token === "Ho") {
48843 return localize.ordinalNumber(date.getHours(), { unit: "hour" });
48844 }
48845
48846 return lightFormatters.H(date, token);
48847 },
48848
48849 // Hour [0-11]
48850 K: function (date, token, localize) {
48851 const hours = date.getHours() % 12;
48852
48853 if (token === "Ko") {
48854 return localize.ordinalNumber(hours, { unit: "hour" });
48855 }
48856
48857 return addLeadingZeros(hours, token.length);
48858 },
48859
48860 // Hour [1-24]
48861 k: function (date, token, localize) {
48862 let hours = date.getHours();
48863 if (hours === 0) hours = 24;
48864
48865 if (token === "ko") {
48866 return localize.ordinalNumber(hours, { unit: "hour" });
48867 }
48868
48869 return addLeadingZeros(hours, token.length);
48870 },
48871
48872 // Minute
48873 m: function (date, token, localize) {
48874 if (token === "mo") {
48875 return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
48876 }
48877
48878 return lightFormatters.m(date, token);
48879 },
48880
48881 // Second
48882 s: function (date, token, localize) {
48883 if (token === "so") {
48884 return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
48885 }
48886
48887 return lightFormatters.s(date, token);
48888 },
48889
48890 // Fraction of second
48891 S: function (date, token) {
48892 return lightFormatters.S(date, token);
48893 },
48894
48895 // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
48896 X: function (date, token, _localize) {
48897 const timezoneOffset = date.getTimezoneOffset();
48898
48899 if (timezoneOffset === 0) {
48900 return "Z";
48901 }
48902
48903 switch (token) {
48904 // Hours and optional minutes
48905 case "X":
48906 return formatTimezoneWithOptionalMinutes(timezoneOffset);
48907
48908 // Hours, minutes and optional seconds without `:` delimiter
48909 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
48910 // so this token always has the same output as `XX`
48911 case "XXXX":
48912 case "XX": // Hours and minutes without `:` delimiter
48913 return formatTimezone(timezoneOffset);
48914
48915 // Hours, minutes and optional seconds with `:` delimiter
48916 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
48917 // so this token always has the same output as `XXX`
48918 case "XXXXX":
48919 case "XXX": // Hours and minutes with `:` delimiter
48920 default:
48921 return formatTimezone(timezoneOffset, ":");
48922 }
48923 },
48924
48925 // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
48926 x: function (date, token, _localize) {
48927 const timezoneOffset = date.getTimezoneOffset();
48928
48929 switch (token) {
48930 // Hours and optional minutes
48931 case "x":
48932 return formatTimezoneWithOptionalMinutes(timezoneOffset);
48933
48934 // Hours, minutes and optional seconds without `:` delimiter
48935 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
48936 // so this token always has the same output as `xx`
48937 case "xxxx":
48938 case "xx": // Hours and minutes without `:` delimiter
48939 return formatTimezone(timezoneOffset);
48940
48941 // Hours, minutes and optional seconds with `:` delimiter
48942 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
48943 // so this token always has the same output as `xxx`
48944 case "xxxxx":
48945 case "xxx": // Hours and minutes with `:` delimiter
48946 default:
48947 return formatTimezone(timezoneOffset, ":");
48948 }
48949 },
48950
48951 // Timezone (GMT)
48952 O: function (date, token, _localize) {
48953 const timezoneOffset = date.getTimezoneOffset();
48954
48955 switch (token) {
48956 // Short
48957 case "O":
48958 case "OO":
48959 case "OOO":
48960 return "GMT" + formatTimezoneShort(timezoneOffset, ":");
48961 // Long
48962 case "OOOO":
48963 default:
48964 return "GMT" + formatTimezone(timezoneOffset, ":");
48965 }
48966 },
48967
48968 // Timezone (specific non-location)
48969 z: function (date, token, _localize) {
48970 const timezoneOffset = date.getTimezoneOffset();
48971
48972 switch (token) {
48973 // Short
48974 case "z":
48975 case "zz":
48976 case "zzz":
48977 return "GMT" + formatTimezoneShort(timezoneOffset, ":");
48978 // Long
48979 case "zzzz":
48980 default:
48981 return "GMT" + formatTimezone(timezoneOffset, ":");
48982 }
48983 },
48984
48985 // Seconds timestamp
48986 t: function (date, token, _localize) {
48987 const timestamp = Math.trunc(date.getTime() / 1000);
48988 return addLeadingZeros(timestamp, token.length);
48989 },
48990
48991 // Milliseconds timestamp
48992 T: function (date, token, _localize) {
48993 const timestamp = date.getTime();
48994 return addLeadingZeros(timestamp, token.length);
48995 },
48996};
48997
48998function formatTimezoneShort(offset, delimiter = "") {
48999 const sign = offset > 0 ? "-" : "+";
49000 const absOffset = Math.abs(offset);
49001 const hours = Math.trunc(absOffset / 60);
49002 const minutes = absOffset % 60;
49003 if (minutes === 0) {
49004 return sign + String(hours);
49005 }
49006 return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
49007}
49008
49009function formatTimezoneWithOptionalMinutes(offset, delimiter) {
49010 if (offset % 60 === 0) {
49011 const sign = offset > 0 ? "-" : "+";
49012 return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
49013 }
49014 return formatTimezone(offset, delimiter);
49015}
49016
49017function formatTimezone(offset, delimiter = "") {
49018 const sign = offset > 0 ? "-" : "+";
49019 const absOffset = Math.abs(offset);
49020 const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
49021 const minutes = addLeadingZeros(absOffset % 60, 2);
49022 return sign + hours + delimiter + minutes;
49023}
49024
49025;// ./node_modules/date-fns/_lib/format/longFormatters.mjs
49026const dateLongFormatter = (pattern, formatLong) => {
49027 switch (pattern) {
49028 case "P":
49029 return formatLong.date({ width: "short" });
49030 case "PP":
49031 return formatLong.date({ width: "medium" });
49032 case "PPP":
49033 return formatLong.date({ width: "long" });
49034 case "PPPP":
49035 default:
49036 return formatLong.date({ width: "full" });
49037 }
49038};
49039
49040const timeLongFormatter = (pattern, formatLong) => {
49041 switch (pattern) {
49042 case "p":
49043 return formatLong.time({ width: "short" });
49044 case "pp":
49045 return formatLong.time({ width: "medium" });
49046 case "ppp":
49047 return formatLong.time({ width: "long" });
49048 case "pppp":
49049 default:
49050 return formatLong.time({ width: "full" });
49051 }
49052};
49053
49054const dateTimeLongFormatter = (pattern, formatLong) => {
49055 const matchResult = pattern.match(/(P+)(p+)?/) || [];
49056 const datePattern = matchResult[1];
49057 const timePattern = matchResult[2];
49058
49059 if (!timePattern) {
49060 return dateLongFormatter(pattern, formatLong);
49061 }
49062
49063 let dateTimeFormat;
49064
49065 switch (datePattern) {
49066 case "P":
49067 dateTimeFormat = formatLong.dateTime({ width: "short" });
49068 break;
49069 case "PP":
49070 dateTimeFormat = formatLong.dateTime({ width: "medium" });
49071 break;
49072 case "PPP":
49073 dateTimeFormat = formatLong.dateTime({ width: "long" });
49074 break;
49075 case "PPPP":
49076 default:
49077 dateTimeFormat = formatLong.dateTime({ width: "full" });
49078 break;
49079 }
49080
49081 return dateTimeFormat
49082 .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
49083 .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
49084};
49085
49086const longFormatters = {
49087 p: timeLongFormatter,
49088 P: dateTimeLongFormatter,
49089};
49090
49091;// ./node_modules/date-fns/_lib/protectedTokens.mjs
49092const dayOfYearTokenRE = /^D+$/;
49093const weekYearTokenRE = /^Y+$/;
49094
49095const throwTokens = ["D", "DD", "YY", "YYYY"];
49096
49097function isProtectedDayOfYearToken(token) {
49098 return dayOfYearTokenRE.test(token);
49099}
49100
49101function isProtectedWeekYearToken(token) {
49102 return weekYearTokenRE.test(token);
49103}
49104
49105function warnOrThrowProtectedError(token, format, input) {
49106 const _message = message(token, format, input);
49107 console.warn(_message);
49108 if (throwTokens.includes(token)) throw new RangeError(_message);
49109}
49110
49111function message(token, format, input) {
49112 const subject = token[0] === "Y" ? "years" : "days of the month";
49113 return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
49114}
49115
49116;// ./node_modules/date-fns/isDate.mjs
49117/**
49118 * @name isDate
49119 * @category Common Helpers
49120 * @summary Is the given value a date?
49121 *
49122 * @description
49123 * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
49124 *
49125 * @param value - The value to check
49126 *
49127 * @returns True if the given value is a date
49128 *
49129 * @example
49130 * // For a valid date:
49131 * const result = isDate(new Date())
49132 * //=> true
49133 *
49134 * @example
49135 * // For an invalid date:
49136 * const result = isDate(new Date(NaN))
49137 * //=> true
49138 *
49139 * @example
49140 * // For some value:
49141 * const result = isDate('2014-02-31')
49142 * //=> false
49143 *
49144 * @example
49145 * // For an object:
49146 * const result = isDate({})
49147 * //=> false
49148 */
49149function isDate(value) {
49150 return (
49151 value instanceof Date ||
49152 (typeof value === "object" &&
49153 Object.prototype.toString.call(value) === "[object Date]")
49154 );
49155}
49156
49157// Fallback for modularized imports:
49158/* harmony default export */ const date_fns_isDate = ((/* unused pure expression or super */ null && (isDate)));
49159
49160;// ./node_modules/date-fns/isValid.mjs
49161
49162
49163
49164/**
49165 * @name isValid
49166 * @category Common Helpers
49167 * @summary Is the given date valid?
49168 *
49169 * @description
49170 * Returns false if argument is Invalid Date and true otherwise.
49171 * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
49172 * Invalid Date is a Date, whose time value is NaN.
49173 *
49174 * Time value of Date: http://es5.github.io/#x15.9.1.1
49175 *
49176 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49177 *
49178 * @param date - The date to check
49179 *
49180 * @returns The date is valid
49181 *
49182 * @example
49183 * // For the valid date:
49184 * const result = isValid(new Date(2014, 1, 31))
49185 * //=> true
49186 *
49187 * @example
49188 * // For the value, convertable into a date:
49189 * const result = isValid(1393804800000)
49190 * //=> true
49191 *
49192 * @example
49193 * // For the invalid date:
49194 * const result = isValid(new Date(''))
49195 * //=> false
49196 */
49197function isValid(date) {
49198 if (!isDate(date) && typeof date !== "number") {
49199 return false;
49200 }
49201 const _date = toDate(date);
49202 return !isNaN(Number(_date));
49203}
49204
49205// Fallback for modularized imports:
49206/* harmony default export */ const date_fns_isValid = ((/* unused pure expression or super */ null && (isValid)));
49207
49208;// ./node_modules/date-fns/format.mjs
49209
49210
49211
49212
49213
49214
49215
49216
49217// Rexports of internal for libraries to use.
49218// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
49219
49220
49221// This RegExp consists of three parts separated by `|`:
49222// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
49223// (one of the certain letters followed by `o`)
49224// - (\w)\1* matches any sequences of the same letter
49225// - '' matches two quote characters in a row
49226// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
49227// except a single quote symbol, which ends the sequence.
49228// Two quote characters do not end the sequence.
49229// If there is no matching single quote
49230// then the sequence will continue until the end of the string.
49231// - . matches any single character unmatched by previous parts of the RegExps
49232const formattingTokensRegExp =
49233 /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
49234
49235// This RegExp catches symbols escaped by quotes, and also
49236// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
49237const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
49238
49239const escapedStringRegExp = /^'([^]*?)'?$/;
49240const doubleQuoteRegExp = /''/g;
49241const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
49242
49243
49244
49245/**
49246 * The {@link format} function options.
49247 */
49248
49249/**
49250 * @name format
49251 * @alias formatDate
49252 * @category Common Helpers
49253 * @summary Format the date.
49254 *
49255 * @description
49256 * Return the formatted date string in the given format. The result may vary by locale.
49257 *
49258 * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
49259 * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49260 *
49261 * The characters wrapped between two single quotes characters (') are escaped.
49262 * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
49263 * (see the last example)
49264 *
49265 * Format of the string is based on Unicode Technical Standard #35:
49266 * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
49267 * with a few additions (see note 7 below the table).
49268 *
49269 * Accepted patterns:
49270 * | Unit | Pattern | Result examples | Notes |
49271 * |---------------------------------|---------|-----------------------------------|-------|
49272 * | Era | G..GGG | AD, BC | |
49273 * | | GGGG | Anno Domini, Before Christ | 2 |
49274 * | | GGGGG | A, B | |
49275 * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
49276 * | | yo | 44th, 1st, 0th, 17th | 5,7 |
49277 * | | yy | 44, 01, 00, 17 | 5 |
49278 * | | yyy | 044, 001, 1900, 2017 | 5 |
49279 * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
49280 * | | yyyyy | ... | 3,5 |
49281 * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
49282 * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
49283 * | | YY | 44, 01, 00, 17 | 5,8 |
49284 * | | YYY | 044, 001, 1900, 2017 | 5 |
49285 * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
49286 * | | YYYYY | ... | 3,5 |
49287 * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
49288 * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
49289 * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
49290 * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
49291 * | | RRRRR | ... | 3,5,7 |
49292 * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
49293 * | | uu | -43, 01, 1900, 2017 | 5 |
49294 * | | uuu | -043, 001, 1900, 2017 | 5 |
49295 * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
49296 * | | uuuuu | ... | 3,5 |
49297 * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
49298 * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
49299 * | | QQ | 01, 02, 03, 04 | |
49300 * | | QQQ | Q1, Q2, Q3, Q4 | |
49301 * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
49302 * | | QQQQQ | 1, 2, 3, 4 | 4 |
49303 * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
49304 * | | qo | 1st, 2nd, 3rd, 4th | 7 |
49305 * | | qq | 01, 02, 03, 04 | |
49306 * | | qqq | Q1, Q2, Q3, Q4 | |
49307 * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
49308 * | | qqqqq | 1, 2, 3, 4 | 4 |
49309 * | Month (formatting) | M | 1, 2, ..., 12 | |
49310 * | | Mo | 1st, 2nd, ..., 12th | 7 |
49311 * | | MM | 01, 02, ..., 12 | |
49312 * | | MMM | Jan, Feb, ..., Dec | |
49313 * | | MMMM | January, February, ..., December | 2 |
49314 * | | MMMMM | J, F, ..., D | |
49315 * | Month (stand-alone) | L | 1, 2, ..., 12 | |
49316 * | | Lo | 1st, 2nd, ..., 12th | 7 |
49317 * | | LL | 01, 02, ..., 12 | |
49318 * | | LLL | Jan, Feb, ..., Dec | |
49319 * | | LLLL | January, February, ..., December | 2 |
49320 * | | LLLLL | J, F, ..., D | |
49321 * | Local week of year | w | 1, 2, ..., 53 | |
49322 * | | wo | 1st, 2nd, ..., 53th | 7 |
49323 * | | ww | 01, 02, ..., 53 | |
49324 * | ISO week of year | I | 1, 2, ..., 53 | 7 |
49325 * | | Io | 1st, 2nd, ..., 53th | 7 |
49326 * | | II | 01, 02, ..., 53 | 7 |
49327 * | Day of month | d | 1, 2, ..., 31 | |
49328 * | | do | 1st, 2nd, ..., 31st | 7 |
49329 * | | dd | 01, 02, ..., 31 | |
49330 * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
49331 * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
49332 * | | DD | 01, 02, ..., 365, 366 | 9 |
49333 * | | DDD | 001, 002, ..., 365, 366 | |
49334 * | | DDDD | ... | 3 |
49335 * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
49336 * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
49337 * | | EEEEE | M, T, W, T, F, S, S | |
49338 * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
49339 * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
49340 * | | io | 1st, 2nd, ..., 7th | 7 |
49341 * | | ii | 01, 02, ..., 07 | 7 |
49342 * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
49343 * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
49344 * | | iiiii | M, T, W, T, F, S, S | 7 |
49345 * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
49346 * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
49347 * | | eo | 2nd, 3rd, ..., 1st | 7 |
49348 * | | ee | 02, 03, ..., 01 | |
49349 * | | eee | Mon, Tue, Wed, ..., Sun | |
49350 * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
49351 * | | eeeee | M, T, W, T, F, S, S | |
49352 * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
49353 * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
49354 * | | co | 2nd, 3rd, ..., 1st | 7 |
49355 * | | cc | 02, 03, ..., 01 | |
49356 * | | ccc | Mon, Tue, Wed, ..., Sun | |
49357 * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
49358 * | | ccccc | M, T, W, T, F, S, S | |
49359 * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
49360 * | AM, PM | a..aa | AM, PM | |
49361 * | | aaa | am, pm | |
49362 * | | aaaa | a.m., p.m. | 2 |
49363 * | | aaaaa | a, p | |
49364 * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
49365 * | | bbb | am, pm, noon, midnight | |
49366 * | | bbbb | a.m., p.m., noon, midnight | 2 |
49367 * | | bbbbb | a, p, n, mi | |
49368 * | Flexible day period | B..BBB | at night, in the morning, ... | |
49369 * | | BBBB | at night, in the morning, ... | 2 |
49370 * | | BBBBB | at night, in the morning, ... | |
49371 * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
49372 * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
49373 * | | hh | 01, 02, ..., 11, 12 | |
49374 * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
49375 * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
49376 * | | HH | 00, 01, 02, ..., 23 | |
49377 * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
49378 * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
49379 * | | KK | 01, 02, ..., 11, 00 | |
49380 * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
49381 * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
49382 * | | kk | 24, 01, 02, ..., 23 | |
49383 * | Minute | m | 0, 1, ..., 59 | |
49384 * | | mo | 0th, 1st, ..., 59th | 7 |
49385 * | | mm | 00, 01, ..., 59 | |
49386 * | Second | s | 0, 1, ..., 59 | |
49387 * | | so | 0th, 1st, ..., 59th | 7 |
49388 * | | ss | 00, 01, ..., 59 | |
49389 * | Fraction of second | S | 0, 1, ..., 9 | |
49390 * | | SS | 00, 01, ..., 99 | |
49391 * | | SSS | 000, 001, ..., 999 | |
49392 * | | SSSS | ... | 3 |
49393 * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
49394 * | | XX | -0800, +0530, Z | |
49395 * | | XXX | -08:00, +05:30, Z | |
49396 * | | XXXX | -0800, +0530, Z, +123456 | 2 |
49397 * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
49398 * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
49399 * | | xx | -0800, +0530, +0000 | |
49400 * | | xxx | -08:00, +05:30, +00:00 | 2 |
49401 * | | xxxx | -0800, +0530, +0000, +123456 | |
49402 * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
49403 * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
49404 * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
49405 * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
49406 * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
49407 * | Seconds timestamp | t | 512969520 | 7 |
49408 * | | tt | ... | 3,7 |
49409 * | Milliseconds timestamp | T | 512969520900 | 7 |
49410 * | | TT | ... | 3,7 |
49411 * | Long localized date | P | 04/29/1453 | 7 |
49412 * | | PP | Apr 29, 1453 | 7 |
49413 * | | PPP | April 29th, 1453 | 7 |
49414 * | | PPPP | Friday, April 29th, 1453 | 2,7 |
49415 * | Long localized time | p | 12:00 AM | 7 |
49416 * | | pp | 12:00:00 AM | 7 |
49417 * | | ppp | 12:00:00 AM GMT+2 | 7 |
49418 * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
49419 * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
49420 * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
49421 * | | PPPppp | April 29th, 1453 at ... | 7 |
49422 * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
49423 * Notes:
49424 * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
49425 * are the same as "stand-alone" units, but are different in some languages.
49426 * "Formatting" units are declined according to the rules of the language
49427 * in the context of a date. "Stand-alone" units are always nominative singular:
49428 *
49429 * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
49430 *
49431 * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
49432 *
49433 * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
49434 * the single quote characters (see below).
49435 * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
49436 * the output will be the same as default pattern for this unit, usually
49437 * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
49438 * are marked with "2" in the last column of the table.
49439 *
49440 * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
49441 *
49442 * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
49443 *
49444 * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
49445 *
49446 * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
49447 *
49448 * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
49449 *
49450 * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
49451 * The output will be padded with zeros to match the length of the pattern.
49452 *
49453 * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
49454 *
49455 * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
49456 * These tokens represent the shortest form of the quarter.
49457 *
49458 * 5. The main difference between `y` and `u` patterns are B.C. years:
49459 *
49460 * | Year | `y` | `u` |
49461 * |------|-----|-----|
49462 * | AC 1 | 1 | 1 |
49463 * | BC 1 | 1 | 0 |
49464 * | BC 2 | 2 | -1 |
49465 *
49466 * Also `yy` always returns the last two digits of a year,
49467 * while `uu` pads single digit years to 2 characters and returns other years unchanged:
49468 *
49469 * | Year | `yy` | `uu` |
49470 * |------|------|------|
49471 * | 1 | 01 | 01 |
49472 * | 14 | 14 | 14 |
49473 * | 376 | 76 | 376 |
49474 * | 1453 | 53 | 1453 |
49475 *
49476 * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
49477 * except local week-numbering years are dependent on `options.weekStartsOn`
49478 * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
49479 * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
49480 *
49481 * 6. Specific non-location timezones are currently unavailable in `date-fns`,
49482 * so right now these tokens fall back to GMT timezones.
49483 *
49484 * 7. These patterns are not in the Unicode Technical Standard #35:
49485 * - `i`: ISO day of week
49486 * - `I`: ISO week of year
49487 * - `R`: ISO week-numbering year
49488 * - `t`: seconds timestamp
49489 * - `T`: milliseconds timestamp
49490 * - `o`: ordinal number modifier
49491 * - `P`: long localized date
49492 * - `p`: long localized time
49493 *
49494 * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
49495 * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49496 *
49497 * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
49498 * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49499 *
49500 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49501 *
49502 * @param date - The original date
49503 * @param format - The string of tokens
49504 * @param options - An object with options
49505 *
49506 * @returns The formatted date string
49507 *
49508 * @throws `date` must not be Invalid Date
49509 * @throws `options.locale` must contain `localize` property
49510 * @throws `options.locale` must contain `formatLong` property
49511 * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49512 * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49513 * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49514 * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49515 * @throws format string contains an unescaped latin alphabet character
49516 *
49517 * @example
49518 * // Represent 11 February 2014 in middle-endian format:
49519 * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
49520 * //=> '02/11/2014'
49521 *
49522 * @example
49523 * // Represent 2 July 2014 in Esperanto:
49524 * import { eoLocale } from 'date-fns/locale/eo'
49525 * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
49526 * locale: eoLocale
49527 * })
49528 * //=> '2-a de julio 2014'
49529 *
49530 * @example
49531 * // Escape string by single quote characters:
49532 * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
49533 * //=> "3 o'clock"
49534 */
49535function format(date, formatStr, options) {
49536 const defaultOptions = getDefaultOptions();
49537 const locale = options?.locale ?? defaultOptions.locale ?? enUS;
49538
49539 const firstWeekContainsDate =
49540 options?.firstWeekContainsDate ??
49541 options?.locale?.options?.firstWeekContainsDate ??
49542 defaultOptions.firstWeekContainsDate ??
49543 defaultOptions.locale?.options?.firstWeekContainsDate ??
49544 1;
49545
49546 const weekStartsOn =
49547 options?.weekStartsOn ??
49548 options?.locale?.options?.weekStartsOn ??
49549 defaultOptions.weekStartsOn ??
49550 defaultOptions.locale?.options?.weekStartsOn ??
49551 0;
49552
49553 const originalDate = toDate(date);
49554
49555 if (!isValid(originalDate)) {
49556 throw new RangeError("Invalid time value");
49557 }
49558
49559 let parts = formatStr
49560 .match(longFormattingTokensRegExp)
49561 .map((substring) => {
49562 const firstCharacter = substring[0];
49563 if (firstCharacter === "p" || firstCharacter === "P") {
49564 const longFormatter = longFormatters[firstCharacter];
49565 return longFormatter(substring, locale.formatLong);
49566 }
49567 return substring;
49568 })
49569 .join("")
49570 .match(formattingTokensRegExp)
49571 .map((substring) => {
49572 // Replace two single quote characters with one single quote character
49573 if (substring === "''") {
49574 return { isToken: false, value: "'" };
49575 }
49576
49577 const firstCharacter = substring[0];
49578 if (firstCharacter === "'") {
49579 return { isToken: false, value: cleanEscapedString(substring) };
49580 }
49581
49582 if (formatters[firstCharacter]) {
49583 return { isToken: true, value: substring };
49584 }
49585
49586 if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
49587 throw new RangeError(
49588 "Format string contains an unescaped latin alphabet character `" +
49589 firstCharacter +
49590 "`",
49591 );
49592 }
49593
49594 return { isToken: false, value: substring };
49595 });
49596
49597 // invoke localize preprocessor (only for french locales at the moment)
49598 if (locale.localize.preprocessor) {
49599 parts = locale.localize.preprocessor(originalDate, parts);
49600 }
49601
49602 const formatterOptions = {
49603 firstWeekContainsDate,
49604 weekStartsOn,
49605 locale,
49606 };
49607
49608 return parts
49609 .map((part) => {
49610 if (!part.isToken) return part.value;
49611
49612 const token = part.value;
49613
49614 if (
49615 (!options?.useAdditionalWeekYearTokens &&
49616 isProtectedWeekYearToken(token)) ||
49617 (!options?.useAdditionalDayOfYearTokens &&
49618 isProtectedDayOfYearToken(token))
49619 ) {
49620 warnOrThrowProtectedError(token, formatStr, String(date));
49621 }
49622
49623 const formatter = formatters[token[0]];
49624 return formatter(originalDate, token, locale.localize, formatterOptions);
49625 })
49626 .join("");
49627}
49628
49629function cleanEscapedString(input) {
49630 const matched = input.match(escapedStringRegExp);
49631
49632 if (!matched) {
49633 return input;
49634 }
49635
49636 return matched[1].replace(doubleQuoteRegExp, "'");
49637}
49638
49639// Fallback for modularized imports:
49640/* harmony default export */ const date_fns_format = ((/* unused pure expression or super */ null && (format)));
49641
49642;// ./node_modules/date-fns/isSameMonth.mjs
49643
49644
49645/**
49646 * @name isSameMonth
49647 * @category Month Helpers
49648 * @summary Are the given dates in the same month (and year)?
49649 *
49650 * @description
49651 * Are the given dates in the same month (and year)?
49652 *
49653 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49654 *
49655 * @param dateLeft - The first date to check
49656 * @param dateRight - The second date to check
49657 *
49658 * @returns The dates are in the same month (and year)
49659 *
49660 * @example
49661 * // Are 2 September 2014 and 25 September 2014 in the same month?
49662 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
49663 * //=> true
49664 *
49665 * @example
49666 * // Are 2 September 2014 and 25 September 2015 in the same month?
49667 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
49668 * //=> false
49669 */
49670function isSameMonth(dateLeft, dateRight) {
49671 const _dateLeft = toDate(dateLeft);
49672 const _dateRight = toDate(dateRight);
49673 return (
49674 _dateLeft.getFullYear() === _dateRight.getFullYear() &&
49675 _dateLeft.getMonth() === _dateRight.getMonth()
49676 );
49677}
49678
49679// Fallback for modularized imports:
49680/* harmony default export */ const date_fns_isSameMonth = ((/* unused pure expression or super */ null && (isSameMonth)));
49681
49682;// ./node_modules/date-fns/isEqual.mjs
49683
49684
49685/**
49686 * @name isEqual
49687 * @category Common Helpers
49688 * @summary Are the given dates equal?
49689 *
49690 * @description
49691 * Are the given dates equal?
49692 *
49693 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49694 *
49695 * @param dateLeft - The first date to compare
49696 * @param dateRight - The second date to compare
49697 *
49698 * @returns The dates are equal
49699 *
49700 * @example
49701 * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
49702 * const result = isEqual(
49703 * new Date(2014, 6, 2, 6, 30, 45, 0),
49704 * new Date(2014, 6, 2, 6, 30, 45, 500)
49705 * )
49706 * //=> false
49707 */
49708function isEqual(leftDate, rightDate) {
49709 const _dateLeft = toDate(leftDate);
49710 const _dateRight = toDate(rightDate);
49711 return +_dateLeft === +_dateRight;
49712}
49713
49714// Fallback for modularized imports:
49715/* harmony default export */ const date_fns_isEqual = ((/* unused pure expression or super */ null && (isEqual)));
49716
49717;// ./node_modules/date-fns/isSameDay.mjs
49718
49719
49720/**
49721 * @name isSameDay
49722 * @category Day Helpers
49723 * @summary Are the given dates in the same day (and year and month)?
49724 *
49725 * @description
49726 * Are the given dates in the same day (and year and month)?
49727 *
49728 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49729 *
49730 * @param dateLeft - The first date to check
49731 * @param dateRight - The second date to check
49732
49733 * @returns The dates are in the same day (and year and month)
49734 *
49735 * @example
49736 * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
49737 * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
49738 * //=> true
49739 *
49740 * @example
49741 * // Are 4 September and 4 October in the same day?
49742 * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
49743 * //=> false
49744 *
49745 * @example
49746 * // Are 4 September, 2014 and 4 September, 2015 in the same day?
49747 * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
49748 * //=> false
49749 */
49750function isSameDay(dateLeft, dateRight) {
49751 const dateLeftStartOfDay = startOfDay(dateLeft);
49752 const dateRightStartOfDay = startOfDay(dateRight);
49753
49754 return +dateLeftStartOfDay === +dateRightStartOfDay;
49755}
49756
49757// Fallback for modularized imports:
49758/* harmony default export */ const date_fns_isSameDay = ((/* unused pure expression or super */ null && (isSameDay)));
49759
49760;// ./node_modules/date-fns/addDays.mjs
49761
49762
49763
49764/**
49765 * @name addDays
49766 * @category Day Helpers
49767 * @summary Add the specified number of days to the given date.
49768 *
49769 * @description
49770 * Add the specified number of days to the given date.
49771 *
49772 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49773 *
49774 * @param date - The date to be changed
49775 * @param amount - The amount of days to be added.
49776 *
49777 * @returns The new date with the days added
49778 *
49779 * @example
49780 * // Add 10 days to 1 September 2014:
49781 * const result = addDays(new Date(2014, 8, 1), 10)
49782 * //=> Thu Sep 11 2014 00:00:00
49783 */
49784function addDays(date, amount) {
49785 const _date = toDate(date);
49786 if (isNaN(amount)) return constructFrom(date, NaN);
49787 if (!amount) {
49788 // If 0 days, no-op to avoid changing times in the hour before end of DST
49789 return _date;
49790 }
49791 _date.setDate(_date.getDate() + amount);
49792 return _date;
49793}
49794
49795// Fallback for modularized imports:
49796/* harmony default export */ const date_fns_addDays = ((/* unused pure expression or super */ null && (addDays)));
49797
49798;// ./node_modules/date-fns/addWeeks.mjs
49799
49800
49801/**
49802 * @name addWeeks
49803 * @category Week Helpers
49804 * @summary Add the specified number of weeks to the given date.
49805 *
49806 * @description
49807 * Add the specified number of week to the given date.
49808 *
49809 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49810 *
49811 * @param date - The date to be changed
49812 * @param amount - The amount of weeks to be added.
49813 *
49814 * @returns The new date with the weeks added
49815 *
49816 * @example
49817 * // Add 4 weeks to 1 September 2014:
49818 * const result = addWeeks(new Date(2014, 8, 1), 4)
49819 * //=> Mon Sep 29 2014 00:00:00
49820 */
49821function addWeeks(date, amount) {
49822 const days = amount * 7;
49823 return addDays(date, days);
49824}
49825
49826// Fallback for modularized imports:
49827/* harmony default export */ const date_fns_addWeeks = ((/* unused pure expression or super */ null && (addWeeks)));
49828
49829;// ./node_modules/date-fns/subWeeks.mjs
49830
49831
49832/**
49833 * @name subWeeks
49834 * @category Week Helpers
49835 * @summary Subtract the specified number of weeks from the given date.
49836 *
49837 * @description
49838 * Subtract the specified number of weeks from the given date.
49839 *
49840 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49841 *
49842 * @param date - The date to be changed
49843 * @param amount - The amount of weeks to be subtracted.
49844 *
49845 * @returns The new date with the weeks subtracted
49846 *
49847 * @example
49848 * // Subtract 4 weeks from 1 September 2014:
49849 * const result = subWeeks(new Date(2014, 8, 1), 4)
49850 * //=> Mon Aug 04 2014 00:00:00
49851 */
49852function subWeeks(date, amount) {
49853 return addWeeks(date, -amount);
49854}
49855
49856// Fallback for modularized imports:
49857/* harmony default export */ const date_fns_subWeeks = ((/* unused pure expression or super */ null && (subWeeks)));
49858
49859;// ./node_modules/date-fns/endOfWeek.mjs
49860
49861
49862
49863/**
49864 * The {@link endOfWeek} function options.
49865 */
49866
49867/**
49868 * @name endOfWeek
49869 * @category Week Helpers
49870 * @summary Return the end of a week for the given date.
49871 *
49872 * @description
49873 * Return the end of a week for the given date.
49874 * The result will be in the local timezone.
49875 *
49876 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49877 *
49878 * @param date - The original date
49879 * @param options - An object with options
49880 *
49881 * @returns The end of a week
49882 *
49883 * @example
49884 * // The end of a week for 2 September 2014 11:55:00:
49885 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
49886 * //=> Sat Sep 06 2014 23:59:59.999
49887 *
49888 * @example
49889 * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
49890 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
49891 * //=> Sun Sep 07 2014 23:59:59.999
49892 */
49893function endOfWeek(date, options) {
49894 const defaultOptions = getDefaultOptions();
49895 const weekStartsOn =
49896 options?.weekStartsOn ??
49897 options?.locale?.options?.weekStartsOn ??
49898 defaultOptions.weekStartsOn ??
49899 defaultOptions.locale?.options?.weekStartsOn ??
49900 0;
49901
49902 const _date = toDate(date);
49903 const day = _date.getDay();
49904 const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
49905
49906 _date.setDate(_date.getDate() + diff);
49907 _date.setHours(23, 59, 59, 999);
49908 return _date;
49909}
49910
49911// Fallback for modularized imports:
49912/* harmony default export */ const date_fns_endOfWeek = ((/* unused pure expression or super */ null && (endOfWeek)));
49913
49914;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js
49915
49916
49917var arrow_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
49918
49919
49920;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
49921
49922
49923var arrow_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
49924
49925
49926;// external ["wp","date"]
49927const external_wp_date_namespaceObject = window["wp"]["date"];
49928;// ./node_modules/date-fns/isAfter.mjs
49929
49930
49931/**
49932 * @name isAfter
49933 * @category Common Helpers
49934 * @summary Is the first date after the second one?
49935 *
49936 * @description
49937 * Is the first date after the second one?
49938 *
49939 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49940 *
49941 * @param date - The date that should be after the other one to return true
49942 * @param dateToCompare - The date to compare with
49943 *
49944 * @returns The first date is after the second date
49945 *
49946 * @example
49947 * // Is 10 July 1989 after 11 February 1987?
49948 * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
49949 * //=> true
49950 */
49951function isAfter(date, dateToCompare) {
49952 const _date = toDate(date);
49953 const _dateToCompare = toDate(dateToCompare);
49954 return _date.getTime() > _dateToCompare.getTime();
49955}
49956
49957// Fallback for modularized imports:
49958/* harmony default export */ const date_fns_isAfter = ((/* unused pure expression or super */ null && (isAfter)));
49959
49960;// ./node_modules/date-fns/isBefore.mjs
49961
49962
49963/**
49964 * @name isBefore
49965 * @category Common Helpers
49966 * @summary Is the first date before the second one?
49967 *
49968 * @description
49969 * Is the first date before the second one?
49970 *
49971 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
49972 *
49973 * @param date - The date that should be before the other one to return true
49974 * @param dateToCompare - The date to compare with
49975 *
49976 * @returns The first date is before the second date
49977 *
49978 * @example
49979 * // Is 10 July 1989 before 11 February 1987?
49980 * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
49981 * //=> false
49982 */
49983function isBefore(date, dateToCompare) {
49984 const _date = toDate(date);
49985 const _dateToCompare = toDate(dateToCompare);
49986 return +_date < +_dateToCompare;
49987}
49988
49989// Fallback for modularized imports:
49990/* harmony default export */ const date_fns_isBefore = ((/* unused pure expression or super */ null && (isBefore)));
49991
49992;// ./node_modules/date-fns/getDaysInMonth.mjs
49993
49994
49995
49996/**
49997 * @name getDaysInMonth
49998 * @category Month Helpers
49999 * @summary Get the number of days in a month of the given date.
50000 *
50001 * @description
50002 * Get the number of days in a month of the given date.
50003 *
50004 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50005 *
50006 * @param date - The given date
50007 *
50008 * @returns The number of days in a month
50009 *
50010 * @example
50011 * // How many days are in February 2000?
50012 * const result = getDaysInMonth(new Date(2000, 1))
50013 * //=> 29
50014 */
50015function getDaysInMonth(date) {
50016 const _date = toDate(date);
50017 const year = _date.getFullYear();
50018 const monthIndex = _date.getMonth();
50019 const lastDayOfMonth = constructFrom(date, 0);
50020 lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
50021 lastDayOfMonth.setHours(0, 0, 0, 0);
50022 return lastDayOfMonth.getDate();
50023}
50024
50025// Fallback for modularized imports:
50026/* harmony default export */ const date_fns_getDaysInMonth = ((/* unused pure expression or super */ null && (getDaysInMonth)));
50027
50028;// ./node_modules/date-fns/setMonth.mjs
50029
50030
50031
50032
50033/**
50034 * @name setMonth
50035 * @category Month Helpers
50036 * @summary Set the month to the given date.
50037 *
50038 * @description
50039 * Set the month to the given date.
50040 *
50041 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50042 *
50043 * @param date - The date to be changed
50044 * @param month - The month index to set (0-11)
50045 *
50046 * @returns The new date with the month set
50047 *
50048 * @example
50049 * // Set February to 1 September 2014:
50050 * const result = setMonth(new Date(2014, 8, 1), 1)
50051 * //=> Sat Feb 01 2014 00:00:00
50052 */
50053function setMonth(date, month) {
50054 const _date = toDate(date);
50055 const year = _date.getFullYear();
50056 const day = _date.getDate();
50057
50058 const dateWithDesiredMonth = constructFrom(date, 0);
50059 dateWithDesiredMonth.setFullYear(year, month, 15);
50060 dateWithDesiredMonth.setHours(0, 0, 0, 0);
50061 const daysInMonth = getDaysInMonth(dateWithDesiredMonth);
50062 // Set the last day of the new month
50063 // if the original date was the last day of the longer month
50064 _date.setMonth(month, Math.min(day, daysInMonth));
50065 return _date;
50066}
50067
50068// Fallback for modularized imports:
50069/* harmony default export */ const date_fns_setMonth = ((/* unused pure expression or super */ null && (setMonth)));
50070
50071;// ./node_modules/date-fns/set.mjs
50072
50073
50074
50075
50076/**
50077 * @name set
50078 * @category Common Helpers
50079 * @summary Set date values to a given date.
50080 *
50081 * @description
50082 * Set date values to a given date.
50083 *
50084 * Sets time values to date from object `values`.
50085 * A value is not set if it is undefined or null or doesn't exist in `values`.
50086 *
50087 * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
50088 * to use native `Date#setX` methods. If you use this function, you may not want to include the
50089 * other `setX` functions that date-fns provides if you are concerned about the bundle size.
50090 *
50091 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50092 *
50093 * @param date - The date to be changed
50094 * @param values - The date values to be set
50095 *
50096 * @returns The new date with options set
50097 *
50098 * @example
50099 * // Transform 1 September 2014 into 20 October 2015 in a single line:
50100 * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
50101 * //=> Tue Oct 20 2015 00:00:00
50102 *
50103 * @example
50104 * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
50105 * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
50106 * //=> Mon Sep 01 2014 12:23:45
50107 */
50108
50109function set(date, values) {
50110 let _date = toDate(date);
50111
50112 // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
50113 if (isNaN(+_date)) {
50114 return constructFrom(date, NaN);
50115 }
50116
50117 if (values.year != null) {
50118 _date.setFullYear(values.year);
50119 }
50120
50121 if (values.month != null) {
50122 _date = setMonth(_date, values.month);
50123 }
50124
50125 if (values.date != null) {
50126 _date.setDate(values.date);
50127 }
50128
50129 if (values.hours != null) {
50130 _date.setHours(values.hours);
50131 }
50132
50133 if (values.minutes != null) {
50134 _date.setMinutes(values.minutes);
50135 }
50136
50137 if (values.seconds != null) {
50138 _date.setSeconds(values.seconds);
50139 }
50140
50141 if (values.milliseconds != null) {
50142 _date.setMilliseconds(values.milliseconds);
50143 }
50144
50145 return _date;
50146}
50147
50148// Fallback for modularized imports:
50149/* harmony default export */ const date_fns_set = ((/* unused pure expression or super */ null && (set)));
50150
50151;// ./node_modules/date-fns/startOfToday.mjs
50152
50153
50154/**
50155 * @name startOfToday
50156 * @category Day Helpers
50157 * @summary Return the start of today.
50158 * @pure false
50159 *
50160 * @description
50161 * Return the start of today.
50162 *
50163 * @returns The start of today
50164 *
50165 * @example
50166 * // If today is 6 October 2014:
50167 * const result = startOfToday()
50168 * //=> Mon Oct 6 2014 00:00:00
50169 */
50170function startOfToday() {
50171 return startOfDay(Date.now());
50172}
50173
50174// Fallback for modularized imports:
50175/* harmony default export */ const date_fns_startOfToday = ((/* unused pure expression or super */ null && (startOfToday)));
50176
50177;// ./node_modules/date-fns/setYear.mjs
50178
50179
50180
50181/**
50182 * @name setYear
50183 * @category Year Helpers
50184 * @summary Set the year to the given date.
50185 *
50186 * @description
50187 * Set the year to the given date.
50188 *
50189 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50190 *
50191 * @param date - The date to be changed
50192 * @param year - The year of the new date
50193 *
50194 * @returns The new date with the year set
50195 *
50196 * @example
50197 * // Set year 2013 to 1 September 2014:
50198 * const result = setYear(new Date(2014, 8, 1), 2013)
50199 * //=> Sun Sep 01 2013 00:00:00
50200 */
50201function setYear(date, year) {
50202 const _date = toDate(date);
50203
50204 // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
50205 if (isNaN(+_date)) {
50206 return constructFrom(date, NaN);
50207 }
50208
50209 _date.setFullYear(year);
50210 return _date;
50211}
50212
50213// Fallback for modularized imports:
50214/* harmony default export */ const date_fns_setYear = ((/* unused pure expression or super */ null && (setYear)));
50215
50216;// ./node_modules/date-fns/addYears.mjs
50217
50218
50219/**
50220 * @name addYears
50221 * @category Year Helpers
50222 * @summary Add the specified number of years to the given date.
50223 *
50224 * @description
50225 * Add the specified number of years to the given date.
50226 *
50227 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50228 *
50229 * @param date - The date to be changed
50230 * @param amount - The amount of years to be added.
50231 *
50232 * @returns The new date with the years added
50233 *
50234 * @example
50235 * // Add 5 years to 1 September 2014:
50236 * const result = addYears(new Date(2014, 8, 1), 5)
50237 * //=> Sun Sep 01 2019 00:00:00
50238 */
50239function addYears(date, amount) {
50240 return addMonths(date, amount * 12);
50241}
50242
50243// Fallback for modularized imports:
50244/* harmony default export */ const date_fns_addYears = ((/* unused pure expression or super */ null && (addYears)));
50245
50246;// ./node_modules/date-fns/subYears.mjs
50247
50248
50249/**
50250 * @name subYears
50251 * @category Year Helpers
50252 * @summary Subtract the specified number of years from the given date.
50253 *
50254 * @description
50255 * Subtract the specified number of years from the given date.
50256 *
50257 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50258 *
50259 * @param date - The date to be changed
50260 * @param amount - The amount of years to be subtracted.
50261 *
50262 * @returns The new date with the years subtracted
50263 *
50264 * @example
50265 * // Subtract 5 years from 1 September 2014:
50266 * const result = subYears(new Date(2014, 8, 1), 5)
50267 * //=> Tue Sep 01 2009 00:00:00
50268 */
50269function subYears(date, amount) {
50270 return addYears(date, -amount);
50271}
50272
50273// Fallback for modularized imports:
50274/* harmony default export */ const date_fns_subYears = ((/* unused pure expression or super */ null && (subYears)));
50275
50276;// ./node_modules/date-fns/eachDayOfInterval.mjs
50277
50278
50279/**
50280 * The {@link eachDayOfInterval} function options.
50281 */
50282
50283/**
50284 * @name eachDayOfInterval
50285 * @category Interval Helpers
50286 * @summary Return the array of dates within the specified time interval.
50287 *
50288 * @description
50289 * Return the array of dates within the specified time interval.
50290 *
50291 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50292 *
50293 * @param interval - The interval.
50294 * @param options - An object with options.
50295 *
50296 * @returns The array with starts of days from the day of the interval start to the day of the interval end
50297 *
50298 * @example
50299 * // Each day between 6 October 2014 and 10 October 2014:
50300 * const result = eachDayOfInterval({
50301 * start: new Date(2014, 9, 6),
50302 * end: new Date(2014, 9, 10)
50303 * })
50304 * //=> [
50305 * // Mon Oct 06 2014 00:00:00,
50306 * // Tue Oct 07 2014 00:00:00,
50307 * // Wed Oct 08 2014 00:00:00,
50308 * // Thu Oct 09 2014 00:00:00,
50309 * // Fri Oct 10 2014 00:00:00
50310 * // ]
50311 */
50312function eachDayOfInterval(interval, options) {
50313 const startDate = toDate(interval.start);
50314 const endDate = toDate(interval.end);
50315
50316 let reversed = +startDate > +endDate;
50317 const endTime = reversed ? +startDate : +endDate;
50318 const currentDate = reversed ? endDate : startDate;
50319 currentDate.setHours(0, 0, 0, 0);
50320
50321 let step = options?.step ?? 1;
50322 if (!step) return [];
50323 if (step < 0) {
50324 step = -step;
50325 reversed = !reversed;
50326 }
50327
50328 const dates = [];
50329
50330 while (+currentDate <= endTime) {
50331 dates.push(toDate(currentDate));
50332 currentDate.setDate(currentDate.getDate() + step);
50333 currentDate.setHours(0, 0, 0, 0);
50334 }
50335
50336 return reversed ? dates.reverse() : dates;
50337}
50338
50339// Fallback for modularized imports:
50340/* harmony default export */ const date_fns_eachDayOfInterval = ((/* unused pure expression or super */ null && (eachDayOfInterval)));
50341
50342;// ./node_modules/date-fns/eachMonthOfInterval.mjs
50343
50344
50345/**
50346 * The {@link eachMonthOfInterval} function options.
50347 */
50348
50349/**
50350 * @name eachMonthOfInterval
50351 * @category Interval Helpers
50352 * @summary Return the array of months within the specified time interval.
50353 *
50354 * @description
50355 * Return the array of months within the specified time interval.
50356 *
50357 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50358 *
50359 * @param interval - The interval
50360 *
50361 * @returns The array with starts of months from the month of the interval start to the month of the interval end
50362 *
50363 * @example
50364 * // Each month between 6 February 2014 and 10 August 2014:
50365 * const result = eachMonthOfInterval({
50366 * start: new Date(2014, 1, 6),
50367 * end: new Date(2014, 7, 10)
50368 * })
50369 * //=> [
50370 * // Sat Feb 01 2014 00:00:00,
50371 * // Sat Mar 01 2014 00:00:00,
50372 * // Tue Apr 01 2014 00:00:00,
50373 * // Thu May 01 2014 00:00:00,
50374 * // Sun Jun 01 2014 00:00:00,
50375 * // Tue Jul 01 2014 00:00:00,
50376 * // Fri Aug 01 2014 00:00:00
50377 * // ]
50378 */
50379function eachMonthOfInterval(interval, options) {
50380 const startDate = toDate(interval.start);
50381 const endDate = toDate(interval.end);
50382
50383 let reversed = +startDate > +endDate;
50384 const endTime = reversed ? +startDate : +endDate;
50385 const currentDate = reversed ? endDate : startDate;
50386 currentDate.setHours(0, 0, 0, 0);
50387 currentDate.setDate(1);
50388
50389 let step = options?.step ?? 1;
50390 if (!step) return [];
50391 if (step < 0) {
50392 step = -step;
50393 reversed = !reversed;
50394 }
50395
50396 const dates = [];
50397
50398 while (+currentDate <= endTime) {
50399 dates.push(toDate(currentDate));
50400 currentDate.setMonth(currentDate.getMonth() + step);
50401 }
50402
50403 return reversed ? dates.reverse() : dates;
50404}
50405
50406// Fallback for modularized imports:
50407/* harmony default export */ const date_fns_eachMonthOfInterval = ((/* unused pure expression or super */ null && (eachMonthOfInterval)));
50408
50409;// ./node_modules/date-fns/startOfMonth.mjs
50410
50411
50412/**
50413 * @name startOfMonth
50414 * @category Month Helpers
50415 * @summary Return the start of a month for the given date.
50416 *
50417 * @description
50418 * Return the start of a month for the given date.
50419 * The result will be in the local timezone.
50420 *
50421 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50422 *
50423 * @param date - The original date
50424 *
50425 * @returns The start of a month
50426 *
50427 * @example
50428 * // The start of a month for 2 September 2014 11:55:00:
50429 * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
50430 * //=> Mon Sep 01 2014 00:00:00
50431 */
50432function startOfMonth(date) {
50433 const _date = toDate(date);
50434 _date.setDate(1);
50435 _date.setHours(0, 0, 0, 0);
50436 return _date;
50437}
50438
50439// Fallback for modularized imports:
50440/* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
50441
50442;// ./node_modules/date-fns/endOfMonth.mjs
50443
50444
50445/**
50446 * @name endOfMonth
50447 * @category Month Helpers
50448 * @summary Return the end of a month for the given date.
50449 *
50450 * @description
50451 * Return the end of a month for the given date.
50452 * The result will be in the local timezone.
50453 *
50454 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50455 *
50456 * @param date - The original date
50457 *
50458 * @returns The end of a month
50459 *
50460 * @example
50461 * // The end of a month for 2 September 2014 11:55:00:
50462 * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
50463 * //=> Tue Sep 30 2014 23:59:59.999
50464 */
50465function endOfMonth(date) {
50466 const _date = toDate(date);
50467 const month = _date.getMonth();
50468 _date.setFullYear(_date.getFullYear(), month + 1, 0);
50469 _date.setHours(23, 59, 59, 999);
50470 return _date;
50471}
50472
50473// Fallback for modularized imports:
50474/* harmony default export */ const date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth)));
50475
50476;// ./node_modules/date-fns/eachWeekOfInterval.mjs
50477
50478
50479
50480
50481/**
50482 * The {@link eachWeekOfInterval} function options.
50483 */
50484
50485/**
50486 * @name eachWeekOfInterval
50487 * @category Interval Helpers
50488 * @summary Return the array of weeks within the specified time interval.
50489 *
50490 * @description
50491 * Return the array of weeks within the specified time interval.
50492 *
50493 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
50494 *
50495 * @param interval - The interval.
50496 * @param options - An object with options.
50497 *
50498 * @returns The array with starts of weeks from the week of the interval start to the week of the interval end
50499 *
50500 * @example
50501 * // Each week within interval 6 October 2014 - 23 November 2014:
50502 * const result = eachWeekOfInterval({
50503 * start: new Date(2014, 9, 6),
50504 * end: new Date(2014, 10, 23)
50505 * })
50506 * //=> [
50507 * // Sun Oct 05 2014 00:00:00,
50508 * // Sun Oct 12 2014 00:00:00,
50509 * // Sun Oct 19 2014 00:00:00,
50510 * // Sun Oct 26 2014 00:00:00,
50511 * // Sun Nov 02 2014 00:00:00,
50512 * // Sun Nov 09 2014 00:00:00,
50513 * // Sun Nov 16 2014 00:00:00,
50514 * // Sun Nov 23 2014 00:00:00
50515 * // ]
50516 */
50517function eachWeekOfInterval(interval, options) {
50518 const startDate = toDate(interval.start);
50519 const endDate = toDate(interval.end);
50520
50521 let reversed = +startDate > +endDate;
50522 const startDateWeek = reversed
50523 ? startOfWeek(endDate, options)
50524 : startOfWeek(startDate, options);
50525 const endDateWeek = reversed
50526 ? startOfWeek(startDate, options)
50527 : startOfWeek(endDate, options);
50528
50529 // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet
50530 startDateWeek.setHours(15);
50531 endDateWeek.setHours(15);
50532
50533 const endTime = +endDateWeek.getTime();
50534 let currentDate = startDateWeek;
50535
50536 let step = options?.step ?? 1;
50537 if (!step) return [];
50538 if (step < 0) {
50539 step = -step;
50540 reversed = !reversed;
50541 }
50542
50543 const dates = [];
50544
50545 while (+currentDate <= endTime) {
50546 currentDate.setHours(0);
50547 dates.push(toDate(currentDate));
50548 currentDate = addWeeks(currentDate, step);
50549 currentDate.setHours(15);
50550 }
50551
50552 return reversed ? dates.reverse() : dates;
50553}
50554
50555// Fallback for modularized imports:
50556/* harmony default export */ const date_fns_eachWeekOfInterval = ((/* unused pure expression or super */ null && (eachWeekOfInterval)));
50557
50558;// ./node_modules/@wordpress/components/build-module/date-time/date/use-lilius/index.js
50559
50560
50561let Month = /* @__PURE__ */ (function(Month2) {
50562 Month2[Month2["JANUARY"] = 0] = "JANUARY";
50563 Month2[Month2["FEBRUARY"] = 1] = "FEBRUARY";
50564 Month2[Month2["MARCH"] = 2] = "MARCH";
50565 Month2[Month2["APRIL"] = 3] = "APRIL";
50566 Month2[Month2["MAY"] = 4] = "MAY";
50567 Month2[Month2["JUNE"] = 5] = "JUNE";
50568 Month2[Month2["JULY"] = 6] = "JULY";
50569 Month2[Month2["AUGUST"] = 7] = "AUGUST";
50570 Month2[Month2["SEPTEMBER"] = 8] = "SEPTEMBER";
50571 Month2[Month2["OCTOBER"] = 9] = "OCTOBER";
50572 Month2[Month2["NOVEMBER"] = 10] = "NOVEMBER";
50573 Month2[Month2["DECEMBER"] = 11] = "DECEMBER";
50574 return Month2;
50575})({});
50576let Day = /* @__PURE__ */ (function(Day2) {
50577 Day2[Day2["SUNDAY"] = 0] = "SUNDAY";
50578 Day2[Day2["MONDAY"] = 1] = "MONDAY";
50579 Day2[Day2["TUESDAY"] = 2] = "TUESDAY";
50580 Day2[Day2["WEDNESDAY"] = 3] = "WEDNESDAY";
50581 Day2[Day2["THURSDAY"] = 4] = "THURSDAY";
50582 Day2[Day2["FRIDAY"] = 5] = "FRIDAY";
50583 Day2[Day2["SATURDAY"] = 6] = "SATURDAY";
50584 return Day2;
50585})({});
50586const inRange = (date, min, max) => (isEqual(date, min) || isAfter(date, min)) && (isEqual(date, max) || isBefore(date, max));
50587const use_lilius_clearTime = (date) => set(date, {
50588 hours: 0,
50589 minutes: 0,
50590 seconds: 0,
50591 milliseconds: 0
50592});
50593const useLilius = ({
50594 weekStartsOn = Day.SUNDAY,
50595 viewing: initialViewing = /* @__PURE__ */ new Date(),
50596 selected: initialSelected = [],
50597 numberOfMonths = 1
50598} = {}) => {
50599 const [viewing, setViewing] = (0,external_wp_element_namespaceObject.useState)(initialViewing);
50600 const viewToday = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing(startOfToday()), [setViewing]);
50601 const viewMonth = (0,external_wp_element_namespaceObject.useCallback)((month) => setViewing((v) => setMonth(v, month)), []);
50602 const viewPreviousMonth = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => subMonths(v, 1)), []);
50603 const viewNextMonth = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => addMonths(v, 1)), []);
50604 const viewYear = (0,external_wp_element_namespaceObject.useCallback)((year) => setViewing((v) => setYear(v, year)), []);
50605 const viewPreviousYear = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => subYears(v, 1)), []);
50606 const viewNextYear = (0,external_wp_element_namespaceObject.useCallback)(() => setViewing((v) => addYears(v, 1)), []);
50607 const [selected, setSelected] = (0,external_wp_element_namespaceObject.useState)(initialSelected.map(use_lilius_clearTime));
50608 const clearSelected = () => setSelected([]);
50609 const isSelected = (0,external_wp_element_namespaceObject.useCallback)((date) => selected.findIndex((s) => isEqual(s, date)) > -1, [selected]);
50610 const select = (0,external_wp_element_namespaceObject.useCallback)((date, replaceExisting) => {
50611 if (replaceExisting) {
50612 setSelected(Array.isArray(date) ? date : [date]);
50613 } else {
50614 setSelected((selectedItems) => selectedItems.concat(Array.isArray(date) ? date : [date]));
50615 }
50616 }, []);
50617 const deselect = (0,external_wp_element_namespaceObject.useCallback)((date) => setSelected((selectedItems) => Array.isArray(date) ? selectedItems.filter((s) => !date.map((d) => d.getTime()).includes(s.getTime())) : selectedItems.filter((s) => !isEqual(s, date))), []);
50618 const toggle = (0,external_wp_element_namespaceObject.useCallback)((date, replaceExisting) => isSelected(date) ? deselect(date) : select(date, replaceExisting), [deselect, isSelected, select]);
50619 const selectRange = (0,external_wp_element_namespaceObject.useCallback)((start, end, replaceExisting) => {
50620 if (replaceExisting) {
50621 setSelected(eachDayOfInterval({
50622 start,
50623 end
50624 }));
50625 } else {
50626 setSelected((selectedItems) => selectedItems.concat(eachDayOfInterval({
50627 start,
50628 end
50629 })));
50630 }
50631 }, []);
50632 const deselectRange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => {
50633 setSelected((selectedItems) => selectedItems.filter((s) => !eachDayOfInterval({
50634 start,
50635 end
50636 }).map((d) => d.getTime()).includes(s.getTime())));
50637 }, []);
50638 const calendar = (0,external_wp_element_namespaceObject.useMemo)(() => eachMonthOfInterval({
50639 start: startOfMonth(viewing),
50640 end: endOfMonth(addMonths(viewing, numberOfMonths - 1))
50641 }).map((month) => eachWeekOfInterval({
50642 start: startOfMonth(month),
50643 end: endOfMonth(month)
50644 }, {
50645 weekStartsOn
50646 }).map((week) => eachDayOfInterval({
50647 start: startOfWeek(week, {
50648 weekStartsOn
50649 }),
50650 end: endOfWeek(week, {
50651 weekStartsOn
50652 })
50653 }))), [viewing, weekStartsOn, numberOfMonths]);
50654 return {
50655 clearTime: use_lilius_clearTime,
50656 inRange,
50657 viewing,
50658 setViewing,
50659 viewToday,
50660 viewMonth,
50661 viewPreviousMonth,
50662 viewNextMonth,
50663 viewYear,
50664 viewPreviousYear,
50665 viewNextYear,
50666 selected,
50667 setSelected,
50668 clearSelected,
50669 isSelected,
50670 select,
50671 deselect,
50672 toggle,
50673 selectRange,
50674 deselectRange,
50675 calendar
50676 };
50677};
50678
50679
50680;// ./node_modules/@wordpress/components/build-module/date-time/date/styles.js
50681
50682function date_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
50683 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
50684}
50685
50686
50687
50688
50689
50690const styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
50691 target: "e105ri6r7"
50692} : 0)(boxSizingReset, ";" + ( true ? "" : 0));
50693const Navigator = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
50694 target: "e105ri6r6"
50695} : 0)("column-gap:", space(2), ";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;margin-bottom:", space(4), ";" + ( true ? "" : 0));
50696const ViewPreviousMonthButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
50697 target: "e105ri6r5"
50698} : 0)( true ? {
50699 name: "sarfoe",
50700 styles: "grid-column:1/2"
50701} : 0);
50702const ViewNextMonthButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
50703 target: "e105ri6r4"
50704} : 0)( true ? {
50705 name: "1v98r3z",
50706 styles: "grid-column:7/8"
50707} : 0);
50708const NavigatorHeading = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
50709 target: "e105ri6r3"
50710} : 0)("font-size:", config_values_default.fontSize, ";font-weight:", config_values_default.fontWeight, ";grid-column:2/7;strong{font-weight:", config_values_default.fontWeightHeading, ";}" + ( true ? "" : 0));
50711const Calendar = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
50712 target: "e105ri6r2"
50713} : 0)("column-gap:", space(2), ";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:", space(2), ";" + ( true ? "" : 0));
50714const DayOfWeek = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
50715 target: "e105ri6r1"
50716} : 0)("color:", COLORS.theme.gray[700], ";font-size:", config_values_default.fontSize, ";line-height:", config_values_default.fontLineHeightBase, ";" + ( true ? "" : 0));
50717const DayButton = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
50718 shouldForwardProp: (prop) => !["column", "isSelected", "isToday", "hasEvents"].includes(prop),
50719 target: "e105ri6r0"
50720} : 0)("grid-column:", (props) => props.column, ";position:relative;justify-content:center;", (props) => props.disabled && `
50721 pointer-events: none;
50722 `, " &&&{border-radius:", config_values_default.radiusRound, ";height:", space(7), ";width:", space(7), ";", (props) => props.isSelected && `
50723 background: ${COLORS.theme.accent};
50724
50725 &,
50726 &:hover:not(:disabled, [aria-disabled=true]) {
50727 color: ${COLORS.theme.accentInverted};
50728 }
50729
50730 &:focus:not(:disabled),
50731 &:focus:not(:disabled) {
50732 border: ${config_values_default.borderWidthFocus} solid currentColor;
50733 }
50734
50735 /* Highlight the selected day for high-contrast mode */
50736 &::after {
50737 content: '';
50738 position: absolute;
50739 pointer-events: none;
50740 inset: 0;
50741 border-radius: inherit;
50742 border: 1px solid transparent;
50743 }
50744 `, " ", (props) => !props.isSelected && props.isToday && `
50745 background: ${COLORS.theme.gray[200]};
50746 `, ";}", (props) => props.hasEvents && `
50747 ::before {
50748 border: 2px solid ${props.isSelected ? COLORS.theme.accentInverted : COLORS.theme.accent};
50749 border-radius: ${config_values_default.radiusRound};
50750 content: " ";
50751 left: 50%;
50752 position: absolute;
50753 transform: translate(-50%, 9px);
50754 }
50755 `, ";" + ( true ? "" : 0));
50756
50757
50758;// ./node_modules/@wordpress/components/build-module/date-time/utils.js
50759
50760
50761function inputToDate(input) {
50762 if (typeof input === "string") {
50763 return new Date(input);
50764 }
50765 return toDate(input);
50766}
50767function from12hTo24h(hours, isPm) {
50768 return isPm ? (hours % 12 + 12) % 24 : hours % 12;
50769}
50770function from24hTo12h(hours) {
50771 return hours % 12 || 12;
50772}
50773function buildPadInputStateReducer(pad) {
50774 return (state, action) => {
50775 const nextState = {
50776 ...state
50777 };
50778 if (action.type === COMMIT || action.type === PRESS_UP || action.type === PRESS_DOWN) {
50779 if (nextState.value !== void 0) {
50780 nextState.value = nextState.value.toString().padStart(pad, "0");
50781 }
50782 }
50783 return nextState;
50784 };
50785}
50786function validateInputElementTarget(event) {
50787 var _ownerDocument$defaul;
50788 const HTMLInputElementInstance = (_ownerDocument$defaul = event.target?.ownerDocument.defaultView?.HTMLInputElement) !== null && _ownerDocument$defaul !== void 0 ? _ownerDocument$defaul : HTMLInputElement;
50789 if (!(event.target instanceof HTMLInputElementInstance)) {
50790 return false;
50791 }
50792 return event.target.validity.valid;
50793}
50794
50795
50796;// ./node_modules/@wordpress/components/build-module/date-time/constants.js
50797const TIMEZONELESS_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
50798
50799
50800;// ./node_modules/@wordpress/components/build-module/date-time/date/index.js
50801
50802
50803
50804
50805
50806
50807
50808
50809
50810
50811function DatePicker({
50812 currentDate,
50813 onChange,
50814 events = [],
50815 isInvalidDate,
50816 onMonthPreviewed,
50817 startOfWeek: weekStartsOn = 0
50818}) {
50819 const date = currentDate ? inputToDate(currentDate) : /* @__PURE__ */ new Date();
50820 const {
50821 calendar,
50822 viewing,
50823 setSelected,
50824 setViewing,
50825 isSelected,
50826 viewPreviousMonth,
50827 viewNextMonth
50828 } = useLilius({
50829 selected: [startOfDay(date)],
50830 viewing: startOfDay(date),
50831 weekStartsOn
50832 });
50833 const [focusable, setFocusable] = (0,external_wp_element_namespaceObject.useState)(startOfDay(date));
50834 const [isFocusWithinCalendar, setIsFocusWithinCalendar] = (0,external_wp_element_namespaceObject.useState)(false);
50835 const [prevCurrentDate, setPrevCurrentDate] = (0,external_wp_element_namespaceObject.useState)(currentDate);
50836 if (currentDate !== prevCurrentDate) {
50837 setPrevCurrentDate(currentDate);
50838 setSelected([startOfDay(date)]);
50839 setViewing(startOfDay(date));
50840 setFocusable(startOfDay(date));
50841 }
50842 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Wrapper, {
50843 className: "components-datetime__date",
50844 role: "application",
50845 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Calendar"),
50846 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Navigator, {
50847 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewPreviousMonthButton, {
50848 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_right_default : arrow_left_default,
50849 variant: "tertiary",
50850 "aria-label": (0,external_wp_i18n_namespaceObject.__)("View previous month"),
50851 onClick: () => {
50852 viewPreviousMonth();
50853 setFocusable(subMonths(focusable, 1));
50854 onMonthPreviewed?.(format(subMonths(viewing, 1), TIMEZONELESS_FORMAT));
50855 },
50856 size: "compact"
50857 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(NavigatorHeading, {
50858 level: 3,
50859 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
50860 children: (0,external_wp_date_namespaceObject.dateI18n)("F", viewing, -viewing.getTimezoneOffset())
50861 }), " ", (0,external_wp_date_namespaceObject.dateI18n)("Y", viewing, -viewing.getTimezoneOffset())]
50862 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewNextMonthButton, {
50863 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_left_default : arrow_right_default,
50864 variant: "tertiary",
50865 "aria-label": (0,external_wp_i18n_namespaceObject.__)("View next month"),
50866 onClick: () => {
50867 viewNextMonth();
50868 setFocusable(addMonths(focusable, 1));
50869 onMonthPreviewed?.(format(addMonths(viewing, 1), TIMEZONELESS_FORMAT));
50870 },
50871 size: "compact"
50872 })]
50873 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Calendar, {
50874 onFocus: () => setIsFocusWithinCalendar(true),
50875 onBlur: () => setIsFocusWithinCalendar(false),
50876 children: [calendar[0][0].map((day) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayOfWeek, {
50877 children: (0,external_wp_date_namespaceObject.dateI18n)("D", day, -day.getTimezoneOffset())
50878 }, day.toString())), calendar[0].map((week) => week.map((day, index) => {
50879 if (!isSameMonth(day, viewing)) {
50880 return null;
50881 }
50882 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_Day, {
50883 day,
50884 column: index + 1,
50885 isSelected: isSelected(day),
50886 isFocusable: isEqual(day, focusable),
50887 isFocusAllowed: isFocusWithinCalendar,
50888 isToday: isSameDay(day, /* @__PURE__ */ new Date()),
50889 isInvalid: isInvalidDate ? isInvalidDate(day) : false,
50890 numEvents: events.filter((event) => isSameDay(event.date, day)).length,
50891 onClick: () => {
50892 setSelected([day]);
50893 setFocusable(day);
50894 onChange?.(format(
50895 // Don't change the selected date's time fields.
50896 new Date(day.getFullYear(), day.getMonth(), day.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()),
50897 TIMEZONELESS_FORMAT
50898 ));
50899 },
50900 onKeyDown: (event) => {
50901 let nextFocusable;
50902 if (event.key === "ArrowLeft") {
50903 nextFocusable = addDays(day, (0,external_wp_i18n_namespaceObject.isRTL)() ? 1 : -1);
50904 }
50905 if (event.key === "ArrowRight") {
50906 nextFocusable = addDays(day, (0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1);
50907 }
50908 if (event.key === "ArrowUp") {
50909 nextFocusable = subWeeks(day, 1);
50910 }
50911 if (event.key === "ArrowDown") {
50912 nextFocusable = addWeeks(day, 1);
50913 }
50914 if (event.key === "PageUp") {
50915 nextFocusable = subMonths(day, 1);
50916 }
50917 if (event.key === "PageDown") {
50918 nextFocusable = addMonths(day, 1);
50919 }
50920 if (event.key === "Home") {
50921 nextFocusable = startOfWeek(day);
50922 }
50923 if (event.key === "End") {
50924 nextFocusable = startOfDay(endOfWeek(day));
50925 }
50926 if (nextFocusable) {
50927 event.preventDefault();
50928 setFocusable(nextFocusable);
50929 if (!isSameMonth(nextFocusable, viewing)) {
50930 setViewing(nextFocusable);
50931 onMonthPreviewed?.(format(nextFocusable, TIMEZONELESS_FORMAT));
50932 }
50933 }
50934 }
50935 }, day.toString());
50936 }))]
50937 })]
50938 });
50939}
50940function date_Day({
50941 day,
50942 column,
50943 isSelected,
50944 isFocusable,
50945 isFocusAllowed,
50946 isToday,
50947 isInvalid,
50948 numEvents,
50949 onClick,
50950 onKeyDown
50951}) {
50952 const ref = (0,external_wp_element_namespaceObject.useRef)();
50953 (0,external_wp_element_namespaceObject.useEffect)(() => {
50954 if (ref.current && isFocusable && isFocusAllowed) {
50955 ref.current.focus();
50956 }
50957 }, [isFocusable]);
50958 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayButton, {
50959 __next40pxDefaultSize: true,
50960 ref,
50961 className: "components-datetime__date__day",
50962 disabled: isInvalid,
50963 tabIndex: isFocusable ? 0 : -1,
50964 "aria-label": getDayLabel(day, isSelected, numEvents),
50965 column,
50966 isSelected,
50967 isToday,
50968 hasEvents: numEvents > 0,
50969 onClick,
50970 onKeyDown,
50971 children: (0,external_wp_date_namespaceObject.dateI18n)("j", day, -day.getTimezoneOffset())
50972 });
50973}
50974function getDayLabel(date, isSelected, numEvents) {
50975 const {
50976 formats
50977 } = (0,external_wp_date_namespaceObject.getSettings)();
50978 const localizedDate = (0,external_wp_date_namespaceObject.dateI18n)(formats.date, date, -date.getTimezoneOffset());
50979 if (isSelected && numEvents > 0) {
50980 return (0,external_wp_i18n_namespaceObject.sprintf)(
50981 // translators: 1: The calendar date. 2: Number of events on the calendar date.
50982 (0,external_wp_i18n_namespaceObject._n)("%1$s. Selected. There is %2$d event", "%1$s. Selected. There are %2$d events", numEvents),
50983 localizedDate,
50984 numEvents
50985 );
50986 } else if (isSelected) {
50987 return (0,external_wp_i18n_namespaceObject.sprintf)(
50988 // translators: 1: The calendar date.
50989 (0,external_wp_i18n_namespaceObject.__)("%1$s. Selected"),
50990 localizedDate
50991 );
50992 } else if (numEvents > 0) {
50993 return (0,external_wp_i18n_namespaceObject.sprintf)(
50994 // translators: 1: The calendar date. 2: Number of events on the calendar date.
50995 (0,external_wp_i18n_namespaceObject._n)("%1$s. There is %2$d event", "%1$s. There are %2$d events", numEvents),
50996 localizedDate,
50997 numEvents
50998 );
50999 }
51000 return localizedDate;
51001}
51002var date_default = DatePicker;
51003
51004
51005;// ./node_modules/date-fns/startOfMinute.mjs
51006
51007
51008/**
51009 * @name startOfMinute
51010 * @category Minute Helpers
51011 * @summary Return the start of a minute for the given date.
51012 *
51013 * @description
51014 * Return the start of a minute for the given date.
51015 * The result will be in the local timezone.
51016 *
51017 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
51018 *
51019 * @param date - The original date
51020 *
51021 * @returns The start of a minute
51022 *
51023 * @example
51024 * // The start of a minute for 1 December 2014 22:15:45.400:
51025 * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
51026 * //=> Mon Dec 01 2014 22:15:00
51027 */
51028function startOfMinute(date) {
51029 const _date = toDate(date);
51030 _date.setSeconds(0, 0);
51031 return _date;
51032}
51033
51034// Fallback for modularized imports:
51035/* harmony default export */ const date_fns_startOfMinute = ((/* unused pure expression or super */ null && (startOfMinute)));
51036
51037;// ./node_modules/@wordpress/components/build-module/date-time/time/styles.js
51038
51039function time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
51040 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
51041}
51042
51043
51044
51045
51046
51047const time_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
51048 target: "evcr2319"
51049} : 0)("box-sizing:border-box;font-size:", config_values_default.fontSize, ";" + ( true ? "" : 0));
51050const Fieldset = /* @__PURE__ */ emotion_styled_base_browser_esm("fieldset", true ? {
51051 target: "evcr2318"
51052} : 0)("border:0;margin:0 0 ", space(2 * 2), " 0;padding:0;&:last-child{margin-bottom:0;}" + ( true ? "" : 0));
51053const TimeWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
51054 target: "evcr2317"
51055} : 0)( true ? {
51056 name: "pd0mhc",
51057 styles: "direction:ltr;display:flex"
51058} : 0);
51059const baseInput = /* @__PURE__ */ emotion_react_browser_esm_css("&&& ", Input, "{padding-left:", space(2), ";padding-right:", space(2), ";text-align:center;}" + ( true ? "" : 0), true ? "" : 0);
51060const HoursInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
51061 target: "evcr2316"
51062} : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-right:0;}&&& ", BackdropUI, "{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}" + ( true ? "" : 0));
51063const TimeSeparator = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
51064 target: "evcr2315"
51065} : 0)("border-top:", config_values_default.borderWidth, " solid ", COLORS.gray[700], ";border-bottom:", config_values_default.borderWidth, " solid ", COLORS.gray[700], ";font-size:", config_values_default.fontSize, ";line-height:calc(\n ", config_values_default.controlHeight, " - ", config_values_default.borderWidth, " * 2\n );display:inline-block;" + ( true ? "" : 0));
51066const MinutesInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
51067 target: "evcr2314"
51068} : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-left:0;}&&& ", BackdropUI, "{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}" + ( true ? "" : 0));
51069const MonthSelectWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
51070 target: "evcr2313"
51071} : 0)( true ? {
51072 name: "1ff36h2",
51073 styles: "flex-grow:1"
51074} : 0);
51075const DayInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
51076 target: "evcr2312"
51077} : 0)(baseInput, " width:", space(9), ";" + ( true ? "" : 0));
51078const YearInput = /* @__PURE__ */ emotion_styled_base_browser_esm(number_control_default, true ? {
51079 target: "evcr2311"
51080} : 0)(baseInput, " width:", space(14), ";" + ( true ? "" : 0));
51081const TimeZone = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
51082 target: "evcr2310"
51083} : 0)( true ? {
51084 name: "ebu3jh",
51085 styles: "text-decoration:underline dotted"
51086} : 0);
51087
51088
51089;// ./node_modules/@wordpress/components/build-module/date-time/time/timezone.js
51090
51091
51092
51093
51094
51095const timezone_TimeZone = () => {
51096 const {
51097 timezone
51098 } = (0,external_wp_date_namespaceObject.getSettings)();
51099 const userTimezoneOffset = -1 * ((/* @__PURE__ */ new Date()).getTimezoneOffset() / 60);
51100 if (Number(timezone.offset) === userTimezoneOffset) {
51101 return null;
51102 }
51103 const offsetSymbol = Number(timezone.offset) >= 0 ? "+" : "";
51104 const zoneAbbr = "" !== timezone.abbr && isNaN(Number(timezone.abbr)) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offsetFormatted}`;
51105 const prettyTimezoneString = timezone.string.replace("_", " ");
51106 const timezoneDetail = "UTC" === timezone.string ? (0,external_wp_i18n_namespaceObject.__)("Coordinated Universal Time") : `(${zoneAbbr}) ${prettyTimezoneString}`;
51107 const hasNoAdditionalTimezoneDetail = prettyTimezoneString.trim().length === 0;
51108 return hasNoAdditionalTimezoneDetail ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeZone, {
51109 className: "components-datetime__timezone",
51110 children: zoneAbbr
51111 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip_default, {
51112 placement: "top",
51113 text: timezoneDetail,
51114 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeZone, {
51115 className: "components-datetime__timezone",
51116 children: zoneAbbr
51117 })
51118 });
51119};
51120var timezone_default = timezone_TimeZone;
51121
51122
51123;// ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option/component.js
51124
51125
51126
51127function UnforwardedToggleGroupControlOption(props, ref) {
51128 const {
51129 label,
51130 ...restProps
51131 } = props;
51132 const optionLabel = restProps["aria-label"] || label;
51133 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_base_component_component_default, {
51134 ...restProps,
51135 "aria-label": optionLabel,
51136 ref,
51137 children: label
51138 });
51139}
51140const ToggleGroupControlOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOption);
51141var toggle_group_control_option_component_component_default = ToggleGroupControlOption;
51142
51143
51144;// ./node_modules/@wordpress/components/build-module/date-time/time/time-input/index.js
51145
51146
51147
51148
51149
51150
51151
51152
51153
51154
51155function TimeInput({
51156 value: valueProp,
51157 defaultValue,
51158 is12Hour,
51159 label,
51160 minutesProps,
51161 onChange
51162}) {
51163 const [value = {
51164 hours: (/* @__PURE__ */ new Date()).getHours(),
51165 minutes: (/* @__PURE__ */ new Date()).getMinutes()
51166 }, setValue] = useControlledValue({
51167 value: valueProp,
51168 onChange,
51169 defaultValue
51170 });
51171 const dayPeriod = parseDayPeriod(value.hours);
51172 const hours12Format = from24hTo12h(value.hours);
51173 const buildNumberControlChangeCallback = (method) => {
51174 return (_value, {
51175 event
51176 }) => {
51177 if (!validateInputElementTarget(event)) {
51178 return;
51179 }
51180 const numberValue = Number(_value);
51181 setValue({
51182 ...value,
51183 [method]: method === "hours" && is12Hour ? from12hTo24h(numberValue, dayPeriod === "PM") : numberValue
51184 });
51185 };
51186 };
51187 const buildAmPmChangeCallback = (_value) => {
51188 return () => {
51189 if (dayPeriod === _value) {
51190 return;
51191 }
51192 setValue({
51193 ...value,
51194 hours: from12hTo24h(hours12Format, _value === "PM")
51195 });
51196 };
51197 };
51198 function parseDayPeriod(_hours) {
51199 return _hours < 12 ? "AM" : "PM";
51200 }
51201 const Wrapper = label ? Fieldset : external_wp_element_namespaceObject.Fragment;
51202 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
51203 children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
51204 as: "legend",
51205 children: label
51206 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
51207 alignment: "left",
51208 expanded: false,
51209 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(TimeWrapper, {
51210 className: "components-datetime__time-field components-datetime__time-field-time",
51211 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HoursInput, {
51212 className: "components-datetime__time-field-hours-input",
51213 label: (0,external_wp_i18n_namespaceObject.__)("Hours"),
51214 hideLabelFromVision: true,
51215 __next40pxDefaultSize: true,
51216 value: String(is12Hour ? hours12Format : value.hours).padStart(2, "0"),
51217 step: 1,
51218 min: is12Hour ? 1 : 0,
51219 max: is12Hour ? 12 : 23,
51220 required: true,
51221 spinControls: "none",
51222 isPressEnterToChange: true,
51223 isDragEnabled: false,
51224 isShiftStepEnabled: false,
51225 onChange: buildNumberControlChangeCallback("hours"),
51226 __unstableStateReducer: buildPadInputStateReducer(2)
51227 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeSeparator, {
51228 className: "components-datetime__time-separator",
51229 "aria-hidden": "true",
51230 children: ":"
51231 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MinutesInput, {
51232 className: dist_clsx(
51233 "components-datetime__time-field-minutes-input",
51234 // Unused, for backwards compatibility.
51235 minutesProps?.className
51236 ),
51237 label: (0,external_wp_i18n_namespaceObject.__)("Minutes"),
51238 hideLabelFromVision: true,
51239 __next40pxDefaultSize: true,
51240 value: String(value.minutes).padStart(2, "0"),
51241 step: 1,
51242 min: 0,
51243 max: 59,
51244 required: true,
51245 spinControls: "none",
51246 isPressEnterToChange: true,
51247 isDragEnabled: false,
51248 isShiftStepEnabled: false,
51249 onChange: (...args) => {
51250 buildNumberControlChangeCallback("minutes")(...args);
51251 minutesProps?.onChange?.(...args);
51252 },
51253 __unstableStateReducer: buildPadInputStateReducer(2),
51254 ...minutesProps
51255 })]
51256 }), is12Hour && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(toggle_group_control_component_component_default, {
51257 __next40pxDefaultSize: true,
51258 __nextHasNoMarginBottom: true,
51259 isBlock: true,
51260 label: (0,external_wp_i18n_namespaceObject.__)("Select AM or PM"),
51261 hideLabelFromVision: true,
51262 value: dayPeriod,
51263 onChange: (newValue) => {
51264 buildAmPmChangeCallback(newValue)();
51265 },
51266 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
51267 value: "AM",
51268 label: (0,external_wp_i18n_namespaceObject.__)("AM")
51269 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
51270 value: "PM",
51271 label: (0,external_wp_i18n_namespaceObject.__)("PM")
51272 })]
51273 })]
51274 })]
51275 });
51276}
51277var time_input_default = (/* unused pure expression or super */ null && (TimeInput));
51278
51279
51280;// ./node_modules/@wordpress/components/build-module/date-time/time/index.js
51281
51282
51283
51284
51285
51286
51287
51288
51289
51290
51291
51292
51293
51294
51295const VALID_DATE_ORDERS = ["dmy", "mdy", "ymd"];
51296function TimePicker({
51297 is12Hour,
51298 currentTime,
51299 onChange,
51300 dateOrder: dateOrderProp,
51301 hideLabelFromVision = false
51302}) {
51303 const [date, setDate] = (0,external_wp_element_namespaceObject.useState)(() => (
51304 // Truncate the date at the minutes, see: #15495.
51305 currentTime ? startOfMinute(inputToDate(currentTime)) : /* @__PURE__ */ new Date()
51306 ));
51307 (0,external_wp_element_namespaceObject.useEffect)(() => {
51308 setDate(currentTime ? startOfMinute(inputToDate(currentTime)) : /* @__PURE__ */ new Date());
51309 }, [currentTime]);
51310 const monthOptions = [{
51311 value: "01",
51312 label: (0,external_wp_i18n_namespaceObject.__)("January")
51313 }, {
51314 value: "02",
51315 label: (0,external_wp_i18n_namespaceObject.__)("February")
51316 }, {
51317 value: "03",
51318 label: (0,external_wp_i18n_namespaceObject.__)("March")
51319 }, {
51320 value: "04",
51321 label: (0,external_wp_i18n_namespaceObject.__)("April")
51322 }, {
51323 value: "05",
51324 label: (0,external_wp_i18n_namespaceObject.__)("May")
51325 }, {
51326 value: "06",
51327 label: (0,external_wp_i18n_namespaceObject.__)("June")
51328 }, {
51329 value: "07",
51330 label: (0,external_wp_i18n_namespaceObject.__)("July")
51331 }, {
51332 value: "08",
51333 label: (0,external_wp_i18n_namespaceObject.__)("August")
51334 }, {
51335 value: "09",
51336 label: (0,external_wp_i18n_namespaceObject.__)("September")
51337 }, {
51338 value: "10",
51339 label: (0,external_wp_i18n_namespaceObject.__)("October")
51340 }, {
51341 value: "11",
51342 label: (0,external_wp_i18n_namespaceObject.__)("November")
51343 }, {
51344 value: "12",
51345 label: (0,external_wp_i18n_namespaceObject.__)("December")
51346 }];
51347 const {
51348 day,
51349 month,
51350 year,
51351 minutes,
51352 hours
51353 } = (0,external_wp_element_namespaceObject.useMemo)(() => ({
51354 day: format(date, "dd"),
51355 month: format(date, "MM"),
51356 year: format(date, "yyyy"),
51357 minutes: format(date, "mm"),
51358 hours: format(date, "HH"),
51359 am: format(date, "a")
51360 }), [date]);
51361 const buildNumberControlChangeCallback = (method) => {
51362 const callback = (value, {
51363 event
51364 }) => {
51365 if (!validateInputElementTarget(event)) {
51366 return;
51367 }
51368 const numberValue = Number(value);
51369 const newDate = set(date, {
51370 [method]: numberValue
51371 });
51372 setDate(newDate);
51373 onChange?.(format(newDate, TIMEZONELESS_FORMAT));
51374 };
51375 return callback;
51376 };
51377 const onTimeInputChangeCallback = ({
51378 hours: newHours,
51379 minutes: newMinutes
51380 }) => {
51381 const newDate = set(date, {
51382 hours: newHours,
51383 minutes: newMinutes
51384 });
51385 setDate(newDate);
51386 onChange?.(format(newDate, TIMEZONELESS_FORMAT));
51387 };
51388 const dayField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayInput, {
51389 className: "components-datetime__time-field components-datetime__time-field-day",
51390 label: (0,external_wp_i18n_namespaceObject.__)("Day"),
51391 hideLabelFromVision: true,
51392 __next40pxDefaultSize: true,
51393 value: day,
51394 step: 1,
51395 min: 1,
51396 max: 31,
51397 required: true,
51398 spinControls: "none",
51399 isPressEnterToChange: true,
51400 isDragEnabled: false,
51401 isShiftStepEnabled: false,
51402 onChange: buildNumberControlChangeCallback("date")
51403 }, "day");
51404 const monthField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MonthSelectWrapper, {
51405 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
51406 className: "components-datetime__time-field components-datetime__time-field-month",
51407 label: (0,external_wp_i18n_namespaceObject.__)("Month"),
51408 hideLabelFromVision: true,
51409 __next40pxDefaultSize: true,
51410 __nextHasNoMarginBottom: true,
51411 value: month,
51412 options: monthOptions,
51413 onChange: (value) => {
51414 const newDate = setMonth(date, Number(value) - 1);
51415 setDate(newDate);
51416 onChange?.(format(newDate, TIMEZONELESS_FORMAT));
51417 }
51418 })
51419 }, "month");
51420 const yearField = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(YearInput, {
51421 className: "components-datetime__time-field components-datetime__time-field-year",
51422 label: (0,external_wp_i18n_namespaceObject.__)("Year"),
51423 hideLabelFromVision: true,
51424 __next40pxDefaultSize: true,
51425 value: year,
51426 step: 1,
51427 min: 1,
51428 max: 9999,
51429 required: true,
51430 spinControls: "none",
51431 isPressEnterToChange: true,
51432 isDragEnabled: false,
51433 isShiftStepEnabled: false,
51434 onChange: buildNumberControlChangeCallback("year"),
51435 __unstableStateReducer: buildPadInputStateReducer(4)
51436 }, "year");
51437 const defaultDateOrder = is12Hour ? "mdy" : "dmy";
51438 const dateOrder = dateOrderProp && VALID_DATE_ORDERS.includes(dateOrderProp) ? dateOrderProp : defaultDateOrder;
51439 const fields = dateOrder.split("").map((field) => {
51440 switch (field) {
51441 case "d":
51442 return dayField;
51443 case "m":
51444 return monthField;
51445 case "y":
51446 return yearField;
51447 default:
51448 return null;
51449 }
51450 });
51451 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(time_styles_Wrapper, {
51452 className: "components-datetime__time",
51453 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Fieldset, {
51454 children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
51455 as: "legend",
51456 children: (0,external_wp_i18n_namespaceObject.__)("Time")
51457 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
51458 as: "legend",
51459 className: "components-datetime__time-legend",
51460 children: (0,external_wp_i18n_namespaceObject.__)("Time")
51461 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
51462 className: "components-datetime__time-wrapper",
51463 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeInput, {
51464 value: {
51465 hours: Number(hours),
51466 minutes: Number(minutes)
51467 },
51468 is12Hour,
51469 onChange: onTimeInputChangeCallback
51470 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {}), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(timezone_default, {})]
51471 })]
51472 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Fieldset, {
51473 children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
51474 as: "legend",
51475 children: (0,external_wp_i18n_namespaceObject.__)("Date")
51476 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
51477 as: "legend",
51478 className: "components-datetime__time-legend",
51479 children: (0,external_wp_i18n_namespaceObject.__)("Date")
51480 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(h_stack_component_component_default, {
51481 className: "components-datetime__time-wrapper",
51482 children: fields
51483 })]
51484 })]
51485 });
51486}
51487TimePicker.TimeInput = TimeInput;
51488Object.assign(TimePicker.TimeInput, {
51489 displayName: "TimePicker.TimeInput"
51490});
51491var time_default = TimePicker;
51492
51493
51494;// ./node_modules/@wordpress/components/build-module/date-time/date-time/styles.js
51495
51496function date_time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
51497 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
51498}
51499
51500const date_time_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(v_stack_component_component_default, true ? {
51501 target: "e1p5onf00"
51502} : 0)( true ? {
51503 name: "1khn195",
51504 styles: "box-sizing:border-box"
51505} : 0);
51506
51507
51508;// ./node_modules/@wordpress/components/build-module/date-time/date-time/index.js
51509
51510
51511
51512
51513
51514const date_time_noop = () => {
51515};
51516function UnforwardedDateTimePicker({
51517 currentDate,
51518 is12Hour,
51519 dateOrder,
51520 isInvalidDate,
51521 onMonthPreviewed = date_time_noop,
51522 onChange,
51523 events,
51524 startOfWeek
51525}, ref) {
51526 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_time_styles_Wrapper, {
51527 ref,
51528 className: "components-datetime",
51529 spacing: 4,
51530 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
51531 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(time_default, {
51532 currentTime: currentDate,
51533 onChange,
51534 is12Hour,
51535 dateOrder
51536 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(date_default, {
51537 currentDate,
51538 onChange,
51539 isInvalidDate,
51540 events,
51541 onMonthPreviewed,
51542 startOfWeek
51543 })]
51544 })
51545 });
51546}
51547const DateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDateTimePicker);
51548var date_time_default = DateTimePicker;
51549
51550
51551;// ./node_modules/@wordpress/components/build-module/date-time/index.js
51552
51553
51554
51555var date_time_date_time_default = date_time_default;
51556
51557
51558;// ./node_modules/@wordpress/components/build-module/dimension-control/sizes.js
51559
51560const findSizeBySlug = (sizes, slug) => sizes.find((size) => slug === size.slug);
51561var sizes_default = [{
51562 name: (0,external_wp_i18n_namespaceObject._x)("None", "Size of a UI element"),
51563 slug: "none"
51564}, {
51565 name: (0,external_wp_i18n_namespaceObject._x)("Small", "Size of a UI element"),
51566 slug: "small"
51567}, {
51568 name: (0,external_wp_i18n_namespaceObject._x)("Medium", "Size of a UI element"),
51569 slug: "medium"
51570}, {
51571 name: (0,external_wp_i18n_namespaceObject._x)("Large", "Size of a UI element"),
51572 slug: "large"
51573}, {
51574 name: (0,external_wp_i18n_namespaceObject._x)("Extra Large", "Size of a UI element"),
51575 slug: "xlarge"
51576}];
51577
51578
51579;// ./node_modules/@wordpress/components/build-module/dimension-control/index.js
51580
51581
51582
51583
51584
51585
51586
51587
51588
51589const dimension_control_CONTEXT_VALUE = {
51590 BaseControl: {
51591 // Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`
51592 // via the context system to override the value set by SelectControl.
51593 _overrides: {
51594 __associatedWPComponentName: "DimensionControl"
51595 }
51596 }
51597};
51598function DimensionControl(props) {
51599 const {
51600 __next40pxDefaultSize = false,
51601 __nextHasNoMarginBottom = false,
51602 label,
51603 value,
51604 sizes = sizes_default,
51605 icon,
51606 onChange,
51607 className = ""
51608 } = props;
51609 external_wp_deprecated_default()("wp.components.DimensionControl", {
51610 since: "6.7",
51611 version: "7.0"
51612 });
51613 maybeWarnDeprecated36pxSize({
51614 componentName: "DimensionControl",
51615 __next40pxDefaultSize,
51616 size: void 0
51617 });
51618 const onChangeSpacingSize = (val) => {
51619 const theSize = findSizeBySlug(sizes, val);
51620 if (!theSize || value === theSize.slug) {
51621 onChange?.(void 0);
51622 } else if (typeof onChange === "function") {
51623 onChange(theSize.slug);
51624 }
51625 };
51626 const formatSizesAsOptions = (theSizes) => {
51627 const options = theSizes.map(({
51628 name,
51629 slug
51630 }) => ({
51631 label: name,
51632 value: slug
51633 }));
51634 return [{
51635 label: (0,external_wp_i18n_namespaceObject.__)("Default"),
51636 value: ""
51637 }, ...options];
51638 };
51639 const selectLabel = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
51640 children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
51641 icon
51642 }), label]
51643 });
51644 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
51645 value: dimension_control_CONTEXT_VALUE,
51646 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
51647 __next40pxDefaultSize,
51648 __shouldNotWarnDeprecated36pxSize: true,
51649 __nextHasNoMarginBottom,
51650 className: dist_clsx(className, "block-editor-dimension-control"),
51651 label: selectLabel,
51652 hideLabelFromVision: false,
51653 value,
51654 onChange: onChangeSpacingSize,
51655 options: formatSizesAsOptions(sizes)
51656 })
51657 });
51658}
51659var dimension_control_default = DimensionControl;
51660
51661
51662;// ./node_modules/@wordpress/components/build-module/disabled/styles/disabled-styles.js
51663function disabled_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
51664 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
51665}
51666
51667const disabled_styles_disabledStyles = true ? {
51668 name: "u2jump",
51669 styles: "position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"
51670} : 0;
51671
51672
51673;// ./node_modules/@wordpress/components/build-module/disabled/index.js
51674
51675
51676
51677
51678const Context = (0,external_wp_element_namespaceObject.createContext)(false);
51679Context.displayName = "DisabledContext";
51680const {
51681 Consumer,
51682 Provider: disabled_Provider
51683} = Context;
51684function Disabled({
51685 className,
51686 children,
51687 isDisabled = true,
51688 ...props
51689}) {
51690 const cx = useCx();
51691 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(disabled_Provider, {
51692 value: isDisabled,
51693 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
51694 // @ts-ignore Reason: inert is a recent HTML attribute
51695 inert: isDisabled ? "true" : void 0,
51696 className: isDisabled ? cx(disabled_styles_disabledStyles, className, "components-disabled") : void 0,
51697 ...props,
51698 children
51699 })
51700 });
51701}
51702Disabled.Context = Context;
51703Disabled.Consumer = Consumer;
51704var disabled_default = Disabled;
51705
51706
51707;// ./node_modules/@wordpress/components/build-module/disclosure/index.js
51708
51709
51710
51711const UnforwardedDisclosureContent = ({
51712 visible,
51713 children,
51714 ...props
51715}, ref) => {
51716 const disclosure = useDisclosureStore({
51717 open: visible
51718 });
51719 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContent, {
51720 store: disclosure,
51721 ref,
51722 ...props,
51723 children
51724 });
51725};
51726const disclosure_DisclosureContent = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDisclosureContent);
51727var disclosure_default = (/* unused pure expression or super */ null && (disclosure_DisclosureContent));
51728
51729
51730;// ./node_modules/@wordpress/components/build-module/draggable/index.js
51731
51732
51733
51734const dragImageClass = "components-draggable__invisible-drag-image";
51735const cloneWrapperClass = "components-draggable__clone";
51736const clonePadding = 0;
51737const bodyClass = "is-dragging-components-draggable";
51738function Draggable({
51739 children,
51740 onDragStart,
51741 onDragOver,
51742 onDragEnd,
51743 appendToOwnerDocument = false,
51744 cloneClassname,
51745 elementId,
51746 transferData,
51747 __experimentalTransferDataType: transferDataType = "text",
51748 __experimentalDragComponent: dragComponent
51749}) {
51750 const dragComponentRef = (0,external_wp_element_namespaceObject.useRef)(null);
51751 const cleanupRef = (0,external_wp_element_namespaceObject.useRef)(() => {
51752 });
51753 function end(event) {
51754 event.preventDefault();
51755 cleanupRef.current();
51756 if (onDragEnd) {
51757 onDragEnd(event);
51758 }
51759 }
51760 function start(event) {
51761 const {
51762 ownerDocument
51763 } = event.target;
51764 event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));
51765 const cloneWrapper = ownerDocument.createElement("div");
51766 cloneWrapper.style.top = "0";
51767 cloneWrapper.style.left = "0";
51768 const dragImage = ownerDocument.createElement("div");
51769 if ("function" === typeof event.dataTransfer.setDragImage) {
51770 dragImage.classList.add(dragImageClass);
51771 ownerDocument.body.appendChild(dragImage);
51772 event.dataTransfer.setDragImage(dragImage, 0, 0);
51773 }
51774 cloneWrapper.classList.add(cloneWrapperClass);
51775 if (cloneClassname) {
51776 cloneWrapper.classList.add(cloneClassname);
51777 }
51778 let x = 0;
51779 let y = 0;
51780 if (dragComponentRef.current) {
51781 x = event.clientX;
51782 y = event.clientY;
51783 cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;
51784 const clonedDragComponent = ownerDocument.createElement("div");
51785 clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;
51786 cloneWrapper.appendChild(clonedDragComponent);
51787 ownerDocument.body.appendChild(cloneWrapper);
51788 } else {
51789 const element = ownerDocument.getElementById(elementId);
51790 const elementRect = element.getBoundingClientRect();
51791 const elementWrapper = element.parentNode;
51792 const elementTopOffset = elementRect.top;
51793 const elementLeftOffset = elementRect.left;
51794 cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;
51795 const clone = element.cloneNode(true);
51796 clone.id = `clone-${elementId}`;
51797 x = elementLeftOffset - clonePadding;
51798 y = elementTopOffset - clonePadding;
51799 cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;
51800 Array.from(clone.querySelectorAll("iframe")).forEach((child) => child.parentNode?.removeChild(child));
51801 cloneWrapper.appendChild(clone);
51802 if (appendToOwnerDocument) {
51803 ownerDocument.body.appendChild(cloneWrapper);
51804 } else {
51805 elementWrapper?.appendChild(cloneWrapper);
51806 }
51807 }
51808 let cursorLeft = event.clientX;
51809 let cursorTop = event.clientY;
51810 function over(e) {
51811 if (cursorLeft === e.clientX && cursorTop === e.clientY) {
51812 return;
51813 }
51814 const nextX = x + e.clientX - cursorLeft;
51815 const nextY = y + e.clientY - cursorTop;
51816 cloneWrapper.style.transform = `translate( ${nextX}px, ${nextY}px )`;
51817 cursorLeft = e.clientX;
51818 cursorTop = e.clientY;
51819 x = nextX;
51820 y = nextY;
51821 if (onDragOver) {
51822 onDragOver(e);
51823 }
51824 }
51825 const throttledDragOver = (0,external_wp_compose_namespaceObject.throttle)(over, 16);
51826 ownerDocument.addEventListener("dragover", throttledDragOver);
51827 ownerDocument.body.classList.add(bodyClass);
51828 if (onDragStart) {
51829 onDragStart(event);
51830 }
51831 cleanupRef.current = () => {
51832 if (cloneWrapper && cloneWrapper.parentNode) {
51833 cloneWrapper.parentNode.removeChild(cloneWrapper);
51834 }
51835 if (dragImage && dragImage.parentNode) {
51836 dragImage.parentNode.removeChild(dragImage);
51837 }
51838 ownerDocument.body.classList.remove(bodyClass);
51839 ownerDocument.removeEventListener("dragover", throttledDragOver);
51840 };
51841 }
51842 (0,external_wp_element_namespaceObject.useEffect)(() => () => {
51843 cleanupRef.current();
51844 }, []);
51845 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
51846 children: [children({
51847 onDraggableStart: start,
51848 onDraggableEnd: end
51849 }), dragComponent && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
51850 className: "components-draggable-drag-component-root",
51851 style: {
51852 display: "none"
51853 },
51854 ref: dragComponentRef,
51855 children: dragComponent
51856 })]
51857 });
51858}
51859var draggable_default = Draggable;
51860
51861
51862;// ./node_modules/@wordpress/icons/build-module/library/upload.js
51863
51864
51865var upload_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });
51866
51867
51868;// ./node_modules/@wordpress/components/build-module/drop-zone/index.js
51869
51870
51871
51872
51873
51874
51875
51876function DropZoneComponent({
51877 className,
51878 icon = upload_default,
51879 label,
51880 onFilesDrop,
51881 onHTMLDrop,
51882 onDrop,
51883 isEligible = () => true,
51884 ...restProps
51885}) {
51886 const [isDraggingOverDocument, setIsDraggingOverDocument] = (0,external_wp_element_namespaceObject.useState)();
51887 const [isDraggingOverElement, setIsDraggingOverElement] = (0,external_wp_element_namespaceObject.useState)();
51888 const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)();
51889 const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
51890 onDrop(event) {
51891 if (!event.dataTransfer) {
51892 return;
51893 }
51894 const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer);
51895 const html = event.dataTransfer.getData("text/html");
51896 if (html && onHTMLDrop) {
51897 onHTMLDrop(html);
51898 } else if (files.length && onFilesDrop) {
51899 onFilesDrop(files);
51900 } else if (onDrop) {
51901 onDrop(event);
51902 }
51903 },
51904 onDragStart(event) {
51905 setIsDraggingOverDocument(true);
51906 if (!event.dataTransfer) {
51907 return;
51908 }
51909 if (event.dataTransfer.types.includes("text/html")) {
51910 setIsActive(!!onHTMLDrop);
51911 } else if (
51912 // Check for the types because sometimes the files themselves
51913 // are only available on drop.
51914 event.dataTransfer.types.includes("Files") || (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer).length > 0
51915 ) {
51916 setIsActive(!!onFilesDrop);
51917 } else {
51918 setIsActive(!!onDrop && isEligible(event.dataTransfer));
51919 }
51920 },
51921 onDragEnd() {
51922 setIsDraggingOverElement(false);
51923 setIsDraggingOverDocument(false);
51924 setIsActive(void 0);
51925 },
51926 onDragEnter() {
51927 setIsDraggingOverElement(true);
51928 },
51929 onDragLeave() {
51930 setIsDraggingOverElement(false);
51931 }
51932 });
51933 const classes = dist_clsx("components-drop-zone", className, {
51934 "is-active": isActive,
51935 "is-dragging-over-document": isDraggingOverDocument,
51936 "is-dragging-over-element": isDraggingOverElement
51937 });
51938 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
51939 ...restProps,
51940 ref,
51941 className: classes,
51942 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
51943 className: "components-drop-zone__content",
51944 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
51945 className: "components-drop-zone__content-inner",
51946 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
51947 icon,
51948 className: "components-drop-zone__content-icon"
51949 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
51950 className: "components-drop-zone__content-text",
51951 children: label ? label : (0,external_wp_i18n_namespaceObject.__)("Drop files to upload")
51952 })]
51953 })
51954 })
51955 });
51956}
51957var drop_zone_default = DropZoneComponent;
51958
51959
51960;// ./node_modules/@wordpress/components/build-module/drop-zone/provider.js
51961
51962function DropZoneProvider({
51963 children
51964}) {
51965 external_wp_deprecated_default()("wp.components.DropZoneProvider", {
51966 since: "5.8",
51967 hint: "wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."
51968 });
51969 return children;
51970}
51971
51972
51973;// ./node_modules/@wordpress/icons/build-module/library/swatch.js
51974
51975
51976var swatch_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.1 5.7 8 6.9c.4-.3.9-.6 1.5-.8l-.6-1.4c-.7.3-1.3.6-1.8 1ZM4.6 8.9l1.4.6c.2-.5.5-1 .8-1.5l-1.2-.9c-.4.6-.8 1.2-1 1.8Zm14.8 0c-.3-.7-.6-1.3-1-1.8l-1.2.9c.3.4.6.9.8 1.5l1.4-.6ZM7.1 18.3c.6.4 1.2.8 1.8 1l.6-1.4c-.5-.2-1-.5-1.5-.8l-.9 1.2ZM5.5 12v-.9h-.7l-.7-.2v2l1.5-.2v-.9Zm-.7 3h-.2c.3.7.6 1.3 1 1.9l1.2-.9c-.3-.4-.6-.9-.8-1.5l-1.2.5Zm9.7 3 .5 1.2v.2c.7-.3 1.3-.6 1.9-1l-.9-1.2c-.4.3-.9.6-1.5.8Zm-2.5.5h-.9l-.2 1.3v.2h2l-.2-1.5h-.9Zm7.9-7.5-1.5.2V13h.7l.7.2v-2ZM18 14.5c-.2.5-.5 1-.8 1.5l1.2.9c.4-.6.8-1.2 1-1.8h-.2l-1.2-.6ZM11 4.1l.2 1.5H13V4.2h-1.9ZM14.5 6c.5.2 1 .5 1.5.8l.9-1.2c-.6-.4-1.2-.8-1.8-1L14.5 6Z" }) });
51977
51978
51979;// ./node_modules/@wordpress/components/build-module/duotone-picker/color-list-picker/index.js
51980
51981
51982
51983
51984
51985
51986
51987
51988
51989function ColorOption({
51990 label,
51991 value,
51992 colors,
51993 disableCustomColors,
51994 enableAlpha,
51995 onChange
51996}) {
51997 const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
51998 const idRoot = (0,external_wp_compose_namespaceObject.useInstanceId)(ColorOption, "color-list-picker-option");
51999 const labelId = `${idRoot}__label`;
52000 const contentId = `${idRoot}__content`;
52001 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
52002 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
52003 __next40pxDefaultSize: true,
52004 className: "components-color-list-picker__swatch-button",
52005 id: labelId,
52006 onClick: () => setIsOpen((prev) => !prev),
52007 "aria-expanded": isOpen,
52008 "aria-controls": contentId,
52009 icon: value ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
52010 colorValue: value,
52011 className: "components-color-list-picker__swatch-color"
52012 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
52013 icon: swatch_default
52014 }),
52015 text: label
52016 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
52017 role: "group",
52018 id: contentId,
52019 "aria-labelledby": labelId,
52020 "aria-hidden": !isOpen,
52021 children: isOpen && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_palette_default, {
52022 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Color options"),
52023 className: "components-color-list-picker__color-picker",
52024 colors,
52025 value,
52026 clearable: false,
52027 onChange,
52028 disableCustomColors,
52029 enableAlpha
52030 })
52031 })]
52032 });
52033}
52034function ColorListPicker({
52035 colors,
52036 labels,
52037 value = [],
52038 disableCustomColors,
52039 enableAlpha,
52040 onChange
52041}) {
52042 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
52043 className: "components-color-list-picker",
52044 children: labels.map((label, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorOption, {
52045 label,
52046 value: value[index],
52047 colors,
52048 disableCustomColors,
52049 enableAlpha,
52050 onChange: (newColor) => {
52051 const newColors = value.slice();
52052 newColors[index] = newColor;
52053 onChange(newColors);
52054 }
52055 }, index))
52056 });
52057}
52058var color_list_picker_default = ColorListPicker;
52059
52060
52061;// ./node_modules/@wordpress/components/build-module/duotone-picker/utils.js
52062
52063
52064k([names]);
52065function getDefaultColors(palette) {
52066 if (!palette || palette.length < 2) {
52067 return ["#000", "#fff"];
52068 }
52069 return palette.map(({
52070 color
52071 }) => ({
52072 color,
52073 brightness: w(color).brightness()
52074 })).reduce(([min, max], current) => {
52075 return [current.brightness <= min.brightness ? current : min, current.brightness >= max.brightness ? current : max];
52076 }, [{
52077 brightness: 1,
52078 color: ""
52079 }, {
52080 brightness: 0,
52081 color: ""
52082 }]).map(({
52083 color
52084 }) => color);
52085}
52086function getGradientFromCSSColors(colors = [], angle = "90deg") {
52087 const l = 100 / colors.length;
52088 const stops = colors.map((c, i) => `${c} ${i * l}%, ${c} ${(i + 1) * l}%`).join(", ");
52089 return `linear-gradient( ${angle}, ${stops} )`;
52090}
52091function getColorStopsFromColors(colors) {
52092 return colors.map((color, i) => ({
52093 position: i * 100 / (colors.length - 1),
52094 color
52095 }));
52096}
52097function getColorsFromColorStops(colorStops = []) {
52098 return colorStops.map(({
52099 color
52100 }) => color);
52101}
52102
52103
52104;// ./node_modules/@wordpress/components/build-module/duotone-picker/custom-duotone-bar.js
52105
52106
52107
52108const PLACEHOLDER_VALUES = ["#333", "#CCC"];
52109function CustomDuotoneBar({
52110 value,
52111 onChange
52112}) {
52113 const hasGradient = !!value;
52114 const values = hasGradient ? value : PLACEHOLDER_VALUES;
52115 const background = getGradientFromCSSColors(values);
52116 const controlPoints = getColorStopsFromColors(values);
52117 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomGradientBar, {
52118 disableInserter: true,
52119 background,
52120 hasGradient,
52121 value: controlPoints,
52122 onChange: (newColorStops) => {
52123 const newValue = getColorsFromColorStops(newColorStops);
52124 onChange(newValue);
52125 }
52126 });
52127}
52128
52129
52130;// ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-picker.js
52131
52132
52133
52134
52135
52136
52137
52138
52139
52140
52141function DuotonePicker({
52142 asButtons,
52143 loop,
52144 clearable = true,
52145 unsetable = true,
52146 colorPalette,
52147 duotonePalette,
52148 disableCustomColors,
52149 disableCustomDuotone,
52150 value,
52151 onChange,
52152 "aria-label": ariaLabel,
52153 "aria-labelledby": ariaLabelledby,
52154 ...otherProps
52155}) {
52156 const [defaultDark, defaultLight] = (0,external_wp_element_namespaceObject.useMemo)(() => getDefaultColors(colorPalette), [colorPalette]);
52157 const isUnset = value === "unset";
52158 const unsetOptionLabel = (0,external_wp_i18n_namespaceObject.__)("Unset");
52159 const unsetOption = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
52160 value: "unset",
52161 isSelected: isUnset,
52162 tooltipText: unsetOptionLabel,
52163 "aria-label": unsetOptionLabel,
52164 className: "components-duotone-picker__color-indicator",
52165 onClick: () => {
52166 onChange(isUnset ? void 0 : "unset");
52167 }
52168 }, "unset");
52169 const duotoneOptions = duotonePalette.map(({
52170 colors,
52171 slug,
52172 name
52173 }) => {
52174 const style = {
52175 background: getGradientFromCSSColors(colors, "135deg"),
52176 color: "transparent"
52177 };
52178 const tooltipText = name !== null && name !== void 0 ? name : (0,external_wp_i18n_namespaceObject.sprintf)(
52179 // translators: %s: duotone code e.g: "dark-grayscale" or "7f7f7f-ffffff".
52180 (0,external_wp_i18n_namespaceObject.__)("Duotone code: %s"),
52181 slug
52182 );
52183 const label = name ? (0,external_wp_i18n_namespaceObject.sprintf)(
52184 // translators: %s: The name of the option e.g: "Dark grayscale".
52185 (0,external_wp_i18n_namespaceObject.__)("Duotone: %s"),
52186 name
52187 ) : tooltipText;
52188 const isSelected = es6_default()(colors, value);
52189 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.Option, {
52190 value: colors,
52191 isSelected,
52192 "aria-label": label,
52193 tooltipText,
52194 style,
52195 onClick: () => {
52196 onChange(isSelected ? void 0 : colors);
52197 }
52198 }, slug);
52199 });
52200 const {
52201 metaProps,
52202 labelProps
52203 } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
52204 const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;
52205 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default, {
52206 ...otherProps,
52207 ...metaProps,
52208 ...labelProps,
52209 options,
52210 actions: !!clearable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(circular_option_picker_circular_option_picker_default.ButtonAction, {
52211 onClick: () => onChange(void 0),
52212 accessibleWhenDisabled: true,
52213 disabled: !value,
52214 children: (0,external_wp_i18n_namespaceObject.__)("Clear")
52215 }),
52216 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
52217 paddingTop: options.length === 0 ? 0 : 4,
52218 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(v_stack_component_component_default, {
52219 spacing: 3,
52220 children: [!disableCustomColors && !disableCustomDuotone && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomDuotoneBar, {
52221 value: isUnset ? void 0 : value,
52222 onChange
52223 }), !disableCustomDuotone && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_list_picker_default, {
52224 labels: [(0,external_wp_i18n_namespaceObject.__)("Shadows"), (0,external_wp_i18n_namespaceObject.__)("Highlights")],
52225 colors: colorPalette,
52226 value: isUnset ? void 0 : value,
52227 disableCustomColors,
52228 enableAlpha: true,
52229 onChange: (newColors) => {
52230 if (!newColors[0]) {
52231 newColors[0] = defaultDark;
52232 }
52233 if (!newColors[1]) {
52234 newColors[1] = defaultLight;
52235 }
52236 const newValue = newColors.length >= 2 ? newColors : void 0;
52237 onChange(newValue);
52238 }
52239 })]
52240 })
52241 })
52242 });
52243}
52244var duotone_picker_default = DuotonePicker;
52245
52246
52247;// ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-swatch.js
52248
52249
52250
52251
52252
52253function DuotoneSwatch({
52254 values
52255}) {
52256 return values ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_default, {
52257 colorValue: getGradientFromCSSColors(values, "135deg")
52258 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
52259 icon: swatch_default
52260 });
52261}
52262var duotone_swatch_default = DuotoneSwatch;
52263
52264
52265;// ./node_modules/@wordpress/components/build-module/external-link/index.js
52266
52267
52268
52269
52270function UnforwardedExternalLink(props, ref) {
52271 const {
52272 href,
52273 children,
52274 className,
52275 rel = "",
52276 ...additionalProps
52277 } = props;
52278 const optimizedRel = [...new Set([...rel.split(" "), "external", "noreferrer", "noopener"].filter(Boolean))].join(" ");
52279 const classes = dist_clsx("components-external-link", className);
52280 const isInternalAnchor = !!href?.startsWith("#");
52281 const onClickHandler = (event) => {
52282 if (isInternalAnchor) {
52283 event.preventDefault();
52284 }
52285 if (props.onClick) {
52286 props.onClick(event);
52287 }
52288 };
52289 return (
52290 /* eslint-disable react/jsx-no-target-blank */
52291 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", {
52292 ...additionalProps,
52293 className: classes,
52294 href,
52295 onClick: onClickHandler,
52296 target: "_blank",
52297 rel: optimizedRel,
52298 ref,
52299 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
52300 className: "components-external-link__contents",
52301 children
52302 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
52303 className: "components-external-link__icon",
52304 "aria-label": (
52305 /* translators: accessibility text */
52306 (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)")
52307 ),
52308 children: "\u2197"
52309 })]
52310 })
52311 );
52312}
52313const ExternalLink = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedExternalLink);
52314var external_link_default = ExternalLink;
52315
52316
52317;// ./node_modules/@wordpress/components/build-module/focal-point-picker/utils.js
52318const INITIAL_BOUNDS = {
52319 width: 200,
52320 height: 170
52321};
52322const VIDEO_EXTENSIONS = ["avi", "mpg", "mpeg", "mov", "mp4", "m4v", "ogg", "ogv", "webm", "wmv"];
52323function getExtension(filename = "") {
52324 const parts = filename.split(".");
52325 return parts[parts.length - 1];
52326}
52327function isVideoType(filename = "") {
52328 if (!filename) {
52329 return false;
52330 }
52331 return filename.startsWith("data:video/") || VIDEO_EXTENSIONS.includes(getExtension(filename));
52332}
52333function fractionToPercentage(fraction) {
52334 return Math.round(fraction * 100);
52335}
52336
52337
52338;// ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-picker-style.js
52339
52340function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() {
52341 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
52342}
52343
52344
52345
52346
52347
52348const MediaWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52349 target: "eeew7dm8"
52350} : 0)( true ? {
52351 name: "jqnsxy",
52352 styles: "background-color:transparent;display:flex;text-align:center;width:100%"
52353} : 0);
52354const MediaContainer = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52355 target: "eeew7dm7"
52356} : 0)("align-items:center;border-radius:", config_values_default.radiusSmall, ";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:100%;}" + ( true ? "" : 0));
52357const MediaPlaceholder = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52358 target: "eeew7dm6"
52359} : 0)("background:", COLORS.gray[100], ";border-radius:inherit;box-sizing:border-box;height:", INITIAL_BOUNDS.height, "px;max-width:280px;min-width:", INITIAL_BOUNDS.width, "px;width:100%;" + ( true ? "" : 0));
52360const focal_point_picker_style_StyledUnitControl = /* @__PURE__ */ emotion_styled_base_browser_esm(unit_control_default, true ? {
52361 target: "eeew7dm5"
52362} : 0)( true ? {
52363 name: "1d3w5wq",
52364 styles: "width:100%"
52365} : 0);
52366var focal_point_picker_style_ref2 = true ? {
52367 name: "1mn7kwb",
52368 styles: "padding-bottom:1em"
52369} : 0;
52370const deprecatedBottomMargin = ({
52371 __nextHasNoMarginBottom
52372}) => {
52373 return !__nextHasNoMarginBottom ? focal_point_picker_style_ref2 : void 0;
52374};
52375var focal_point_picker_style_ref = true ? {
52376 name: "1mn7kwb",
52377 styles: "padding-bottom:1em"
52378} : 0;
52379const extraHelpTextMargin = ({
52380 hasHelpText = false
52381}) => {
52382 return hasHelpText ? focal_point_picker_style_ref : void 0;
52383};
52384const ControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
52385 target: "eeew7dm4"
52386} : 0)("max-width:320px;padding-top:1em;", extraHelpTextMargin, " ", deprecatedBottomMargin, ";" + ( true ? "" : 0));
52387const GridView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52388 target: "eeew7dm3"
52389} : 0)("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:", ({
52390 showOverlay
52391}) => showOverlay ? 1 : 0, ";" + ( true ? "" : 0));
52392const GridLine = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52393 target: "eeew7dm2"
52394} : 0)( true ? {
52395 name: "1yzbo24",
52396 styles: "background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"
52397} : 0);
52398const GridLineX = /* @__PURE__ */ emotion_styled_base_browser_esm(GridLine, true ? {
52399 target: "eeew7dm1"
52400} : 0)( true ? {
52401 name: "1sw8ur",
52402 styles: "height:1px;left:1px;right:1px"
52403} : 0);
52404const GridLineY = /* @__PURE__ */ emotion_styled_base_browser_esm(GridLine, true ? {
52405 target: "eeew7dm0"
52406} : 0)( true ? {
52407 name: "188vg4t",
52408 styles: "width:1px;top:1px;bottom:1px"
52409} : 0);
52410
52411
52412;// ./node_modules/@wordpress/components/build-module/focal-point-picker/controls.js
52413
52414
52415
52416
52417const TEXTCONTROL_MIN = 0;
52418const TEXTCONTROL_MAX = 100;
52419const controls_noop = () => {
52420};
52421function FocalPointPickerControls({
52422 __nextHasNoMarginBottom,
52423 hasHelpText,
52424 onChange = controls_noop,
52425 point = {
52426 x: 0.5,
52427 y: 0.5
52428 }
52429}) {
52430 const valueX = fractionToPercentage(point.x);
52431 const valueY = fractionToPercentage(point.y);
52432 const handleChange = (value, axis) => {
52433 if (value === void 0) {
52434 return;
52435 }
52436 const num = parseInt(value, 10);
52437 if (!isNaN(num)) {
52438 onChange({
52439 ...point,
52440 [axis]: num / 100
52441 });
52442 }
52443 };
52444 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ControlWrapper, {
52445 className: "focal-point-picker__controls",
52446 __nextHasNoMarginBottom,
52447 hasHelpText,
52448 gap: 4,
52449 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointUnitControl, {
52450 label: (0,external_wp_i18n_namespaceObject.__)("Left"),
52451 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Focal point left position"),
52452 value: [valueX, "%"].join(""),
52453 onChange: (next) => handleChange(next, "x"),
52454 dragDirection: "e"
52455 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointUnitControl, {
52456 label: (0,external_wp_i18n_namespaceObject.__)("Top"),
52457 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Focal point top position"),
52458 value: [valueY, "%"].join(""),
52459 onChange: (next) => handleChange(next, "y"),
52460 dragDirection: "s"
52461 })]
52462 });
52463}
52464function FocalPointUnitControl(props) {
52465 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(focal_point_picker_style_StyledUnitControl, {
52466 __next40pxDefaultSize: true,
52467 className: "focal-point-picker__controls-position-unit-control",
52468 labelPosition: "top",
52469 max: TEXTCONTROL_MAX,
52470 min: TEXTCONTROL_MIN,
52471 units: [{
52472 value: "%",
52473 label: "%"
52474 }],
52475 ...props
52476 });
52477}
52478
52479
52480;// ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-style.js
52481
52482
52483const PointerCircle = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
52484 target: "e19snlhg0"
52485} : 0)("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:", config_values_default.radiusRound, ";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}", ({
52486 isDragging
52487}) => isDragging && `
52488 box-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;
52489 transform: scale( 1.1 );
52490 cursor: grabbing;
52491 `, ";" + ( true ? "" : 0));
52492
52493
52494;// ./node_modules/@wordpress/components/build-module/focal-point-picker/focal-point.js
52495
52496
52497function FocalPoint({
52498 left = "50%",
52499 top = "50%",
52500 ...props
52501}) {
52502 const style = {
52503 left,
52504 top
52505 };
52506 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PointerCircle, {
52507 ...props,
52508 className: "components-focal-point-picker__icon_container",
52509 style
52510 });
52511}
52512
52513
52514;// ./node_modules/@wordpress/components/build-module/focal-point-picker/grid.js
52515
52516
52517function FocalPointPickerGrid({
52518 bounds,
52519 ...props
52520}) {
52521 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(GridView, {
52522 ...props,
52523 className: "components-focal-point-picker__grid",
52524 style: {
52525 width: bounds.width,
52526 height: bounds.height
52527 },
52528 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineX, {
52529 style: {
52530 top: "33%"
52531 }
52532 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineX, {
52533 style: {
52534 top: "66%"
52535 }
52536 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineY, {
52537 style: {
52538 left: "33%"
52539 }
52540 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLineY, {
52541 style: {
52542 left: "66%"
52543 }
52544 })]
52545 });
52546}
52547
52548
52549;// ./node_modules/@wordpress/components/build-module/focal-point-picker/media.js
52550
52551
52552
52553function media_Media({
52554 alt,
52555 autoPlay,
52556 src,
52557 onLoad,
52558 mediaRef,
52559 // Exposing muted prop for test rendering purposes
52560 // https://github.com/testing-library/react-testing-library/issues/470
52561 muted = true,
52562 ...props
52563}) {
52564 if (!src) {
52565 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaPlaceholder, {
52566 className: "components-focal-point-picker__media components-focal-point-picker__media--placeholder",
52567 ref: mediaRef,
52568 ...props
52569 });
52570 }
52571 const isVideo = isVideoType(src);
52572 return isVideo ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("video", {
52573 ...props,
52574 autoPlay,
52575 className: "components-focal-point-picker__media components-focal-point-picker__media--video",
52576 loop: true,
52577 muted,
52578 onLoadedData: onLoad,
52579 ref: mediaRef,
52580 src
52581 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
52582 ...props,
52583 alt,
52584 className: "components-focal-point-picker__media components-focal-point-picker__media--image",
52585 onLoad,
52586 ref: mediaRef,
52587 src
52588 });
52589}
52590
52591
52592;// ./node_modules/@wordpress/components/build-module/focal-point-picker/index.js
52593
52594
52595
52596
52597
52598
52599
52600
52601
52602
52603
52604
52605
52606const GRID_OVERLAY_TIMEOUT = 600;
52607function FocalPointPicker({
52608 __nextHasNoMarginBottom,
52609 autoPlay = true,
52610 className,
52611 help,
52612 label,
52613 onChange,
52614 onDrag,
52615 onDragEnd,
52616 onDragStart,
52617 resolvePoint,
52618 url,
52619 value: valueProp = {
52620 x: 0.5,
52621 y: 0.5
52622 },
52623 ...restProps
52624}) {
52625 const [point, setPoint] = (0,external_wp_element_namespaceObject.useState)(valueProp);
52626 const [showGridOverlay, setShowGridOverlay] = (0,external_wp_element_namespaceObject.useState)(false);
52627 const {
52628 startDrag,
52629 endDrag,
52630 isDragging
52631 } = (0,external_wp_compose_namespaceObject.__experimentalUseDragging)({
52632 onDragStart: (event) => {
52633 dragAreaRef.current?.focus();
52634 const value = getValueWithinDragArea(event);
52635 if (!value) {
52636 return;
52637 }
52638 onDragStart?.(value, event);
52639 setPoint(value);
52640 },
52641 onDragMove: (event) => {
52642 event.preventDefault();
52643 const value = getValueWithinDragArea(event);
52644 if (!value) {
52645 return;
52646 }
52647 onDrag?.(value, event);
52648 setPoint(value);
52649 },
52650 onDragEnd: () => {
52651 onDragEnd?.();
52652 onChange?.(point);
52653 }
52654 });
52655 const {
52656 x,
52657 y
52658 } = isDragging ? point : valueProp;
52659 const dragAreaRef = (0,external_wp_element_namespaceObject.useRef)(null);
52660 const [bounds, setBounds] = (0,external_wp_element_namespaceObject.useState)(INITIAL_BOUNDS);
52661 const refUpdateBounds = (0,external_wp_element_namespaceObject.useRef)(() => {
52662 if (!dragAreaRef.current) {
52663 return;
52664 }
52665 const {
52666 clientWidth: width,
52667 clientHeight: height
52668 } = dragAreaRef.current;
52669 setBounds(width > 0 && height > 0 ? {
52670 width,
52671 height
52672 } : {
52673 ...INITIAL_BOUNDS
52674 });
52675 });
52676 (0,external_wp_element_namespaceObject.useEffect)(() => {
52677 const updateBounds = refUpdateBounds.current;
52678 if (!dragAreaRef.current) {
52679 return;
52680 }
52681 const {
52682 defaultView
52683 } = dragAreaRef.current.ownerDocument;
52684 defaultView?.addEventListener("resize", updateBounds);
52685 return () => defaultView?.removeEventListener("resize", updateBounds);
52686 }, []);
52687 (0,external_wp_compose_namespaceObject.useIsomorphicLayoutEffect)(() => void refUpdateBounds.current(), []);
52688 const getValueWithinDragArea = ({
52689 clientX,
52690 clientY,
52691 shiftKey
52692 }) => {
52693 if (!dragAreaRef.current) {
52694 return;
52695 }
52696 const {
52697 top,
52698 left
52699 } = dragAreaRef.current.getBoundingClientRect();
52700 let nextX = (clientX - left) / bounds.width;
52701 let nextY = (clientY - top) / bounds.height;
52702 if (shiftKey) {
52703 nextX = Math.round(nextX / 0.1) * 0.1;
52704 nextY = Math.round(nextY / 0.1) * 0.1;
52705 }
52706 return getFinalValue({
52707 x: nextX,
52708 y: nextY
52709 });
52710 };
52711 const getFinalValue = (value) => {
52712 var _resolvePoint;
52713 const resolvedValue = (_resolvePoint = resolvePoint?.(value)) !== null && _resolvePoint !== void 0 ? _resolvePoint : value;
52714 resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));
52715 resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));
52716 const roundToTwoDecimalPlaces = (n) => Math.round(n * 100) / 100;
52717 return {
52718 x: roundToTwoDecimalPlaces(resolvedValue.x),
52719 y: roundToTwoDecimalPlaces(resolvedValue.y)
52720 };
52721 };
52722 const arrowKeyStep = (event) => {
52723 const {
52724 code,
52725 shiftKey
52726 } = event;
52727 if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(code)) {
52728 return;
52729 }
52730 event.preventDefault();
52731 const value = {
52732 x,
52733 y
52734 };
52735 const step = shiftKey ? 0.1 : 0.01;
52736 const delta = code === "ArrowUp" || code === "ArrowLeft" ? -1 * step : step;
52737 const axis = code === "ArrowUp" || code === "ArrowDown" ? "y" : "x";
52738 value[axis] = value[axis] + delta;
52739 onChange?.(getFinalValue(value));
52740 };
52741 const focalPointPosition = {
52742 left: x !== void 0 ? x * bounds.width : 0.5 * bounds.width,
52743 top: y !== void 0 ? y * bounds.height : 0.5 * bounds.height
52744 };
52745 const classes = dist_clsx("components-focal-point-picker-control", className);
52746 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FocalPointPicker);
52747 const id = `inspector-focal-point-picker-control-${instanceId}`;
52748 use_update_effect_default(() => {
52749 setShowGridOverlay(true);
52750 const timeout = window.setTimeout(() => {
52751 setShowGridOverlay(false);
52752 }, GRID_OVERLAY_TIMEOUT);
52753 return () => window.clearTimeout(timeout);
52754 }, [x, y]);
52755 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control_default, {
52756 ...restProps,
52757 __nextHasNoMarginBottom,
52758 __associatedWPComponentName: "FocalPointPicker",
52759 label,
52760 id,
52761 help,
52762 className: classes,
52763 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaWrapper, {
52764 className: "components-focal-point-picker-wrapper",
52765 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MediaContainer, {
52766 className: "components-focal-point-picker",
52767 onKeyDown: arrowKeyStep,
52768 onMouseDown: startDrag,
52769 onBlur: () => {
52770 if (isDragging) {
52771 endDrag();
52772 }
52773 },
52774 ref: dragAreaRef,
52775 role: "button",
52776 tabIndex: -1,
52777 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointPickerGrid, {
52778 bounds,
52779 showOverlay: showGridOverlay
52780 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(media_Media, {
52781 alt: (0,external_wp_i18n_namespaceObject.__)("Media preview"),
52782 autoPlay,
52783 onLoad: refUpdateBounds.current,
52784 src: url
52785 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPoint, {
52786 ...focalPointPosition,
52787 isDragging
52788 })]
52789 })
52790 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocalPointPickerControls, {
52791 __nextHasNoMarginBottom,
52792 hasHelpText: !!help,
52793 point: {
52794 x,
52795 y
52796 },
52797 onChange: (value) => {
52798 onChange?.(getFinalValue(value));
52799 }
52800 })]
52801 });
52802}
52803var focal_point_picker_default = FocalPointPicker;
52804
52805
52806;// ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js
52807
52808
52809
52810function FocusableIframe({
52811 iframeRef,
52812 ...props
52813}) {
52814 const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([iframeRef, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]);
52815 external_wp_deprecated_default()("wp.components.FocusableIframe", {
52816 since: "5.9",
52817 alternative: "wp.compose.useFocusableIframe"
52818 });
52819 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
52820 ref,
52821 ...props
52822 });
52823}
52824
52825
52826;// ./node_modules/@wordpress/components/build-module/font-size-picker/styles.js
52827
52828function font_size_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
52829 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
52830}
52831
52832
52833
52834
52835
52836const styles_Container = /* @__PURE__ */ emotion_styled_base_browser_esm("fieldset", true ? {
52837 target: "e8tqeku4"
52838} : 0)( true ? {
52839 name: "k2q51s",
52840 styles: "border:0;margin:0;padding:0;display:contents"
52841} : 0);
52842const styles_Header = /* @__PURE__ */ emotion_styled_base_browser_esm(h_stack_component_component_default, true ? {
52843 target: "e8tqeku3"
52844} : 0)("height:", space(4), ";" + ( true ? "" : 0));
52845const HeaderToggle = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
52846 target: "e8tqeku2"
52847} : 0)("margin-top:", space(-1), ";" + ( true ? "" : 0));
52848const HeaderLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(base_control_default.VisualLabel, true ? {
52849 target: "e8tqeku1"
52850} : 0)("display:flex;gap:", space(1), ";justify-content:flex-start;margin-bottom:0;" + ( true ? "" : 0));
52851const StyledCustomSelectControl = /* @__PURE__ */ emotion_styled_base_browser_esm(custom_select_control_default, true ? {
52852 target: "e8tqeku0"
52853} : 0)( true ? {
52854 name: "anvx77",
52855 styles: ".components-custom-select-control__item .components-custom-select-control__item-hint{width:100%;}"
52856} : 0);
52857
52858
52859;// ./node_modules/@wordpress/components/build-module/font-size-picker/utils.js
52860function isSimpleCssValue(value) {
52861 const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;
52862 return sizeRegex.test(String(value));
52863}
52864function generateFontSizeHint(fontSize) {
52865 if (fontSize.hint) {
52866 return fontSize.hint;
52867 }
52868 if (isSimpleCssValue(fontSize.size)) {
52869 return String(fontSize.size);
52870 }
52871 return void 0;
52872}
52873
52874
52875;// ./node_modules/@wordpress/components/build-module/font-size-picker/font-size-picker-select.js
52876
52877
52878
52879
52880
52881const DEFAULT_OPTION = {
52882 key: "default",
52883 name: (0,external_wp_i18n_namespaceObject.__)("Default"),
52884 value: void 0
52885};
52886const FontSizePickerSelect = (props) => {
52887 const {
52888 __next40pxDefaultSize,
52889 fontSizes,
52890 value,
52891 size,
52892 valueMode = "literal",
52893 onChange
52894 } = props;
52895 const options = [DEFAULT_OPTION, ...fontSizes.map((fontSize) => {
52896 const hint = generateFontSizeHint(fontSize);
52897 return {
52898 key: fontSize.slug,
52899 name: fontSize.name || fontSize.slug,
52900 value: fontSize.size,
52901 hint
52902 };
52903 })];
52904 const selectedOption = (0,external_wp_element_namespaceObject.useMemo)(() => {
52905 var _options$find;
52906 if (value === void 0) {
52907 return DEFAULT_OPTION;
52908 }
52909 if (valueMode === "slug") {
52910 const optionBySlug = options.find((option) => option.key === value);
52911 if (optionBySlug) {
52912 return optionBySlug;
52913 }
52914 }
52915 return (_options$find = options.find((option) => option.value === value)) !== null && _options$find !== void 0 ? _options$find : DEFAULT_OPTION;
52916 }, [value, valueMode, options]);
52917 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledCustomSelectControl, {
52918 __next40pxDefaultSize,
52919 __shouldNotWarnDeprecated36pxSize: true,
52920 className: "components-font-size-picker__select",
52921 label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
52922 hideLabelFromVision: true,
52923 describedBy: (0,external_wp_i18n_namespaceObject.sprintf)(
52924 // translators: %s: Currently selected font size.
52925 (0,external_wp_i18n_namespaceObject.__)("Currently selected font size: %s"),
52926 selectedOption.name
52927 ),
52928 options,
52929 value: selectedOption,
52930 showSelectedHint: true,
52931 onChange: ({
52932 selectedItem
52933 }) => {
52934 const matchingFontSize = selectedItem.key === "default" ? void 0 : fontSizes.find((fontSize) => fontSize.slug === selectedItem.key);
52935 onChange(selectedItem.value, matchingFontSize);
52936 },
52937 size
52938 });
52939};
52940var font_size_picker_select_default = FontSizePickerSelect;
52941
52942
52943;// ./node_modules/@wordpress/components/build-module/font-size-picker/constants.js
52944
52945const T_SHIRT_ABBREVIATIONS = [
52946 /* translators: S stands for 'small' and is a size label. */
52947 (0,external_wp_i18n_namespaceObject.__)("S"),
52948 /* translators: M stands for 'medium' and is a size label. */
52949 (0,external_wp_i18n_namespaceObject.__)("M"),
52950 /* translators: L stands for 'large' and is a size label. */
52951 (0,external_wp_i18n_namespaceObject.__)("L"),
52952 /* translators: XL stands for 'extra large' and is a size label. */
52953 (0,external_wp_i18n_namespaceObject.__)("XL"),
52954 /* translators: XXL stands for 'extra extra large' and is a size label. */
52955 (0,external_wp_i18n_namespaceObject.__)("XXL")
52956];
52957const T_SHIRT_NAMES = [(0,external_wp_i18n_namespaceObject.__)("Small"), (0,external_wp_i18n_namespaceObject.__)("Medium"), (0,external_wp_i18n_namespaceObject.__)("Large"), (0,external_wp_i18n_namespaceObject.__)("Extra Large"), (0,external_wp_i18n_namespaceObject.__)("Extra Extra Large")];
52958
52959
52960;// ./node_modules/@wordpress/components/build-module/font-size-picker/font-size-picker-toggle-group.js
52961
52962
52963
52964
52965const FontSizePickerToggleGroup = (props) => {
52966 const {
52967 fontSizes,
52968 value,
52969 valueMode = "literal",
52970 __next40pxDefaultSize,
52971 size,
52972 onChange
52973 } = props;
52974 const currentValue = (() => {
52975 if (!value) {
52976 return void 0;
52977 }
52978 if (valueMode === "slug") {
52979 return String(value);
52980 }
52981 const matchingFontSizes = fontSizes.filter((fontSize) => fontSize.size === value);
52982 if (matchingFontSizes.length > 1) {
52983 return void 0;
52984 }
52985 const fontSizeBySize = fontSizes.find((fontSize) => fontSize.size === value);
52986 return fontSizeBySize?.slug;
52987 })();
52988 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
52989 __nextHasNoMarginBottom: true,
52990 __next40pxDefaultSize,
52991 __shouldNotWarnDeprecated36pxSize: true,
52992 label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
52993 hideLabelFromVision: true,
52994 value: currentValue,
52995 onChange: (newSlug) => {
52996 if (newSlug === void 0) {
52997 onChange(void 0);
52998 } else {
52999 const selectedFontSize = fontSizes.find((fontSize) => fontSize.slug === String(newSlug));
53000 if (selectedFontSize) {
53001 onChange(selectedFontSize.size, selectedFontSize);
53002 }
53003 }
53004 },
53005 isBlock: true,
53006 size,
53007 children: fontSizes.map((fontSize, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_option_component_component_default, {
53008 value: fontSize.slug,
53009 label: T_SHIRT_ABBREVIATIONS[index],
53010 "aria-label": fontSize.name || T_SHIRT_NAMES[index],
53011 showTooltip: true
53012 }, fontSize.slug))
53013 });
53014};
53015var font_size_picker_toggle_group_default = FontSizePickerToggleGroup;
53016
53017
53018;// ./node_modules/@wordpress/components/build-module/font-size-picker/index.js
53019
53020
53021
53022
53023
53024
53025
53026
53027
53028
53029
53030
53031
53032
53033const DEFAULT_UNITS = ["px", "em", "rem", "vw", "vh"];
53034const MAX_TOGGLE_GROUP_SIZES = 5;
53035const UnforwardedFontSizePicker = (props, ref) => {
53036 const {
53037 __next40pxDefaultSize = false,
53038 fallbackFontSize,
53039 fontSizes = [],
53040 disableCustomFontSizes = false,
53041 onChange,
53042 size = "default",
53043 units: unitsProp = DEFAULT_UNITS,
53044 value,
53045 valueMode = "literal",
53046 withSlider = false,
53047 withReset = true
53048 } = props;
53049 const labelId = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedFontSizePicker, "font-size-picker-label");
53050 const units = useCustomUnits({
53051 availableUnits: unitsProp
53052 });
53053 const selectedFontSize = (() => {
53054 if (!value) {
53055 return void 0;
53056 }
53057 if (valueMode === "slug") {
53058 return fontSizes.find((fontSize) => fontSize.slug === value);
53059 }
53060 return fontSizes.find((fontSize) => fontSize.size === value);
53061 })();
53062 const isCustomValue = !!value && !selectedFontSize;
53063 const [userRequestedCustom, setUserRequestedCustom] = (0,external_wp_element_namespaceObject.useState)(isCustomValue);
53064 const resolvedValueForControls = valueMode === "slug" ? selectedFontSize?.size : value;
53065 let currentPickerType;
53066 if (!disableCustomFontSizes && userRequestedCustom) {
53067 currentPickerType = "custom";
53068 } else {
53069 currentPickerType = fontSizes.length > MAX_TOGGLE_GROUP_SIZES ? "select" : "togglegroup";
53070 }
53071 if (fontSizes.length === 0 && disableCustomFontSizes) {
53072 return null;
53073 }
53074 const hasUnits = typeof resolvedValueForControls === "string" || typeof fontSizes[0]?.size === "string";
53075 const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(resolvedValueForControls, units);
53076 const isValueUnitRelative = !!valueUnit && ["em", "rem", "vw", "vh"].includes(valueUnit);
53077 const isDisabled = value === void 0;
53078 maybeWarnDeprecated36pxSize({
53079 componentName: "FontSizePicker",
53080 __next40pxDefaultSize,
53081 size
53082 });
53083 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Container, {
53084 ref,
53085 className: "components-font-size-picker",
53086 "aria-labelledby": labelId,
53087 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
53088 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Header, {
53089 className: "components-font-size-picker__header",
53090 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeaderLabel, {
53091 id: labelId,
53092 children: (0,external_wp_i18n_namespaceObject.__)("Font size")
53093 }), !disableCustomFontSizes && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeaderToggle, {
53094 label: currentPickerType === "custom" ? (0,external_wp_i18n_namespaceObject.__)("Use size preset") : (0,external_wp_i18n_namespaceObject.__)("Set custom size"),
53095 icon: settings_default,
53096 onClick: () => setUserRequestedCustom(!userRequestedCustom),
53097 isPressed: currentPickerType === "custom",
53098 size: "small"
53099 })]
53100 })
53101 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
53102 children: [currentPickerType === "select" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_picker_select_default, {
53103 __next40pxDefaultSize,
53104 fontSizes,
53105 value,
53106 valueMode,
53107 disableCustomFontSizes,
53108 size,
53109 onChange: (newValue, selectedItem) => {
53110 if (newValue === void 0) {
53111 onChange?.(void 0, selectedItem);
53112 } else {
53113 onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);
53114 }
53115 },
53116 onSelectCustom: () => setUserRequestedCustom(true)
53117 }), currentPickerType === "togglegroup" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_picker_toggle_group_default, {
53118 fontSizes,
53119 value,
53120 valueMode,
53121 __next40pxDefaultSize,
53122 size,
53123 onChange: (newValue, selectedItem) => {
53124 if (newValue === void 0) {
53125 onChange?.(void 0, selectedItem);
53126 } else {
53127 onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);
53128 }
53129 }
53130 }), currentPickerType === "custom" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(flex_component_component_default, {
53131 className: "components-font-size-picker__custom-size-control",
53132 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
53133 isBlock: true,
53134 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(unit_control_default, {
53135 __next40pxDefaultSize,
53136 __shouldNotWarnDeprecated36pxSize: true,
53137 label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
53138 labelPosition: "top",
53139 hideLabelFromVision: true,
53140 value: hasUnits ? `${valueQuantity !== null && valueQuantity !== void 0 ? valueQuantity : ""}${valueUnit !== null && valueUnit !== void 0 ? valueUnit : ""}` : resolvedValueForControls,
53141 onChange: (newValue) => {
53142 setUserRequestedCustom(true);
53143 if (newValue === void 0 || newValue === "") {
53144 onChange?.(void 0);
53145 } else {
53146 onChange?.(hasUnits ? newValue : parseInt(newValue, 10));
53147 }
53148 },
53149 size,
53150 units: hasUnits ? units : [],
53151 min: 0
53152 })
53153 }), withSlider && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
53154 isBlock: true,
53155 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
53156 marginX: 2,
53157 marginBottom: 0,
53158 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
53159 __nextHasNoMarginBottom: true,
53160 __next40pxDefaultSize,
53161 __shouldNotWarnDeprecated36pxSize: true,
53162 className: "components-font-size-picker__custom-input",
53163 label: (0,external_wp_i18n_namespaceObject.__)("Font size"),
53164 hideLabelFromVision: true,
53165 value: valueQuantity,
53166 initialPosition: fallbackFontSize,
53167 withInputField: false,
53168 onChange: (newValue) => {
53169 setUserRequestedCustom(true);
53170 if (newValue === void 0) {
53171 onChange?.(void 0);
53172 } else if (hasUnits) {
53173 onChange?.(newValue + (valueUnit !== null && valueUnit !== void 0 ? valueUnit : "px"));
53174 } else {
53175 onChange?.(newValue);
53176 }
53177 },
53178 min: 0,
53179 max: isValueUnitRelative ? 10 : 100,
53180 step: isValueUnitRelative ? 0.1 : 1
53181 })
53182 })
53183 }), withReset && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
53184 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Button, {
53185 disabled: isDisabled,
53186 accessibleWhenDisabled: true,
53187 onClick: () => {
53188 onChange?.(void 0);
53189 },
53190 variant: "secondary",
53191 __next40pxDefaultSize: true,
53192 size: size === "__unstable-large" || props.__next40pxDefaultSize ? "default" : "small",
53193 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
53194 })
53195 })]
53196 })]
53197 })]
53198 });
53199};
53200const FontSizePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedFontSizePicker);
53201var font_size_picker_default = FontSizePicker;
53202
53203
53204;// ./node_modules/@wordpress/components/build-module/form-file-upload/index.js
53205
53206
53207
53208
53209function FormFileUpload({
53210 accept,
53211 children,
53212 multiple = false,
53213 onChange,
53214 onClick,
53215 render,
53216 ...props
53217}) {
53218 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
53219 const openFileDialog = () => {
53220 ref.current?.click();
53221 };
53222 if (!render) {
53223 maybeWarnDeprecated36pxSize({
53224 componentName: "FormFileUpload",
53225 __next40pxDefaultSize: props.__next40pxDefaultSize,
53226 // @ts-expect-error - We don't "officially" support all Button props but this likely happens.
53227 size: props.size
53228 });
53229 }
53230 const ui = render ? render({
53231 openFileDialog
53232 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
53233 onClick: openFileDialog,
53234 ...props,
53235 children
53236 });
53237 const compatAccept = accept?.includes("audio/*") ? `${accept}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm` : accept;
53238 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
53239 className: "components-form-file-upload",
53240 children: [ui, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
53241 type: "file",
53242 ref,
53243 multiple,
53244 style: {
53245 display: "none"
53246 },
53247 accept: compatAccept,
53248 onChange,
53249 onClick,
53250 "data-testid": "form-file-upload-input"
53251 })]
53252 });
53253}
53254var form_file_upload_default = FormFileUpload;
53255
53256
53257;// ./node_modules/@wordpress/components/build-module/form-toggle/index.js
53258
53259
53260
53261const form_toggle_noop = () => {
53262};
53263function UnforwardedFormToggle(props, ref) {
53264 const {
53265 className,
53266 checked,
53267 id,
53268 disabled,
53269 onChange = form_toggle_noop,
53270 onClick,
53271 ...additionalProps
53272 } = props;
53273 const wrapperClasses = dist_clsx("components-form-toggle", className, {
53274 "is-checked": checked,
53275 "is-disabled": disabled
53276 });
53277 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
53278 className: wrapperClasses,
53279 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
53280 className: "components-form-toggle__input",
53281 id,
53282 type: "checkbox",
53283 checked,
53284 onChange,
53285 disabled,
53286 onClick: (event) => {
53287 event.currentTarget.focus();
53288 onClick?.(event);
53289 },
53290 ...additionalProps,
53291 ref
53292 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
53293 className: "components-form-toggle__track"
53294 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
53295 className: "components-form-toggle__thumb"
53296 })]
53297 });
53298}
53299const FormToggle = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedFormToggle);
53300var form_toggle_default = FormToggle;
53301
53302
53303;// ./node_modules/@wordpress/components/build-module/form-token-field/token.js
53304
53305
53306
53307
53308
53309
53310
53311const token_noop = () => {
53312};
53313function Token({
53314 value,
53315 status,
53316 title,
53317 displayTransform,
53318 isBorderless = false,
53319 disabled = false,
53320 onClickRemove = token_noop,
53321 onMouseEnter,
53322 onMouseLeave,
53323 messages,
53324 termPosition,
53325 termsCount
53326}) {
53327 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Token);
53328 const tokenClasses = dist_clsx("components-form-token-field__token", {
53329 "is-error": "error" === status,
53330 "is-success": "success" === status,
53331 "is-validating": "validating" === status,
53332 "is-borderless": isBorderless,
53333 "is-disabled": disabled
53334 });
53335 const onClick = () => onClickRemove({
53336 value
53337 });
53338 const transformedValue = displayTransform(value);
53339 const termPositionAndCount = (0,external_wp_i18n_namespaceObject.sprintf)(
53340 /* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
53341 (0,external_wp_i18n_namespaceObject.__)("%1$s (%2$d of %3$d)"),
53342 transformedValue,
53343 termPosition,
53344 termsCount
53345 );
53346 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
53347 className: tokenClasses,
53348 onMouseEnter,
53349 onMouseLeave,
53350 title,
53351 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
53352 className: "components-form-token-field__token-text",
53353 id: `components-form-token-field__token-text-${instanceId}`,
53354 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
53355 as: "span",
53356 children: termPositionAndCount
53357 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
53358 "aria-hidden": "true",
53359 children: transformedValue
53360 })]
53361 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
53362 className: "components-form-token-field__remove-token",
53363 size: "small",
53364 icon: close_small_default,
53365 onClick: !disabled ? onClick : void 0,
53366 disabled,
53367 label: messages.remove,
53368 "aria-describedby": `components-form-token-field__token-text-${instanceId}`
53369 })]
53370 });
53371}
53372
53373
53374;// ./node_modules/@wordpress/components/build-module/form-token-field/styles.js
53375
53376
53377
53378
53379
53380const deprecatedPaddings = ({
53381 __next40pxDefaultSize,
53382 hasTokens
53383}) => !__next40pxDefaultSize && /* @__PURE__ */ emotion_react_browser_esm_css("padding-top:", space(hasTokens ? 1 : 0.5), ";padding-bottom:", space(hasTokens ? 1 : 0.5), ";" + ( true ? "" : 0), true ? "" : 0);
53384const TokensAndInputWrapperFlex = /* @__PURE__ */ emotion_styled_base_browser_esm(flex_component_component_default, true ? {
53385 target: "ehq8nmi0"
53386} : 0)("padding:7px;", boxSizingReset, " ", deprecatedPaddings, ";" + ( true ? "" : 0));
53387
53388
53389;// ./node_modules/@wordpress/components/build-module/form-token-field/index.js
53390
53391
53392
53393
53394
53395
53396
53397
53398
53399
53400
53401
53402
53403
53404
53405
53406
53407
53408const form_token_field_identity = (value) => value;
53409function FormTokenField(props) {
53410 const {
53411 autoCapitalize,
53412 autoComplete,
53413 maxLength,
53414 placeholder,
53415 label = (0,external_wp_i18n_namespaceObject.__)("Add item"),
53416 className,
53417 suggestions = [],
53418 maxSuggestions = 100,
53419 value = [],
53420 displayTransform = form_token_field_identity,
53421 saveTransform = (token) => token.trim(),
53422 onChange = () => {
53423 },
53424 onInputChange = () => {
53425 },
53426 onFocus = void 0,
53427 isBorderless = false,
53428 disabled = false,
53429 tokenizeOnSpace = false,
53430 messages = {
53431 added: (0,external_wp_i18n_namespaceObject.__)("Item added."),
53432 removed: (0,external_wp_i18n_namespaceObject.__)("Item removed."),
53433 remove: (0,external_wp_i18n_namespaceObject.__)("Remove item"),
53434 __experimentalInvalid: (0,external_wp_i18n_namespaceObject.__)("Invalid item")
53435 },
53436 __experimentalRenderItem,
53437 __experimentalExpandOnFocus = false,
53438 __experimentalValidateInput = () => true,
53439 __experimentalShowHowTo = true,
53440 __next40pxDefaultSize = false,
53441 __experimentalAutoSelectFirstMatch = false,
53442 __nextHasNoMarginBottom = false,
53443 tokenizeOnBlur = false
53444 } = useDeprecated36pxDefaultSizeProp(props);
53445 if (!__nextHasNoMarginBottom) {
53446 external_wp_deprecated_default()("Bottom margin styles for wp.components.FormTokenField", {
53447 since: "6.7",
53448 version: "7.0",
53449 hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
53450 });
53451 }
53452 maybeWarnDeprecated36pxSize({
53453 componentName: "FormTokenField",
53454 size: void 0,
53455 __next40pxDefaultSize
53456 });
53457 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FormTokenField);
53458 const [incompleteTokenValue, setIncompleteTokenValue] = (0,external_wp_element_namespaceObject.useState)("");
53459 const [inputOffsetFromEnd, setInputOffsetFromEnd] = (0,external_wp_element_namespaceObject.useState)(0);
53460 const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
53461 const [isExpanded, setIsExpanded] = (0,external_wp_element_namespaceObject.useState)(false);
53462 const [selectedSuggestionIndex, setSelectedSuggestionIndex] = (0,external_wp_element_namespaceObject.useState)(-1);
53463 const [selectedSuggestionScroll, setSelectedSuggestionScroll] = (0,external_wp_element_namespaceObject.useState)(false);
53464 const prevSuggestions = (0,external_wp_compose_namespaceObject.usePrevious)(suggestions);
53465 const prevValue = (0,external_wp_compose_namespaceObject.usePrevious)(value);
53466 const input = (0,external_wp_element_namespaceObject.useRef)(null);
53467 const tokensAndInput = (0,external_wp_element_namespaceObject.useRef)(null);
53468 const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
53469 (0,external_wp_element_namespaceObject.useEffect)(() => {
53470 if (isActive && !hasFocus()) {
53471 focus();
53472 }
53473 }, [isActive]);
53474 (0,external_wp_element_namespaceObject.useEffect)(() => {
53475 const suggestionsDidUpdate = !external_wp_isShallowEqual_default()(suggestions, prevSuggestions || []);
53476 if (suggestionsDidUpdate || value !== prevValue) {
53477 updateSuggestions(suggestionsDidUpdate);
53478 }
53479 }, [suggestions, prevSuggestions, value, prevValue]);
53480 (0,external_wp_element_namespaceObject.useEffect)(() => {
53481 updateSuggestions();
53482 }, [incompleteTokenValue]);
53483 (0,external_wp_element_namespaceObject.useEffect)(() => {
53484 updateSuggestions();
53485 }, [__experimentalAutoSelectFirstMatch]);
53486 if (disabled && isActive) {
53487 setIsActive(false);
53488 setIncompleteTokenValue("");
53489 }
53490 function focus() {
53491 input.current?.focus();
53492 }
53493 function hasFocus() {
53494 return input.current === input.current?.ownerDocument.activeElement;
53495 }
53496 function onFocusHandler(event) {
53497 if (hasFocus() || event.target === tokensAndInput.current) {
53498 setIsActive(true);
53499 setIsExpanded(__experimentalExpandOnFocus || isExpanded);
53500 } else {
53501 setIsActive(false);
53502 }
53503 if ("function" === typeof onFocus) {
53504 onFocus(event);
53505 }
53506 }
53507 function onBlur(event) {
53508 if (inputHasValidValue() && __experimentalValidateInput(incompleteTokenValue)) {
53509 setIsActive(false);
53510 if (tokenizeOnBlur && inputHasValidValue()) {
53511 addNewToken(incompleteTokenValue);
53512 }
53513 } else {
53514 setIncompleteTokenValue("");
53515 setInputOffsetFromEnd(0);
53516 setIsActive(false);
53517 if (__experimentalExpandOnFocus) {
53518 const hasFocusWithin = event.relatedTarget === tokensAndInput.current;
53519 setIsExpanded(hasFocusWithin);
53520 } else {
53521 setIsExpanded(false);
53522 }
53523 setSelectedSuggestionIndex(-1);
53524 setSelectedSuggestionScroll(false);
53525 }
53526 }
53527 function onKeyDown(event) {
53528 let preventDefault = false;
53529 if (event.defaultPrevented) {
53530 return;
53531 }
53532 switch (event.key) {
53533 case "Backspace":
53534 preventDefault = handleDeleteKey(deleteTokenBeforeInput);
53535 break;
53536 case "Enter":
53537 preventDefault = addCurrentToken();
53538 break;
53539 case "ArrowLeft":
53540 preventDefault = handleLeftArrowKey();
53541 break;
53542 case "ArrowUp":
53543 preventDefault = handleUpArrowKey();
53544 break;
53545 case "ArrowRight":
53546 preventDefault = handleRightArrowKey();
53547 break;
53548 case "ArrowDown":
53549 preventDefault = handleDownArrowKey();
53550 break;
53551 case "Delete":
53552 preventDefault = handleDeleteKey(deleteTokenAfterInput);
53553 break;
53554 case "Space":
53555 if (tokenizeOnSpace) {
53556 preventDefault = addCurrentToken();
53557 }
53558 break;
53559 case "Escape":
53560 preventDefault = handleEscapeKey(event);
53561 break;
53562 case "Tab":
53563 preventDefault = handleTabKey(event);
53564 break;
53565 default:
53566 break;
53567 }
53568 if (preventDefault) {
53569 event.preventDefault();
53570 }
53571 }
53572 function onKeyPress(event) {
53573 let preventDefault = false;
53574 switch (event.key) {
53575 case ",":
53576 preventDefault = handleCommaKey();
53577 break;
53578 default:
53579 break;
53580 }
53581 if (preventDefault) {
53582 event.preventDefault();
53583 }
53584 }
53585 function onContainerTouched(event) {
53586 if (event.target === tokensAndInput.current && isActive) {
53587 event.preventDefault();
53588 }
53589 }
53590 function onTokenClickRemove(event) {
53591 deleteToken(event.value);
53592 focus();
53593 }
53594 function onSuggestionHovered(suggestion) {
53595 const index = getMatchingSuggestions().indexOf(suggestion);
53596 if (index >= 0) {
53597 setSelectedSuggestionIndex(index);
53598 setSelectedSuggestionScroll(false);
53599 }
53600 }
53601 function onSuggestionSelected(suggestion) {
53602 addNewToken(suggestion);
53603 }
53604 function onInputChangeHandler(event) {
53605 const text = event.value;
53606 const separator = tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
53607 const items = text.split(separator);
53608 const tokenValue = items[items.length - 1] || "";
53609 if (items.length > 1) {
53610 addNewTokens(items.slice(0, -1));
53611 }
53612 setIncompleteTokenValue(tokenValue);
53613 onInputChange(tokenValue);
53614 }
53615 function handleDeleteKey(_deleteToken) {
53616 let preventDefault = false;
53617 if (hasFocus() && isInputEmpty()) {
53618 _deleteToken();
53619 preventDefault = true;
53620 }
53621 return preventDefault;
53622 }
53623 function handleLeftArrowKey() {
53624 let preventDefault = false;
53625 if (isInputEmpty()) {
53626 moveInputBeforePreviousToken();
53627 preventDefault = true;
53628 }
53629 return preventDefault;
53630 }
53631 function handleRightArrowKey() {
53632 let preventDefault = false;
53633 if (isInputEmpty()) {
53634 moveInputAfterNextToken();
53635 preventDefault = true;
53636 }
53637 return preventDefault;
53638 }
53639 function handleUpArrowKey() {
53640 setSelectedSuggestionIndex((index) => {
53641 return (index === 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;
53642 });
53643 setSelectedSuggestionScroll(true);
53644 return true;
53645 }
53646 function handleDownArrowKey() {
53647 setSelectedSuggestionIndex((index) => {
53648 return (index + 1) % getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length;
53649 });
53650 setSelectedSuggestionScroll(true);
53651 return true;
53652 }
53653 function collapseSuggestionsList(event) {
53654 if (event.target instanceof HTMLInputElement) {
53655 setIncompleteTokenValue(event.target.value);
53656 setIsExpanded(false);
53657 setSelectedSuggestionIndex(-1);
53658 setSelectedSuggestionScroll(false);
53659 }
53660 }
53661 function handleEscapeKey(event) {
53662 collapseSuggestionsList(event);
53663 return true;
53664 }
53665 function handleTabKey(event) {
53666 collapseSuggestionsList(event);
53667 return false;
53668 }
53669 function handleCommaKey() {
53670 if (inputHasValidValue()) {
53671 addNewToken(incompleteTokenValue);
53672 }
53673 return true;
53674 }
53675 function moveInputToIndex(index) {
53676 setInputOffsetFromEnd(value.length - Math.max(index, -1) - 1);
53677 }
53678 function moveInputBeforePreviousToken() {
53679 setInputOffsetFromEnd((prevInputOffsetFromEnd) => {
53680 return Math.min(prevInputOffsetFromEnd + 1, value.length);
53681 });
53682 }
53683 function moveInputAfterNextToken() {
53684 setInputOffsetFromEnd((prevInputOffsetFromEnd) => {
53685 return Math.max(prevInputOffsetFromEnd - 1, 0);
53686 });
53687 }
53688 function deleteTokenBeforeInput() {
53689 const index = getIndexOfInput() - 1;
53690 if (index > -1) {
53691 deleteToken(value[index]);
53692 }
53693 }
53694 function deleteTokenAfterInput() {
53695 const index = getIndexOfInput();
53696 if (index < value.length) {
53697 deleteToken(value[index]);
53698 moveInputToIndex(index);
53699 }
53700 }
53701 function addCurrentToken() {
53702 let preventDefault = false;
53703 const selectedSuggestion = getSelectedSuggestion();
53704 if (selectedSuggestion) {
53705 addNewToken(selectedSuggestion);
53706 preventDefault = true;
53707 } else if (inputHasValidValue()) {
53708 addNewToken(incompleteTokenValue);
53709 preventDefault = true;
53710 }
53711 return preventDefault;
53712 }
53713 function addNewTokens(tokens) {
53714 const tokensToAdd = [...new Set(tokens.map(saveTransform).filter(Boolean).filter((token) => !valueContainsToken(token)))];
53715 if (tokensToAdd.length > 0) {
53716 const newValue = [...value];
53717 newValue.splice(getIndexOfInput(), 0, ...tokensToAdd);
53718 onChange(newValue);
53719 }
53720 }
53721 function addNewToken(token) {
53722 if (!__experimentalValidateInput(token)) {
53723 (0,external_wp_a11y_namespaceObject.speak)(messages.__experimentalInvalid, "assertive");
53724 return;
53725 }
53726 addNewTokens([token]);
53727 (0,external_wp_a11y_namespaceObject.speak)(messages.added, "assertive");
53728 setIncompleteTokenValue("");
53729 setSelectedSuggestionIndex(-1);
53730 setSelectedSuggestionScroll(false);
53731 setIsExpanded(!__experimentalExpandOnFocus);
53732 if (isActive && !tokenizeOnBlur) {
53733 focus();
53734 }
53735 }
53736 function deleteToken(token) {
53737 const newTokens = value.filter((item) => {
53738 return getTokenValue(item) !== getTokenValue(token);
53739 });
53740 onChange(newTokens);
53741 (0,external_wp_a11y_namespaceObject.speak)(messages.removed, "assertive");
53742 }
53743 function getTokenValue(token) {
53744 if ("object" === typeof token) {
53745 return token.value;
53746 }
53747 return token;
53748 }
53749 function getMatchingSuggestions(searchValue = incompleteTokenValue, _suggestions = suggestions, _value = value, _maxSuggestions = maxSuggestions, _saveTransform = saveTransform) {
53750 let match = _saveTransform(searchValue);
53751 const startsWithMatch = [];
53752 const containsMatch = [];
53753 const normalizedValue = _value.map((item) => {
53754 if (typeof item === "string") {
53755 return item;
53756 }
53757 return item.value;
53758 });
53759 if (match.length === 0) {
53760 _suggestions = _suggestions.filter((suggestion) => !normalizedValue.includes(suggestion));
53761 } else {
53762 match = match.normalize("NFKC").toLocaleLowerCase();
53763 _suggestions.forEach((suggestion) => {
53764 const index = suggestion.normalize("NFKC").toLocaleLowerCase().indexOf(match);
53765 if (normalizedValue.indexOf(suggestion) === -1) {
53766 if (index === 0) {
53767 startsWithMatch.push(suggestion);
53768 } else if (index > 0) {
53769 containsMatch.push(suggestion);
53770 }
53771 }
53772 });
53773 _suggestions = startsWithMatch.concat(containsMatch);
53774 }
53775 return _suggestions.slice(0, _maxSuggestions);
53776 }
53777 function getSelectedSuggestion() {
53778 if (selectedSuggestionIndex !== -1) {
53779 return getMatchingSuggestions()[selectedSuggestionIndex];
53780 }
53781 return void 0;
53782 }
53783 function valueContainsToken(token) {
53784 return value.some((item) => {
53785 return getTokenValue(token) === getTokenValue(item);
53786 });
53787 }
53788 function getIndexOfInput() {
53789 return value.length - inputOffsetFromEnd;
53790 }
53791 function isInputEmpty() {
53792 return incompleteTokenValue.length === 0;
53793 }
53794 function inputHasValidValue() {
53795 return saveTransform(incompleteTokenValue).length > 0;
53796 }
53797 function updateSuggestions(resetSelectedSuggestion = true) {
53798 const inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
53799 const matchingSuggestions2 = getMatchingSuggestions(incompleteTokenValue);
53800 const hasMatchingSuggestions = matchingSuggestions2.length > 0;
53801 const shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;
53802 setIsExpanded(shouldExpandIfFocuses || inputHasMinimumChars && hasMatchingSuggestions);
53803 if (resetSelectedSuggestion) {
53804 if (__experimentalAutoSelectFirstMatch && inputHasMinimumChars && hasMatchingSuggestions) {
53805 setSelectedSuggestionIndex(0);
53806 setSelectedSuggestionScroll(true);
53807 } else {
53808 setSelectedSuggestionIndex(-1);
53809 setSelectedSuggestionScroll(false);
53810 }
53811 }
53812 if (inputHasMinimumChars) {
53813 const message = hasMatchingSuggestions ? (0,external_wp_i18n_namespaceObject.sprintf)(
53814 /* translators: %d: number of results. */
53815 (0,external_wp_i18n_namespaceObject._n)("%d result found, use up and down arrow keys to navigate.", "%d results found, use up and down arrow keys to navigate.", matchingSuggestions2.length),
53816 matchingSuggestions2.length
53817 ) : (0,external_wp_i18n_namespaceObject.__)("No results.");
53818 debouncedSpeak(message, "assertive");
53819 }
53820 }
53821 function renderTokensAndInput() {
53822 const components = value.map(renderToken);
53823 components.splice(getIndexOfInput(), 0, renderInput());
53824 return components;
53825 }
53826 function renderToken(token, index, tokens) {
53827 const _value = getTokenValue(token);
53828 const status = typeof token !== "string" ? token.status : void 0;
53829 const termPosition = index + 1;
53830 const termsCount = tokens.length;
53831 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_item_component_component_default, {
53832 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Token, {
53833 value: _value,
53834 status,
53835 title: typeof token !== "string" ? token.title : void 0,
53836 displayTransform,
53837 onClickRemove: onTokenClickRemove,
53838 isBorderless: typeof token !== "string" && token.isBorderless || isBorderless,
53839 onMouseEnter: typeof token !== "string" ? token.onMouseEnter : void 0,
53840 onMouseLeave: typeof token !== "string" ? token.onMouseLeave : void 0,
53841 disabled: "error" !== status && disabled,
53842 messages,
53843 termsCount,
53844 termPosition
53845 })
53846 }, "token-" + _value);
53847 }
53848 function renderInput() {
53849 const inputProps = {
53850 instanceId,
53851 autoCapitalize,
53852 autoComplete,
53853 placeholder: value.length === 0 ? placeholder : "",
53854 disabled,
53855 value: incompleteTokenValue,
53856 onBlur,
53857 isExpanded,
53858 selectedSuggestionIndex
53859 };
53860 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(token_input_default, {
53861 ...inputProps,
53862 onChange: !(maxLength && value.length >= maxLength) ? onInputChangeHandler : void 0,
53863 ref: input
53864 }, "input");
53865 }
53866 const classes = dist_clsx(className, "components-form-token-field__input-container", {
53867 "is-active": isActive,
53868 "is-disabled": disabled
53869 });
53870 let tokenFieldProps = {
53871 className: "components-form-token-field",
53872 tabIndex: -1
53873 };
53874 const matchingSuggestions = getMatchingSuggestions();
53875 if (!disabled) {
53876 tokenFieldProps = Object.assign({}, tokenFieldProps, {
53877 onKeyDown: withIgnoreIMEEvents(onKeyDown),
53878 onKeyPress,
53879 onFocus: onFocusHandler
53880 });
53881 }
53882 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
53883 ...tokenFieldProps,
53884 children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledLabel, {
53885 htmlFor: `components-form-token-input-${instanceId}`,
53886 className: "components-form-token-field__label",
53887 children: label
53888 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
53889 ref: tokensAndInput,
53890 className: classes,
53891 tabIndex: -1,
53892 onMouseDown: onContainerTouched,
53893 onTouchStart: onContainerTouched,
53894 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TokensAndInputWrapperFlex, {
53895 justify: "flex-start",
53896 align: "center",
53897 gap: 1,
53898 wrap: true,
53899 __next40pxDefaultSize,
53900 hasTokens: !!value.length,
53901 children: renderTokensAndInput()
53902 }), isExpanded && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(suggestions_list_default, {
53903 instanceId,
53904 match: saveTransform(incompleteTokenValue),
53905 displayTransform,
53906 suggestions: matchingSuggestions,
53907 selectedIndex: selectedSuggestionIndex,
53908 scrollIntoView: selectedSuggestionScroll,
53909 onHover: onSuggestionHovered,
53910 onSelect: onSuggestionSelected,
53911 __experimentalRenderItem
53912 })]
53913 }), !__nextHasNoMarginBottom && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component_component_default, {
53914 marginBottom: 2
53915 }), __experimentalShowHowTo && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
53916 id: `components-form-token-suggestions-howto-${instanceId}`,
53917 className: "components-form-token-field__help",
53918 __nextHasNoMarginBottom,
53919 children: tokenizeOnSpace ? (0,external_wp_i18n_namespaceObject.__)("Separate with commas, spaces, or the Enter key.") : (0,external_wp_i18n_namespaceObject.__)("Separate with commas or the Enter key.")
53920 })]
53921 });
53922}
53923var form_token_field_default = FormTokenField;
53924
53925
53926;// ./node_modules/@wordpress/components/build-module/guide/icons.js
53927
53928
53929const PageControlIcon = () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
53930 width: "8",
53931 height: "8",
53932 fill: "none",
53933 xmlns: "http://www.w3.org/2000/svg",
53934 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, {
53935 cx: "4",
53936 cy: "4",
53937 r: "4"
53938 })
53939});
53940
53941
53942;// ./node_modules/@wordpress/components/build-module/guide/page-control.js
53943
53944
53945
53946
53947function PageControl({
53948 currentPage,
53949 numberOfPages,
53950 setCurrentPage
53951}) {
53952 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
53953 className: "components-guide__page-control",
53954 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Guide controls"),
53955 children: Array.from({
53956 length: numberOfPages
53957 }).map((_, page) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
53958 // Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current
53959 "aria-current": page === currentPage ? "step" : void 0,
53960 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
53961 size: "small",
53962 icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageControlIcon, {}),
53963 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
53964 /* translators: 1: current page number 2: total number of pages */
53965 (0,external_wp_i18n_namespaceObject.__)("Page %1$d of %2$d"),
53966 page + 1,
53967 numberOfPages
53968 ),
53969 onClick: () => setCurrentPage(page)
53970 }, page)
53971 }, page))
53972 });
53973}
53974
53975
53976;// ./node_modules/@wordpress/components/build-module/guide/index.js
53977
53978
53979
53980
53981
53982
53983
53984
53985function Guide({
53986 children,
53987 className,
53988 contentLabel,
53989 finishButtonText = (0,external_wp_i18n_namespaceObject.__)("Finish"),
53990 nextButtonText = (0,external_wp_i18n_namespaceObject.__)("Next"),
53991 previousButtonText = (0,external_wp_i18n_namespaceObject.__)("Previous"),
53992 onFinish,
53993 pages = []
53994}) {
53995 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
53996 const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(0);
53997 (0,external_wp_element_namespaceObject.useEffect)(() => {
53998 const frame = ref.current?.querySelector(".components-guide");
53999 if (frame instanceof HTMLElement) {
54000 frame.focus();
54001 }
54002 }, [currentPage]);
54003 (0,external_wp_element_namespaceObject.useEffect)(() => {
54004 if (external_wp_element_namespaceObject.Children.count(children)) {
54005 external_wp_deprecated_default()("Passing children to <Guide>", {
54006 since: "5.5",
54007 alternative: "the `pages` prop"
54008 });
54009 }
54010 }, [children]);
54011 if (external_wp_element_namespaceObject.Children.count(children)) {
54012 var _Children$map;
54013 pages = (_Children$map = external_wp_element_namespaceObject.Children.map(children, (child) => ({
54014 content: child
54015 }))) !== null && _Children$map !== void 0 ? _Children$map : [];
54016 }
54017 const canGoBack = currentPage > 0;
54018 const canGoForward = currentPage < pages.length - 1;
54019 const goBack = () => {
54020 if (canGoBack) {
54021 setCurrentPage(currentPage - 1);
54022 }
54023 };
54024 const goForward = () => {
54025 if (canGoForward) {
54026 setCurrentPage(currentPage + 1);
54027 }
54028 };
54029 if (pages.length === 0) {
54030 return null;
54031 }
54032 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(modal_default, {
54033 className: dist_clsx("components-guide", className),
54034 contentLabel,
54035 isDismissible: pages.length > 1,
54036 onRequestClose: onFinish,
54037 onKeyDown: (event) => {
54038 if (event.code === "ArrowLeft") {
54039 goBack();
54040 event.preventDefault();
54041 } else if (event.code === "ArrowRight") {
54042 goForward();
54043 event.preventDefault();
54044 }
54045 },
54046 ref,
54047 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
54048 className: "components-guide__container",
54049 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
54050 className: "components-guide__page",
54051 children: [pages[currentPage].image, pages.length > 1 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PageControl, {
54052 currentPage,
54053 numberOfPages: pages.length,
54054 setCurrentPage
54055 }), pages[currentPage].content]
54056 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
54057 className: "components-guide__footer",
54058 children: [canGoBack && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
54059 className: "components-guide__back-button",
54060 variant: "tertiary",
54061 onClick: goBack,
54062 __next40pxDefaultSize: true,
54063 children: previousButtonText
54064 }), canGoForward && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
54065 className: "components-guide__forward-button",
54066 variant: "primary",
54067 onClick: goForward,
54068 __next40pxDefaultSize: true,
54069 children: nextButtonText
54070 }), !canGoForward && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
54071 className: "components-guide__finish-button",
54072 variant: "primary",
54073 onClick: onFinish,
54074 __next40pxDefaultSize: true,
54075 children: finishButtonText
54076 })]
54077 })]
54078 })
54079 });
54080}
54081var guide_default = Guide;
54082
54083
54084;// ./node_modules/@wordpress/components/build-module/guide/page.js
54085
54086
54087
54088function GuidePage(props) {
54089 (0,external_wp_element_namespaceObject.useEffect)(() => {
54090 external_wp_deprecated_default()("<GuidePage>", {
54091 since: "5.5",
54092 alternative: "the `pages` prop in <Guide>"
54093 });
54094 }, []);
54095 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
54096 ...props
54097 });
54098}
54099
54100
54101;// ./node_modules/@wordpress/components/build-module/button/deprecated.js
54102
54103
54104
54105
54106function UnforwardedIconButton({
54107 label,
54108 labelPosition,
54109 size,
54110 tooltip,
54111 ...props
54112}, ref) {
54113 external_wp_deprecated_default()("wp.components.IconButton", {
54114 since: "5.4",
54115 alternative: "wp.components.Button",
54116 version: "6.2"
54117 });
54118 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
54119 ...props,
54120 ref,
54121 tooltipPosition: labelPosition,
54122 iconSize: size,
54123 showTooltip: tooltip !== void 0 ? !!tooltip : void 0,
54124 label: tooltip || label
54125 });
54126}
54127var deprecated_default = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedIconButton);
54128
54129
54130;// ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js
54131
54132
54133
54134function KeyboardShortcut({
54135 target,
54136 callback,
54137 shortcut,
54138 bindGlobal,
54139 eventName
54140}) {
54141 (0,external_wp_compose_namespaceObject.useKeyboardShortcut)(shortcut, callback, {
54142 bindGlobal,
54143 target,
54144 eventName
54145 });
54146 return null;
54147}
54148function KeyboardShortcuts({
54149 children,
54150 shortcuts,
54151 bindGlobal,
54152 eventName
54153}) {
54154 const target = (0,external_wp_element_namespaceObject.useRef)(null);
54155 const element = Object.entries(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {}).map(([shortcut, callback]) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyboardShortcut, {
54156 shortcut,
54157 callback,
54158 bindGlobal,
54159 eventName,
54160 target
54161 }, shortcut));
54162 if (!external_wp_element_namespaceObject.Children.count(children)) {
54163 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
54164 children: element
54165 });
54166 }
54167 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
54168 ref: target,
54169 children: [element, children]
54170 });
54171}
54172var keyboard_shortcuts_default = KeyboardShortcuts;
54173
54174
54175;// ./node_modules/@wordpress/components/build-module/menu-group/index.js
54176
54177
54178
54179
54180function MenuGroup(props) {
54181 const {
54182 children,
54183 className = "",
54184 label,
54185 hideSeparator
54186 } = props;
54187 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MenuGroup);
54188 if (!external_wp_element_namespaceObject.Children.count(children)) {
54189 return null;
54190 }
54191 const labelId = `components-menu-group-label-${instanceId}`;
54192 const classNames = dist_clsx(className, "components-menu-group", {
54193 "has-hidden-separator": hideSeparator
54194 });
54195 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
54196 className: classNames,
54197 children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
54198 className: "components-menu-group__label",
54199 id: labelId,
54200 "aria-hidden": "true",
54201 children: label
54202 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
54203 role: "group",
54204 "aria-labelledby": label ? labelId : void 0,
54205 children
54206 })]
54207 });
54208}
54209var menu_group_default = MenuGroup;
54210
54211
54212;// ./node_modules/@wordpress/components/build-module/menu-item/index.js
54213
54214
54215
54216
54217
54218
54219function UnforwardedMenuItem(props, ref) {
54220 let {
54221 children,
54222 info,
54223 className,
54224 icon,
54225 iconPosition = "right",
54226 shortcut,
54227 isSelected,
54228 role = "menuitem",
54229 suffix,
54230 ...buttonProps
54231 } = props;
54232 className = dist_clsx("components-menu-item__button", className);
54233 if (info) {
54234 children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
54235 className: "components-menu-item__info-wrapper",
54236 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
54237 className: "components-menu-item__item",
54238 children
54239 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
54240 className: "components-menu-item__info",
54241 children: info
54242 })]
54243 });
54244 }
54245 if (icon && typeof icon !== "string") {
54246 icon = (0,external_wp_element_namespaceObject.cloneElement)(icon, {
54247 className: dist_clsx("components-menu-items__item-icon", {
54248 "has-icon-right": iconPosition === "right"
54249 })
54250 });
54251 }
54252 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(button_default, {
54253 __next40pxDefaultSize: true,
54254 ref,
54255 "aria-checked": role === "menuitemcheckbox" || role === "menuitemradio" ? isSelected : void 0,
54256 role,
54257 icon: iconPosition === "left" ? icon : void 0,
54258 className,
54259 accessibleWhenDisabled: true,
54260 ...buttonProps,
54261 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
54262 className: "components-menu-item__item",
54263 children
54264 }), !suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, {
54265 className: "components-menu-item__shortcut",
54266 shortcut
54267 }), !suffix && icon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
54268 icon
54269 }), suffix]
54270 });
54271}
54272const MenuItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedMenuItem);
54273var menu_item_default = MenuItem;
54274
54275
54276;// ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
54277
54278
54279
54280const menu_items_choice_noop = () => {
54281};
54282function MenuItemsChoice({
54283 choices = [],
54284 onHover = menu_items_choice_noop,
54285 onSelect,
54286 value
54287}) {
54288 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
54289 children: choices.map((item) => {
54290 const isSelected = value === item.value;
54291 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
54292 role: "menuitemradio",
54293 disabled: item.disabled,
54294 icon: isSelected ? check_default : null,
54295 info: item.info,
54296 isSelected,
54297 shortcut: item.shortcut,
54298 className: "components-menu-items-choice",
54299 onClick: () => {
54300 if (!isSelected) {
54301 onSelect(item.value);
54302 }
54303 },
54304 onMouseEnter: () => onHover(item.value),
54305 onMouseLeave: () => onHover(null),
54306 "aria-label": item["aria-label"],
54307 children: item.label
54308 }, item.value);
54309 })
54310 });
54311}
54312var menu_items_choice_default = MenuItemsChoice;
54313
54314
54315;// ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js
54316
54317
54318
54319function UnforwardedTabbableContainer({
54320 eventToOffset,
54321 ...props
54322}, ref) {
54323 const innerEventToOffset = (evt) => {
54324 const {
54325 code,
54326 shiftKey
54327 } = evt;
54328 if ("Tab" === code) {
54329 return shiftKey ? -1 : 1;
54330 }
54331 if (eventToOffset) {
54332 return eventToOffset(evt);
54333 }
54334 return void 0;
54335 };
54336 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(container_default, {
54337 ref,
54338 stopNavigationEvents: true,
54339 onlyBrowserTabstops: true,
54340 eventToOffset: innerEventToOffset,
54341 ...props
54342 });
54343}
54344const TabbableContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabbableContainer);
54345var tabbable_default = TabbableContainer;
54346
54347
54348;// ./node_modules/@wordpress/components/build-module/navigation/constants.js
54349const ROOT_MENU = "root";
54350const SEARCH_FOCUS_DELAY = 100;
54351
54352
54353;// ./node_modules/@wordpress/components/build-module/navigation/context.js
54354
54355
54356const context_noop = () => {
54357};
54358const defaultIsEmpty = () => false;
54359const defaultGetter = () => void 0;
54360const NavigationContext = (0,external_wp_element_namespaceObject.createContext)({
54361 activeItem: void 0,
54362 activeMenu: ROOT_MENU,
54363 setActiveMenu: context_noop,
54364 navigationTree: {
54365 items: {},
54366 getItem: defaultGetter,
54367 addItem: context_noop,
54368 removeItem: context_noop,
54369 menus: {},
54370 getMenu: defaultGetter,
54371 addMenu: context_noop,
54372 removeMenu: context_noop,
54373 childMenu: {},
54374 traverseMenu: context_noop,
54375 isMenuEmpty: defaultIsEmpty
54376 }
54377});
54378NavigationContext.displayName = "NavigationContext";
54379const useNavigationContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationContext);
54380
54381
54382;// ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js
54383
54384function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
54385 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
54386}
54387
54388
54389
54390
54391
54392
54393
54394const NavigationUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
54395 target: "eeiismy11"
54396} : 0)("width:100%;box-sizing:border-box;padding:0 ", space(4), ";overflow:hidden;" + ( true ? "" : 0));
54397const MenuUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
54398 target: "eeiismy10"
54399} : 0)("margin-top:", space(6), ";margin-bottom:", space(6), ";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:", space(6), ";}.components-navigation__group+.components-navigation__group{margin-top:", space(6), ";}" + ( true ? "" : 0));
54400const MenuBackButtonUI = /* @__PURE__ */ emotion_styled_base_browser_esm(button_default, true ? {
54401 target: "eeiismy9"
54402} : 0)( true ? {
54403 name: "26l0q2",
54404 styles: "&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"
54405} : 0);
54406const MenuTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
54407 target: "eeiismy8"
54408} : 0)( true ? {
54409 name: "1aubja5",
54410 styles: "overflow:hidden;width:100%"
54411} : 0);
54412const MenuTitleSearchControlWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
54413 target: "eeiismy7"
54414} : 0)( true ? {
54415 name: "rgorny",
54416 styles: "margin:11px 0;padding:1px"
54417} : 0);
54418const MenuTitleActionsUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
54419 target: "eeiismy6"
54420} : 0)("height:", space(6), ";.components-button.is-small{color:inherit;opacity:0.7;margin-right:", space(1), ";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}" + ( true ? "" : 0));
54421const GroupTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm(heading_component_component_default, true ? {
54422 target: "eeiismy5"
54423} : 0)("min-height:", space(12), ";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:", space(2), ";padding:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? `${space(1)} ${space(4)} ${space(1)} ${space(2)}` : `${space(1)} ${space(2)} ${space(1)} ${space(4)}`, ";" + ( true ? "" : 0));
54424const ItemBaseUI = /* @__PURE__ */ emotion_styled_base_browser_esm("li", true ? {
54425 target: "eeiismy4"
54426} : 0)("border-radius:", config_values_default.radiusSmall, ";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:", space(2), " ", space(4), ";", rtl({
54427 textAlign: "left"
54428}, {
54429 textAlign: "right"
54430}), " &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:", COLORS.theme.accent, ";color:", COLORS.theme.accentInverted, ";>button,.components-button:hover,>a{color:", COLORS.theme.accentInverted, ";opacity:1;}}>svg path{color:", COLORS.gray[600], ";}" + ( true ? "" : 0));
54431const ItemUI = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
54432 target: "eeiismy3"
54433} : 0)("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:", space(1.5), " ", space(4), ";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;" + ( true ? "" : 0));
54434const ItemIconUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
54435 target: "eeiismy2"
54436} : 0)("display:flex;margin-right:", space(2), ";" + ( true ? "" : 0));
54437const ItemBadgeUI = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
54438 target: "eeiismy1"
54439} : 0)("margin-left:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? "0" : space(2), ";margin-right:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? space(2) : "0", ";display:inline-flex;padding:", space(1), " ", space(3), ";border-radius:", config_values_default.radiusSmall, ";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}" + ( true ? "" : 0));
54440const ItemTitleUI = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
54441 target: "eeiismy0"
54442} : 0)(() => (0,external_wp_i18n_namespaceObject.isRTL)() ? "margin-left: auto;" : "margin-right: auto;", " font-size:14px;line-height:20px;color:inherit;" + ( true ? "" : 0));
54443
54444
54445;// ./node_modules/@wordpress/components/build-module/navigation/use-navigation-tree-nodes.js
54446
54447function useNavigationTreeNodes() {
54448 const [nodes, setNodes] = (0,external_wp_element_namespaceObject.useState)({});
54449 const getNode = (key) => nodes[key];
54450 const addNode = (key, value) => {
54451 const {
54452 children,
54453 ...newNode
54454 } = value;
54455 return setNodes((original) => ({
54456 ...original,
54457 [key]: newNode
54458 }));
54459 };
54460 const removeNode = (key) => {
54461 return setNodes((original) => {
54462 const {
54463 [key]: removedNode,
54464 ...remainingNodes
54465 } = original;
54466 return remainingNodes;
54467 });
54468 };
54469 return {
54470 nodes,
54471 getNode,
54472 addNode,
54473 removeNode
54474 };
54475}
54476
54477
54478;// ./node_modules/@wordpress/components/build-module/navigation/use-create-navigation-tree.js
54479
54480
54481const useCreateNavigationTree = () => {
54482 const {
54483 nodes: items,
54484 getNode: getItem,
54485 addNode: addItem,
54486 removeNode: removeItem
54487 } = useNavigationTreeNodes();
54488 const {
54489 nodes: menus,
54490 getNode: getMenu,
54491 addNode: addMenu,
54492 removeNode: removeMenu
54493 } = useNavigationTreeNodes();
54494 const [childMenu, setChildMenu] = (0,external_wp_element_namespaceObject.useState)({});
54495 const getChildMenu = (menu) => childMenu[menu] || [];
54496 const traverseMenu = (startMenu, callback) => {
54497 const visited = [];
54498 let queue = [startMenu];
54499 let current;
54500 while (queue.length > 0) {
54501 current = getMenu(queue.shift());
54502 if (!current || visited.includes(current.menu)) {
54503 continue;
54504 }
54505 visited.push(current.menu);
54506 queue = [...queue, ...getChildMenu(current.menu)];
54507 if (callback(current) === false) {
54508 break;
54509 }
54510 }
54511 };
54512 const isMenuEmpty = (menuToCheck) => {
54513 let isEmpty = true;
54514 traverseMenu(menuToCheck, (current) => {
54515 if (!current.isEmpty) {
54516 isEmpty = false;
54517 return false;
54518 }
54519 return void 0;
54520 });
54521 return isEmpty;
54522 };
54523 return {
54524 items,
54525 getItem,
54526 addItem,
54527 removeItem,
54528 menus,
54529 getMenu,
54530 addMenu: (key, value) => {
54531 setChildMenu((state) => {
54532 const newState = {
54533 ...state
54534 };
54535 if (!value.parentMenu) {
54536 return newState;
54537 }
54538 if (!newState[value.parentMenu]) {
54539 newState[value.parentMenu] = [];
54540 }
54541 newState[value.parentMenu].push(key);
54542 return newState;
54543 });
54544 addMenu(key, value);
54545 },
54546 removeMenu,
54547 childMenu,
54548 traverseMenu,
54549 isMenuEmpty
54550 };
54551};
54552
54553
54554;// ./node_modules/@wordpress/components/build-module/navigation/index.js
54555
54556
54557
54558
54559
54560
54561
54562
54563
54564
54565const navigation_noop = () => {
54566};
54567function Navigation({
54568 activeItem,
54569 activeMenu = ROOT_MENU,
54570 children,
54571 className,
54572 onActivateMenu = navigation_noop
54573}) {
54574 const [menu, setMenu] = (0,external_wp_element_namespaceObject.useState)(activeMenu);
54575 const [slideOrigin, setSlideOrigin] = (0,external_wp_element_namespaceObject.useState)();
54576 const navigationTree = useCreateNavigationTree();
54577 const defaultSlideOrigin = (0,external_wp_i18n_namespaceObject.isRTL)() ? "right" : "left";
54578 external_wp_deprecated_default()("wp.components.Navigation (and all subcomponents)", {
54579 since: "6.8",
54580 version: "7.1",
54581 alternative: "wp.components.Navigator"
54582 });
54583 const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {
54584 if (!navigationTree.getMenu(menuId)) {
54585 return;
54586 }
54587 setSlideOrigin(slideInOrigin);
54588 setMenu(menuId);
54589 onActivateMenu(menuId);
54590 };
54591 const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
54592 (0,external_wp_element_namespaceObject.useEffect)(() => {
54593 if (!isMountedRef.current) {
54594 isMountedRef.current = true;
54595 }
54596 }, []);
54597 (0,external_wp_element_namespaceObject.useEffect)(() => {
54598 if (activeMenu !== menu) {
54599 setActiveMenu(activeMenu);
54600 }
54601 }, [activeMenu]);
54602 const context = {
54603 activeItem,
54604 activeMenu: menu,
54605 setActiveMenu,
54606 navigationTree
54607 };
54608 const classes = dist_clsx("components-navigation", className);
54609 const animateClassName = getAnimateClassName({
54610 type: "slide-in",
54611 origin: slideOrigin
54612 });
54613 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationUI, {
54614 className: classes,
54615 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
54616 className: animateClassName ? dist_clsx({
54617 [animateClassName]: isMountedRef.current && slideOrigin
54618 }) : void 0,
54619 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationContext.Provider, {
54620 value: context,
54621 children
54622 })
54623 }, menu)
54624 });
54625}
54626var navigation_default = Navigation;
54627
54628
54629;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
54630
54631
54632var chevron_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
54633
54634
54635;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
54636
54637
54638var chevron_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
54639
54640
54641;// ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js
54642
54643
54644
54645
54646
54647
54648
54649function UnforwardedNavigationBackButton({
54650 backButtonLabel,
54651 className,
54652 href,
54653 onClick,
54654 parentMenu
54655}, ref) {
54656 const {
54657 setActiveMenu,
54658 navigationTree
54659 } = useNavigationContext();
54660 const classes = dist_clsx("components-navigation__back-button", className);
54661 const parentMenuTitle = parentMenu !== void 0 ? navigationTree.getMenu(parentMenu)?.title : void 0;
54662 const handleOnClick = (event) => {
54663 if (typeof onClick === "function") {
54664 onClick(event);
54665 }
54666 const animationDirection = (0,external_wp_i18n_namespaceObject.isRTL)() ? "left" : "right";
54667 if (parentMenu && !event.defaultPrevented) {
54668 setActiveMenu(parentMenu, animationDirection);
54669 }
54670 };
54671 const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default;
54672 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuBackButtonUI, {
54673 __next40pxDefaultSize: true,
54674 className: classes,
54675 href,
54676 variant: "tertiary",
54677 ref,
54678 onClick: handleOnClick,
54679 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
54680 icon
54681 }), backButtonLabel || parentMenuTitle || (0,external_wp_i18n_namespaceObject.__)("Back")]
54682 });
54683}
54684const NavigationBackButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigationBackButton);
54685var back_button_default = NavigationBackButton;
54686
54687
54688;// ./node_modules/@wordpress/components/build-module/navigation/group/context.js
54689
54690const NavigationGroupContext = (0,external_wp_element_namespaceObject.createContext)({
54691 group: void 0
54692});
54693NavigationGroupContext.displayName = "NavigationGroupContext";
54694const useNavigationGroupContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationGroupContext);
54695
54696
54697;// ./node_modules/@wordpress/components/build-module/navigation/group/index.js
54698
54699
54700
54701
54702
54703
54704let uniqueId = 0;
54705function NavigationGroup({
54706 children,
54707 className,
54708 title
54709}) {
54710 const [groupId] = (0,external_wp_element_namespaceObject.useState)(`group-${++uniqueId}`);
54711 const {
54712 navigationTree: {
54713 items
54714 }
54715 } = useNavigationContext();
54716 const context = {
54717 group: groupId
54718 };
54719 if (!Object.values(items).some((item) => item.group === groupId && item._isVisible)) {
54720 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationGroupContext.Provider, {
54721 value: context,
54722 children
54723 });
54724 }
54725 const groupTitleId = `components-navigation__group-title-${groupId}`;
54726 const classes = dist_clsx("components-navigation__group", className);
54727 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationGroupContext.Provider, {
54728 value: context,
54729 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
54730 className: classes,
54731 children: [title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupTitleUI, {
54732 className: "components-navigation__group-title",
54733 id: groupTitleId,
54734 level: 3,
54735 children: title
54736 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
54737 "aria-labelledby": groupTitleId,
54738 role: "group",
54739 children
54740 })]
54741 })
54742 });
54743}
54744var group_default = NavigationGroup;
54745
54746
54747;// ./node_modules/@wordpress/components/build-module/navigation/item/base-content.js
54748
54749
54750function NavigationItemBaseContent(props) {
54751 const {
54752 badge,
54753 title
54754 } = props;
54755 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
54756 children: [title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemTitleUI, {
54757 className: "components-navigation__item-title",
54758 as: "span",
54759 children: title
54760 }), badge && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBadgeUI, {
54761 className: "components-navigation__item-badge",
54762 children: badge
54763 })]
54764 });
54765}
54766
54767
54768;// ./node_modules/@wordpress/components/build-module/navigation/menu/context.js
54769
54770const NavigationMenuContext = (0,external_wp_element_namespaceObject.createContext)({
54771 menu: void 0,
54772 search: ""
54773});
54774NavigationMenuContext.displayName = "NavigationMenuContext";
54775const useNavigationMenuContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationMenuContext);
54776
54777
54778;// ./node_modules/@wordpress/components/build-module/navigation/utils.js
54779
54780const normalizeInput = (input) => remove_accents_default()(input).replace(/^\//, "").toLowerCase();
54781const normalizedSearch = (title, search) => -1 !== normalizeInput(title).indexOf(normalizeInput(search));
54782
54783
54784;// ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js
54785
54786
54787
54788
54789
54790const useNavigationTreeItem = (itemId, props) => {
54791 const {
54792 activeMenu,
54793 navigationTree: {
54794 addItem,
54795 removeItem
54796 }
54797 } = useNavigationContext();
54798 const {
54799 group
54800 } = useNavigationGroupContext();
54801 const {
54802 menu,
54803 search
54804 } = useNavigationMenuContext();
54805 (0,external_wp_element_namespaceObject.useEffect)(() => {
54806 const isMenuActive = activeMenu === menu;
54807 const isItemVisible = !search || props.title !== void 0 && normalizedSearch(props.title, search);
54808 addItem(itemId, {
54809 ...props,
54810 group,
54811 menu,
54812 _isVisible: isMenuActive && isItemVisible
54813 });
54814 return () => {
54815 removeItem(itemId);
54816 };
54817 }, [activeMenu, search]);
54818};
54819
54820
54821;// ./node_modules/@wordpress/components/build-module/navigation/item/base.js
54822
54823
54824
54825
54826
54827
54828let base_uniqueId = 0;
54829function NavigationItemBase(props) {
54830 const {
54831 children,
54832 className,
54833 title,
54834 href,
54835 ...restProps
54836 } = props;
54837 const [itemId] = (0,external_wp_element_namespaceObject.useState)(`item-${++base_uniqueId}`);
54838 useNavigationTreeItem(itemId, props);
54839 const {
54840 navigationTree
54841 } = useNavigationContext();
54842 if (!navigationTree.getItem(itemId)?._isVisible) {
54843 return null;
54844 }
54845 const classes = dist_clsx("components-navigation__item", className);
54846 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBaseUI, {
54847 className: classes,
54848 ...restProps,
54849 children
54850 });
54851}
54852
54853
54854;// ./node_modules/@wordpress/components/build-module/navigation/item/index.js
54855
54856
54857
54858
54859
54860
54861
54862
54863
54864const item_noop = () => {
54865};
54866function NavigationItem(props) {
54867 const {
54868 badge,
54869 children,
54870 className,
54871 href,
54872 item,
54873 navigateToMenu,
54874 onClick = item_noop,
54875 title,
54876 icon,
54877 hideIfTargetMenuEmpty,
54878 isText,
54879 ...restProps
54880 } = props;
54881 const {
54882 activeItem,
54883 setActiveMenu,
54884 navigationTree: {
54885 isMenuEmpty
54886 }
54887 } = useNavigationContext();
54888 if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
54889 return null;
54890 }
54891 const isActive = item && activeItem === item;
54892 const classes = dist_clsx(className, {
54893 "is-active": isActive
54894 });
54895 const onItemClick = (event) => {
54896 if (navigateToMenu) {
54897 setActiveMenu(navigateToMenu);
54898 }
54899 onClick(event);
54900 };
54901 const navigationIcon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default;
54902 const baseProps = children ? props : {
54903 ...props,
54904 onClick: void 0
54905 };
54906 const itemProps = isText ? restProps : {
54907 as: button_default,
54908 __next40pxDefaultSize: "as" in restProps ? restProps.as === void 0 : true,
54909 href,
54910 onClick: onItemClick,
54911 "aria-current": isActive ? "page" : void 0,
54912 ...restProps
54913 };
54914 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBase, {
54915 ...baseProps,
54916 className: classes,
54917 children: children || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemUI, {
54918 ...itemProps,
54919 children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemIconUI, {
54920 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
54921 icon
54922 })
54923 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBaseContent, {
54924 title,
54925 badge
54926 }), navigateToMenu && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
54927 icon: navigationIcon
54928 })]
54929 })
54930 });
54931}
54932var item_item_default = NavigationItem;
54933
54934
54935;// ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js
54936
54937
54938
54939const useNavigationTreeMenu = (props) => {
54940 const {
54941 navigationTree: {
54942 addMenu,
54943 removeMenu
54944 }
54945 } = useNavigationContext();
54946 const key = props.menu || ROOT_MENU;
54947 (0,external_wp_element_namespaceObject.useEffect)(() => {
54948 addMenu(key, {
54949 ...props,
54950 menu: key
54951 });
54952 return () => {
54953 removeMenu(key);
54954 };
54955 }, []);
54956};
54957
54958
54959;// ./node_modules/@wordpress/icons/build-module/library/search.js
54960
54961
54962var search_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
54963
54964
54965;// ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js
54966
54967
54968
54969var with_spoken_messages_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((Component) => (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
54970 ...props,
54971 speak: external_wp_a11y_namespaceObject.speak,
54972 debouncedSpeak: (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500)
54973}), "withSpokenMessages");
54974
54975
54976;// ./node_modules/@wordpress/components/build-module/search-control/styles.js
54977
54978function search_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
54979 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
54980}
54981
54982
54983const StyledInputControl = /* @__PURE__ */ emotion_styled_base_browser_esm(input_control_default, true ? {
54984 target: "effl84m1"
54985} : 0)( true ? {
54986 name: "37btb2",
54987 styles: "input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}"
54988} : 0);
54989const StyledIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
54990 target: "effl84m0"
54991} : 0)( true ? {
54992 name: "1i54h4p",
54993 styles: "&:dir( ltr ){transform:scaleX( -1 );}"
54994} : 0);
54995
54996
54997;// ./node_modules/@wordpress/components/build-module/search-control/index.js
54998
54999
55000
55001
55002
55003
55004
55005
55006
55007
55008
55009
55010function SuffixItem({
55011 searchRef,
55012 value,
55013 onChange,
55014 onClose
55015}) {
55016 if (!onClose && !value) {
55017 return null;
55018 }
55019 if (onClose) {
55020 external_wp_deprecated_default()("`onClose` prop in wp.components.SearchControl", {
55021 since: "6.8"
55022 });
55023 }
55024 const onReset = () => {
55025 onChange("");
55026 searchRef.current?.focus();
55027 };
55028 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlSuffixWrapper, {
55029 variant: "control",
55030 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
55031 size: "small",
55032 icon: close_small_default,
55033 label: onClose ? (0,external_wp_i18n_namespaceObject.__)("Close search") : (0,external_wp_i18n_namespaceObject.__)("Reset search"),
55034 onClick: onClose !== null && onClose !== void 0 ? onClose : onReset
55035 })
55036 });
55037}
55038function UnforwardedSearchControl({
55039 __nextHasNoMarginBottom = false,
55040 className,
55041 onChange,
55042 value,
55043 label = (0,external_wp_i18n_namespaceObject.__)("Search"),
55044 placeholder = (0,external_wp_i18n_namespaceObject.__)("Search"),
55045 hideLabelFromVision = true,
55046 onClose,
55047 size = "default",
55048 ...restProps
55049}, forwardedRef) {
55050 const {
55051 disabled,
55052 ...filteredRestProps
55053 } = restProps;
55054 const searchRef = (0,external_wp_element_namespaceObject.useRef)(null);
55055 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SearchControl, "components-search-control");
55056 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
55057 BaseControl: {
55058 // Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system
55059 // to provide backwards compatible margin for SearchControl.
55060 // (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)
55061 _overrides: {
55062 __nextHasNoMarginBottom
55063 },
55064 __associatedWPComponentName: "SearchControl"
55065 }
55066 }), [__nextHasNoMarginBottom]);
55067 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
55068 value: contextValue,
55069 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledInputControl, {
55070 __next40pxDefaultSize: true,
55071 id: instanceId,
55072 hideLabelFromVision,
55073 label,
55074 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([searchRef, forwardedRef]),
55075 type: "search",
55076 size,
55077 className: dist_clsx("components-search-control", className),
55078 onChange: (nextValue) => onChange(nextValue !== null && nextValue !== void 0 ? nextValue : ""),
55079 autoComplete: "off",
55080 placeholder,
55081 value: value !== null && value !== void 0 ? value : "",
55082 prefix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InputControlPrefixWrapper, {
55083 variant: "icon",
55084 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledIcon, {
55085 icon: search_default,
55086 fill: "currentColor"
55087 })
55088 }),
55089 suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SuffixItem, {
55090 searchRef,
55091 value,
55092 onChange,
55093 onClose
55094 }),
55095 ...filteredRestProps
55096 })
55097 });
55098}
55099const SearchControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSearchControl);
55100var search_control_default = SearchControl;
55101
55102
55103;// ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js
55104
55105
55106
55107
55108
55109
55110
55111
55112
55113function MenuTitleSearch({
55114 debouncedSpeak,
55115 onCloseSearch,
55116 onSearch,
55117 search,
55118 title
55119}) {
55120 const {
55121 navigationTree: {
55122 items
55123 }
55124 } = useNavigationContext();
55125 const {
55126 menu
55127 } = useNavigationMenuContext();
55128 const inputRef = (0,external_wp_element_namespaceObject.useRef)(null);
55129 (0,external_wp_element_namespaceObject.useEffect)(() => {
55130 const delayedFocus = setTimeout(() => {
55131 inputRef.current?.focus();
55132 }, SEARCH_FOCUS_DELAY);
55133 return () => {
55134 clearTimeout(delayedFocus);
55135 };
55136 }, []);
55137 (0,external_wp_element_namespaceObject.useEffect)(() => {
55138 if (!search) {
55139 return;
55140 }
55141 const count = Object.values(items).filter((item) => item._isVisible).length;
55142 const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
55143 /* translators: %d: number of results. */
55144 (0,external_wp_i18n_namespaceObject._n)("%d result found.", "%d results found.", count),
55145 count
55146 );
55147 debouncedSpeak(resultsFoundMessage);
55148 }, [items, search]);
55149 const onClose = () => {
55150 onSearch?.("");
55151 onCloseSearch();
55152 };
55153 const onKeyDown = (event) => {
55154 if (event.code === "Escape" && !event.defaultPrevented) {
55155 event.preventDefault();
55156 onClose();
55157 }
55158 };
55159 const inputId = `components-navigation__menu-title-search-${menu}`;
55160 const placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
55161 /* translators: placeholder for menu search box. %s: menu title */
55162 (0,external_wp_i18n_namespaceObject.__)("Search %s"),
55163 title?.toLowerCase() || ""
55164 ).trim();
55165 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuTitleSearchControlWrapper, {
55166 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(search_control_default, {
55167 __nextHasNoMarginBottom: true,
55168 className: "components-navigation__menu-search-input",
55169 id: inputId,
55170 onChange: (value) => onSearch?.(value),
55171 onKeyDown,
55172 placeholder,
55173 onClose,
55174 ref: inputRef,
55175 value: search
55176 })
55177 });
55178}
55179var menu_title_search_default = with_spoken_messages_default(MenuTitleSearch);
55180
55181
55182;// ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js
55183
55184
55185
55186
55187
55188
55189
55190
55191
55192
55193function NavigationMenuTitle({
55194 hasSearch,
55195 onSearch,
55196 search,
55197 title,
55198 titleAction
55199}) {
55200 const [isSearching, setIsSearching] = (0,external_wp_element_namespaceObject.useState)(false);
55201 const {
55202 menu
55203 } = useNavigationMenuContext();
55204 const searchButtonRef = (0,external_wp_element_namespaceObject.useRef)(null);
55205 if (!title) {
55206 return null;
55207 }
55208 const onCloseSearch = () => {
55209 setIsSearching(false);
55210 setTimeout(() => {
55211 searchButtonRef.current?.focus();
55212 }, SEARCH_FOCUS_DELAY);
55213 };
55214 const menuTitleId = `components-navigation__menu-title-${menu}`;
55215 const searchButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Search in %s"), title);
55216 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuTitleUI, {
55217 className: "components-navigation__menu-title",
55218 children: [!isSearching && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(GroupTitleUI, {
55219 as: "h2",
55220 className: "components-navigation__menu-title-heading",
55221 level: 3,
55222 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
55223 id: menuTitleId,
55224 children: title
55225 }), (hasSearch || titleAction) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuTitleActionsUI, {
55226 children: [titleAction, hasSearch && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
55227 size: "small",
55228 variant: "tertiary",
55229 label: searchButtonLabel,
55230 onClick: () => setIsSearching(true),
55231 ref: searchButtonRef,
55232 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
55233 icon: search_default
55234 })
55235 })]
55236 })]
55237 }), isSearching && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
55238 className: getAnimateClassName({
55239 type: "slide-in",
55240 origin: "left"
55241 }),
55242 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_title_search_default, {
55243 onCloseSearch,
55244 onSearch,
55245 search,
55246 title
55247 })
55248 })]
55249 });
55250}
55251
55252
55253;// ./node_modules/@wordpress/components/build-module/navigation/menu/search-no-results-found.js
55254
55255
55256
55257
55258function NavigationSearchNoResultsFound({
55259 search
55260}) {
55261 const {
55262 navigationTree: {
55263 items
55264 }
55265 } = useNavigationContext();
55266 const resultsCount = Object.values(items).filter((item) => item._isVisible).length;
55267 if (!search || !!resultsCount) {
55268 return null;
55269 }
55270 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBaseUI, {
55271 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemUI, {
55272 children: [(0,external_wp_i18n_namespaceObject.__)("No results found."), " "]
55273 })
55274 });
55275}
55276
55277
55278;// ./node_modules/@wordpress/components/build-module/navigation/menu/index.js
55279
55280
55281
55282
55283
55284
55285
55286
55287
55288
55289
55290
55291function NavigationMenu(props) {
55292 const {
55293 backButtonLabel,
55294 children,
55295 className,
55296 hasSearch,
55297 menu = ROOT_MENU,
55298 onBackButtonClick,
55299 onSearch: setControlledSearch,
55300 parentMenu,
55301 search: controlledSearch,
55302 isSearchDebouncing,
55303 title,
55304 titleAction
55305 } = props;
55306 const [uncontrolledSearch, setUncontrolledSearch] = (0,external_wp_element_namespaceObject.useState)("");
55307 useNavigationTreeMenu(props);
55308 const {
55309 activeMenu
55310 } = useNavigationContext();
55311 const context = {
55312 menu,
55313 search: uncontrolledSearch
55314 };
55315 if (activeMenu !== menu) {
55316 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContext.Provider, {
55317 value: context,
55318 children
55319 });
55320 }
55321 const isControlledSearch = !!setControlledSearch;
55322 const search = isControlledSearch ? controlledSearch : uncontrolledSearch;
55323 const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
55324 const menuTitleId = `components-navigation__menu-title-${menu}`;
55325 const classes = dist_clsx("components-navigation__menu", className);
55326 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContext.Provider, {
55327 value: context,
55328 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(MenuUI, {
55329 className: classes,
55330 children: [(parentMenu || onBackButtonClick) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button_default, {
55331 backButtonLabel,
55332 parentMenu,
55333 onClick: onBackButtonClick
55334 }), title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuTitle, {
55335 hasSearch,
55336 onSearch,
55337 search,
55338 title,
55339 titleAction
55340 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_menu_default, {
55341 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
55342 "aria-labelledby": menuTitleId,
55343 children: [children, search && !isSearchDebouncing && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationSearchNoResultsFound, {
55344 search
55345 })]
55346 })
55347 })]
55348 })
55349 });
55350}
55351var navigation_menu_menu_default = NavigationMenu;
55352
55353
55354;// ./node_modules/path-to-regexp/dist.es2015/index.js
55355/**
55356 * Tokenize input string.
55357 */
55358function lexer(str) {
55359 var tokens = [];
55360 var i = 0;
55361 while (i < str.length) {
55362 var char = str[i];
55363 if (char === "*" || char === "+" || char === "?") {
55364 tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
55365 continue;
55366 }
55367 if (char === "\\") {
55368 tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
55369 continue;
55370 }
55371 if (char === "{") {
55372 tokens.push({ type: "OPEN", index: i, value: str[i++] });
55373 continue;
55374 }
55375 if (char === "}") {
55376 tokens.push({ type: "CLOSE", index: i, value: str[i++] });
55377 continue;
55378 }
55379 if (char === ":") {
55380 var name = "";
55381 var j = i + 1;
55382 while (j < str.length) {
55383 var code = str.charCodeAt(j);
55384 if (
55385 // `0-9`
55386 (code >= 48 && code <= 57) ||
55387 // `A-Z`
55388 (code >= 65 && code <= 90) ||
55389 // `a-z`
55390 (code >= 97 && code <= 122) ||
55391 // `_`
55392 code === 95) {
55393 name += str[j++];
55394 continue;
55395 }
55396 break;
55397 }
55398 if (!name)
55399 throw new TypeError("Missing parameter name at ".concat(i));
55400 tokens.push({ type: "NAME", index: i, value: name });
55401 i = j;
55402 continue;
55403 }
55404 if (char === "(") {
55405 var count = 1;
55406 var pattern = "";
55407 var j = i + 1;
55408 if (str[j] === "?") {
55409 throw new TypeError("Pattern cannot start with \"?\" at ".concat(j));
55410 }
55411 while (j < str.length) {
55412 if (str[j] === "\\") {
55413 pattern += str[j++] + str[j++];
55414 continue;
55415 }
55416 if (str[j] === ")") {
55417 count--;
55418 if (count === 0) {
55419 j++;
55420 break;
55421 }
55422 }
55423 else if (str[j] === "(") {
55424 count++;
55425 if (str[j + 1] !== "?") {
55426 throw new TypeError("Capturing groups are not allowed at ".concat(j));
55427 }
55428 }
55429 pattern += str[j++];
55430 }
55431 if (count)
55432 throw new TypeError("Unbalanced pattern at ".concat(i));
55433 if (!pattern)
55434 throw new TypeError("Missing pattern at ".concat(i));
55435 tokens.push({ type: "PATTERN", index: i, value: pattern });
55436 i = j;
55437 continue;
55438 }
55439 tokens.push({ type: "CHAR", index: i, value: str[i++] });
55440 }
55441 tokens.push({ type: "END", index: i, value: "" });
55442 return tokens;
55443}
55444/**
55445 * Parse a string for the raw tokens.
55446 */
55447function dist_es2015_parse(str, options) {
55448 if (options === void 0) { options = {}; }
55449 var tokens = lexer(str);
55450 var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a, _b = options.delimiter, delimiter = _b === void 0 ? "/#?" : _b;
55451 var result = [];
55452 var key = 0;
55453 var i = 0;
55454 var path = "";
55455 var tryConsume = function (type) {
55456 if (i < tokens.length && tokens[i].type === type)
55457 return tokens[i++].value;
55458 };
55459 var mustConsume = function (type) {
55460 var value = tryConsume(type);
55461 if (value !== undefined)
55462 return value;
55463 var _a = tokens[i], nextType = _a.type, index = _a.index;
55464 throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
55465 };
55466 var consumeText = function () {
55467 var result = "";
55468 var value;
55469 while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) {
55470 result += value;
55471 }
55472 return result;
55473 };
55474 var isSafe = function (value) {
55475 for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
55476 var char = delimiter_1[_i];
55477 if (value.indexOf(char) > -1)
55478 return true;
55479 }
55480 return false;
55481 };
55482 var safePattern = function (prefix) {
55483 var prev = result[result.length - 1];
55484 var prevText = prefix || (prev && typeof prev === "string" ? prev : "");
55485 if (prev && !prevText) {
55486 throw new TypeError("Must have text between two parameters, missing text after \"".concat(prev.name, "\""));
55487 }
55488 if (!prevText || isSafe(prevText))
55489 return "[^".concat(escapeString(delimiter), "]+?");
55490 return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
55491 };
55492 while (i < tokens.length) {
55493 var char = tryConsume("CHAR");
55494 var name = tryConsume("NAME");
55495 var pattern = tryConsume("PATTERN");
55496 if (name || pattern) {
55497 var prefix = char || "";
55498 if (prefixes.indexOf(prefix) === -1) {
55499 path += prefix;
55500 prefix = "";
55501 }
55502 if (path) {
55503 result.push(path);
55504 path = "";
55505 }
55506 result.push({
55507 name: name || key++,
55508 prefix: prefix,
55509 suffix: "",
55510 pattern: pattern || safePattern(prefix),
55511 modifier: tryConsume("MODIFIER") || "",
55512 });
55513 continue;
55514 }
55515 var value = char || tryConsume("ESCAPED_CHAR");
55516 if (value) {
55517 path += value;
55518 continue;
55519 }
55520 if (path) {
55521 result.push(path);
55522 path = "";
55523 }
55524 var open = tryConsume("OPEN");
55525 if (open) {
55526 var prefix = consumeText();
55527 var name_1 = tryConsume("NAME") || "";
55528 var pattern_1 = tryConsume("PATTERN") || "";
55529 var suffix = consumeText();
55530 mustConsume("CLOSE");
55531 result.push({
55532 name: name_1 || (pattern_1 ? key++ : ""),
55533 pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
55534 prefix: prefix,
55535 suffix: suffix,
55536 modifier: tryConsume("MODIFIER") || "",
55537 });
55538 continue;
55539 }
55540 mustConsume("END");
55541 }
55542 return result;
55543}
55544/**
55545 * Compile a string to a template function for the path.
55546 */
55547function dist_es2015_compile(str, options) {
55548 return tokensToFunction(dist_es2015_parse(str, options), options);
55549}
55550/**
55551 * Expose a method for transforming tokens into the path function.
55552 */
55553function tokensToFunction(tokens, options) {
55554 if (options === void 0) { options = {}; }
55555 var reFlags = flags(options);
55556 var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;
55557 // Compile all the tokens into regexps.
55558 var matches = tokens.map(function (token) {
55559 if (typeof token === "object") {
55560 return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
55561 }
55562 });
55563 return function (data) {
55564 var path = "";
55565 for (var i = 0; i < tokens.length; i++) {
55566 var token = tokens[i];
55567 if (typeof token === "string") {
55568 path += token;
55569 continue;
55570 }
55571 var value = data ? data[token.name] : undefined;
55572 var optional = token.modifier === "?" || token.modifier === "*";
55573 var repeat = token.modifier === "*" || token.modifier === "+";
55574 if (Array.isArray(value)) {
55575 if (!repeat) {
55576 throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array"));
55577 }
55578 if (value.length === 0) {
55579 if (optional)
55580 continue;
55581 throw new TypeError("Expected \"".concat(token.name, "\" to not be empty"));
55582 }
55583 for (var j = 0; j < value.length; j++) {
55584 var segment = encode(value[j], token);
55585 if (validate && !matches[i].test(segment)) {
55586 throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
55587 }
55588 path += token.prefix + segment + token.suffix;
55589 }
55590 continue;
55591 }
55592 if (typeof value === "string" || typeof value === "number") {
55593 var segment = encode(String(value), token);
55594 if (validate && !matches[i].test(segment)) {
55595 throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
55596 }
55597 path += token.prefix + segment + token.suffix;
55598 continue;
55599 }
55600 if (optional)
55601 continue;
55602 var typeOfMessage = repeat ? "an array" : "a string";
55603 throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
55604 }
55605 return path;
55606 };
55607}
55608/**
55609 * Create path match function from `path-to-regexp` spec.
55610 */
55611function dist_es2015_match(str, options) {
55612 var keys = [];
55613 var re = pathToRegexp(str, keys, options);
55614 return regexpToFunction(re, keys, options);
55615}
55616/**
55617 * Create a path match function from `path-to-regexp` output.
55618 */
55619function regexpToFunction(re, keys, options) {
55620 if (options === void 0) { options = {}; }
55621 var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;
55622 return function (pathname) {
55623 var m = re.exec(pathname);
55624 if (!m)
55625 return false;
55626 var path = m[0], index = m.index;
55627 var params = Object.create(null);
55628 var _loop_1 = function (i) {
55629 if (m[i] === undefined)
55630 return "continue";
55631 var key = keys[i - 1];
55632 if (key.modifier === "*" || key.modifier === "+") {
55633 params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {
55634 return decode(value, key);
55635 });
55636 }
55637 else {
55638 params[key.name] = decode(m[i], key);
55639 }
55640 };
55641 for (var i = 1; i < m.length; i++) {
55642 _loop_1(i);
55643 }
55644 return { path: path, index: index, params: params };
55645 };
55646}
55647/**
55648 * Escape a regular expression string.
55649 */
55650function escapeString(str) {
55651 return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
55652}
55653/**
55654 * Get the flags for a regexp from the options.
55655 */
55656function flags(options) {
55657 return options && options.sensitive ? "" : "i";
55658}
55659/**
55660 * Pull out keys from a regexp.
55661 */
55662function regexpToRegexp(path, keys) {
55663 if (!keys)
55664 return path;
55665 var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
55666 var index = 0;
55667 var execResult = groupsRegex.exec(path.source);
55668 while (execResult) {
55669 keys.push({
55670 // Use parenthesized substring match if available, index otherwise
55671 name: execResult[1] || index++,
55672 prefix: "",
55673 suffix: "",
55674 modifier: "",
55675 pattern: "",
55676 });
55677 execResult = groupsRegex.exec(path.source);
55678 }
55679 return path;
55680}
55681/**
55682 * Transform an array into a regexp.
55683 */
55684function arrayToRegexp(paths, keys, options) {
55685 var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });
55686 return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
55687}
55688/**
55689 * Create a path regexp from string input.
55690 */
55691function stringToRegexp(path, keys, options) {
55692 return tokensToRegexp(dist_es2015_parse(path, options), keys, options);
55693}
55694/**
55695 * Expose a function for taking tokens and returning a RegExp.
55696 */
55697function tokensToRegexp(tokens, keys, options) {
55698 if (options === void 0) { options = {}; }
55699 var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
55700 var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
55701 var delimiterRe = "[".concat(escapeString(delimiter), "]");
55702 var route = start ? "^" : "";
55703 // Iterate over the tokens and create our regexp string.
55704 for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
55705 var token = tokens_1[_i];
55706 if (typeof token === "string") {
55707 route += escapeString(encode(token));
55708 }
55709 else {
55710 var prefix = escapeString(encode(token.prefix));
55711 var suffix = escapeString(encode(token.suffix));
55712 if (token.pattern) {
55713 if (keys)
55714 keys.push(token);
55715 if (prefix || suffix) {
55716 if (token.modifier === "+" || token.modifier === "*") {
55717 var mod = token.modifier === "*" ? "?" : "";
55718 route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod);
55719 }
55720 else {
55721 route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier);
55722 }
55723 }
55724 else {
55725 if (token.modifier === "+" || token.modifier === "*") {
55726 throw new TypeError("Can not repeat \"".concat(token.name, "\" without a prefix and suffix"));
55727 }
55728 route += "(".concat(token.pattern, ")").concat(token.modifier);
55729 }
55730 }
55731 else {
55732 route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
55733 }
55734 }
55735 }
55736 if (end) {
55737 if (!strict)
55738 route += "".concat(delimiterRe, "?");
55739 route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")");
55740 }
55741 else {
55742 var endToken = tokens[tokens.length - 1];
55743 var isEndDelimited = typeof endToken === "string"
55744 ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1
55745 : endToken === undefined;
55746 if (!strict) {
55747 route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?");
55748 }
55749 if (!isEndDelimited) {
55750 route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")");
55751 }
55752 }
55753 return new RegExp(route, flags(options));
55754}
55755/**
55756 * Normalize the given path string, returning a regular expression.
55757 *
55758 * An empty array can be passed in for the keys, which will hold the
55759 * placeholder key descriptions. For example, using `/user/:id`, `keys` will
55760 * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
55761 */
55762function pathToRegexp(path, keys, options) {
55763 if (path instanceof RegExp)
55764 return regexpToRegexp(path, keys);
55765 if (Array.isArray(path))
55766 return arrayToRegexp(path, keys, options);
55767 return stringToRegexp(path, keys, options);
55768}
55769
55770;// ./node_modules/@wordpress/components/build-module/navigator/utils/router.js
55771
55772function matchPath(path, pattern) {
55773 const matchingFunction = dist_es2015_match(pattern, {
55774 decode: decodeURIComponent
55775 });
55776 return matchingFunction(path);
55777}
55778function patternMatch(path, screens) {
55779 for (const screen of screens) {
55780 const matched = matchPath(path, screen.path);
55781 if (matched) {
55782 return {
55783 params: matched.params,
55784 id: screen.id
55785 };
55786 }
55787 }
55788 return void 0;
55789}
55790function findParent(path, screens) {
55791 if (!path.startsWith("/")) {
55792 return void 0;
55793 }
55794 const pathParts = path.split("/");
55795 let parentPath;
55796 while (pathParts.length > 1 && parentPath === void 0) {
55797 pathParts.pop();
55798 const potentialParentPath = pathParts.join("/") === "" ? "/" : pathParts.join("/");
55799 if (screens.find((screen) => {
55800 return matchPath(potentialParentPath, screen.path) !== false;
55801 })) {
55802 parentPath = potentialParentPath;
55803 }
55804 }
55805 return parentPath;
55806}
55807
55808
55809;// ./node_modules/@wordpress/components/build-module/navigator/context.js
55810
55811const context_initialContextValue = {
55812 location: {},
55813 goTo: () => {
55814 },
55815 goBack: () => {
55816 },
55817 goToParent: () => {
55818 },
55819 addScreen: () => {
55820 },
55821 removeScreen: () => {
55822 },
55823 params: {}
55824};
55825const NavigatorContext = (0,external_wp_element_namespaceObject.createContext)(context_initialContextValue);
55826NavigatorContext.displayName = "NavigatorContext";
55827
55828
55829;// ./node_modules/@wordpress/components/build-module/navigator/styles.js
55830function navigator_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
55831 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
55832}
55833
55834const navigatorWrapper = true ? {
55835 name: "1br0vvk",
55836 styles: "position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"
55837} : 0;
55838const fadeIn = emotion_react_browser_esm_keyframes({
55839 from: {
55840 opacity: 0
55841 }
55842});
55843const fadeOut = emotion_react_browser_esm_keyframes({
55844 to: {
55845 opacity: 0
55846 }
55847});
55848const slideFromRight = emotion_react_browser_esm_keyframes({
55849 from: {
55850 transform: "translateX(100px)"
55851 }
55852});
55853const slideToLeft = emotion_react_browser_esm_keyframes({
55854 to: {
55855 transform: "translateX(-80px)"
55856 }
55857});
55858const slideFromLeft = emotion_react_browser_esm_keyframes({
55859 from: {
55860 transform: "translateX(-100px)"
55861 }
55862});
55863const slideToRight = emotion_react_browser_esm_keyframes({
55864 to: {
55865 transform: "translateX(80px)"
55866 }
55867});
55868const FADE = {
55869 DURATION: 70,
55870 EASING: "linear",
55871 DELAY: {
55872 IN: 70,
55873 OUT: 40
55874 }
55875};
55876const SLIDE = {
55877 DURATION: 300,
55878 EASING: "cubic-bezier(0.33, 0, 0, 1)"
55879};
55880const TOTAL_ANIMATION_DURATION = {
55881 IN: Math.max(FADE.DURATION + FADE.DELAY.IN, SLIDE.DURATION),
55882 OUT: Math.max(FADE.DURATION + FADE.DELAY.OUT, SLIDE.DURATION)
55883};
55884const ANIMATION_END_NAMES = {
55885 end: {
55886 in: slideFromRight.name,
55887 out: slideToLeft.name
55888 },
55889 start: {
55890 in: slideFromLeft.name,
55891 out: slideToRight.name
55892 }
55893};
55894const ANIMATION = {
55895 end: {
55896 in: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.IN, "ms both ", fadeIn, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideFromRight, ";" + ( true ? "" : 0), true ? "" : 0),
55897 out: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.OUT, "ms both ", fadeOut, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideToLeft, ";" + ( true ? "" : 0), true ? "" : 0)
55898 },
55899 start: {
55900 in: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.IN, "ms both ", fadeIn, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideFromLeft, ";" + ( true ? "" : 0), true ? "" : 0),
55901 out: /* @__PURE__ */ emotion_react_browser_esm_css(FADE.DURATION, "ms ", FADE.EASING, " ", FADE.DELAY.OUT, "ms both ", fadeOut, ",", SLIDE.DURATION, "ms ", SLIDE.EASING, " both ", slideToRight, ";" + ( true ? "" : 0), true ? "" : 0)
55902 }
55903};
55904const navigatorScreenAnimation = /* @__PURE__ */ emotion_react_browser_esm_css("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){", ["start", "end"].map((direction) => ["in", "out"].map((type) => /* @__PURE__ */ emotion_react_browser_esm_css("&[data-animation-direction='", direction, "'][data-animation-type='", type, "']{animation:", ANIMATION[direction][type], ";}" + ( true ? "" : 0), true ? "" : 0))), ";}}" + ( true ? "" : 0), true ? "" : 0);
55905const navigatorScreen = true ? {
55906 name: "14di7zd",
55907 styles: "overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"
55908} : 0;
55909
55910
55911;// ./node_modules/@wordpress/components/build-module/navigator/navigator/component.js
55912
55913
55914
55915
55916
55917
55918
55919
55920
55921
55922
55923function addScreen({
55924 screens
55925}, screen) {
55926 if (screens.some((s) => s.path === screen.path)) {
55927 true ? external_wp_warning_default()(`Navigator: a screen with path ${screen.path} already exists.
55928The screen with id ${screen.id} will not be added.`) : 0;
55929 return screens;
55930 }
55931 return [...screens, screen];
55932}
55933function removeScreen({
55934 screens
55935}, screen) {
55936 return screens.filter((s) => s.id !== screen.id);
55937}
55938function goTo(state, path, options = {}) {
55939 var _focusSelectorsCopy2;
55940 const {
55941 focusSelectors
55942 } = state;
55943 const currentLocation = {
55944 ...state.currentLocation
55945 };
55946 const {
55947 // Default assignments
55948 isBack = false,
55949 skipFocus = false,
55950 // Extract to avoid forwarding
55951 replace,
55952 focusTargetSelector,
55953 // Rest
55954 ...restOptions
55955 } = options;
55956 if (currentLocation.path === path) {
55957 return {
55958 currentLocation,
55959 focusSelectors
55960 };
55961 }
55962 let focusSelectorsCopy;
55963 function getFocusSelectorsCopy() {
55964 var _focusSelectorsCopy;
55965 focusSelectorsCopy = (_focusSelectorsCopy = focusSelectorsCopy) !== null && _focusSelectorsCopy !== void 0 ? _focusSelectorsCopy : new Map(state.focusSelectors);
55966 return focusSelectorsCopy;
55967 }
55968 if (focusTargetSelector && currentLocation.path) {
55969 getFocusSelectorsCopy().set(currentLocation.path, focusTargetSelector);
55970 }
55971 let currentFocusSelector;
55972 if (focusSelectors.get(path)) {
55973 if (isBack) {
55974 currentFocusSelector = focusSelectors.get(path);
55975 }
55976 getFocusSelectorsCopy().delete(path);
55977 }
55978 return {
55979 currentLocation: {
55980 ...restOptions,
55981 isInitial: false,
55982 path,
55983 isBack,
55984 hasRestoredFocus: false,
55985 focusTargetSelector: currentFocusSelector,
55986 skipFocus
55987 },
55988 focusSelectors: (_focusSelectorsCopy2 = focusSelectorsCopy) !== null && _focusSelectorsCopy2 !== void 0 ? _focusSelectorsCopy2 : focusSelectors
55989 };
55990}
55991function goToParent(state, options = {}) {
55992 const {
55993 screens,
55994 focusSelectors
55995 } = state;
55996 const currentLocation = {
55997 ...state.currentLocation
55998 };
55999 const currentPath = currentLocation.path;
56000 if (currentPath === void 0) {
56001 return {
56002 currentLocation,
56003 focusSelectors
56004 };
56005 }
56006 const parentPath = findParent(currentPath, screens);
56007 if (parentPath === void 0) {
56008 return {
56009 currentLocation,
56010 focusSelectors
56011 };
56012 }
56013 return goTo(state, parentPath, {
56014 ...options,
56015 isBack: true
56016 });
56017}
56018function routerReducer(state, action) {
56019 let {
56020 screens,
56021 currentLocation,
56022 matchedPath,
56023 focusSelectors,
56024 ...restState
56025 } = state;
56026 switch (action.type) {
56027 case "add":
56028 screens = addScreen(state, action.screen);
56029 break;
56030 case "remove":
56031 screens = removeScreen(state, action.screen);
56032 break;
56033 case "goto":
56034 ({
56035 currentLocation,
56036 focusSelectors
56037 } = goTo(state, action.path, action.options));
56038 break;
56039 case "gotoparent":
56040 ({
56041 currentLocation,
56042 focusSelectors
56043 } = goToParent(state, action.options));
56044 break;
56045 }
56046 if (screens === state.screens && currentLocation === state.currentLocation) {
56047 return state;
56048 }
56049 const currentPath = currentLocation.path;
56050 matchedPath = currentPath !== void 0 ? patternMatch(currentPath, screens) : void 0;
56051 if (matchedPath && state.matchedPath && matchedPath.id === state.matchedPath.id && external_wp_isShallowEqual_default()(matchedPath.params, state.matchedPath.params)) {
56052 matchedPath = state.matchedPath;
56053 }
56054 return {
56055 ...restState,
56056 screens,
56057 currentLocation,
56058 matchedPath,
56059 focusSelectors
56060 };
56061}
56062function UnconnectedNavigator(props, forwardedRef) {
56063 const {
56064 initialPath: initialPathProp,
56065 children,
56066 className,
56067 ...otherProps
56068 } = useContextSystem(props, "Navigator");
56069 const [routerState, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(routerReducer, initialPathProp, (path) => ({
56070 screens: [],
56071 currentLocation: {
56072 path,
56073 isInitial: true
56074 },
56075 matchedPath: void 0,
56076 focusSelectors: /* @__PURE__ */ new Map(),
56077 initialPath: initialPathProp
56078 }));
56079 const methods = (0,external_wp_element_namespaceObject.useMemo)(() => ({
56080 // Note: calling goBack calls `goToParent` internally, as it was established
56081 // that `goBack` should behave like `goToParent`, and `goToParent` should
56082 // be marked as deprecated.
56083 goBack: (options) => dispatch({
56084 type: "gotoparent",
56085 options
56086 }),
56087 goTo: (path, options) => dispatch({
56088 type: "goto",
56089 path,
56090 options
56091 }),
56092 goToParent: (options) => {
56093 external_wp_deprecated_default()(`wp.components.useNavigator().goToParent`, {
56094 since: "6.7",
56095 alternative: "wp.components.useNavigator().goBack"
56096 });
56097 dispatch({
56098 type: "gotoparent",
56099 options
56100 });
56101 },
56102 addScreen: (screen) => dispatch({
56103 type: "add",
56104 screen
56105 }),
56106 removeScreen: (screen) => dispatch({
56107 type: "remove",
56108 screen
56109 })
56110 }), []);
56111 const {
56112 currentLocation,
56113 matchedPath
56114 } = routerState;
56115 const navigatorContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
56116 var _matchedPath$params;
56117 return {
56118 location: currentLocation,
56119 params: (_matchedPath$params = matchedPath?.params) !== null && _matchedPath$params !== void 0 ? _matchedPath$params : {},
56120 match: matchedPath?.id,
56121 ...methods
56122 };
56123 }, [currentLocation, matchedPath, methods]);
56124 const cx = useCx();
56125 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorWrapper, className), [className, cx]);
56126 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
56127 ref: forwardedRef,
56128 className: classes,
56129 ...otherProps,
56130 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorContext.Provider, {
56131 value: navigatorContextValue,
56132 children
56133 })
56134 });
56135}
56136const component_Navigator = contextConnect(UnconnectedNavigator, "Navigator");
56137
56138
56139;// external ["wp","escapeHtml"]
56140const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"];
56141;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/use-screen-animate-presence.js
56142
56143
56144
56145
56146const ANIMATION_TIMEOUT_MARGIN = 1.2;
56147const isEnterAnimation = (animationDirection, animationStatus, animationName) => animationStatus === "ANIMATING_IN" && animationName === ANIMATION_END_NAMES[animationDirection].in;
56148const isExitAnimation = (animationDirection, animationStatus, animationName) => animationStatus === "ANIMATING_OUT" && animationName === ANIMATION_END_NAMES[animationDirection].out;
56149function useScreenAnimatePresence({
56150 isMatch,
56151 skipAnimation,
56152 isBack,
56153 onAnimationEnd
56154}) {
56155 const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)();
56156 const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
56157 const [animationStatus, setAnimationStatus] = (0,external_wp_element_namespaceObject.useState)("INITIAL");
56158 const becameSelected = animationStatus !== "ANIMATING_IN" && animationStatus !== "IN" && isMatch;
56159 const becameUnselected = animationStatus !== "ANIMATING_OUT" && animationStatus !== "OUT" && !isMatch;
56160 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
56161 if (becameSelected) {
56162 setAnimationStatus(skipAnimation || prefersReducedMotion ? "IN" : "ANIMATING_IN");
56163 } else if (becameUnselected) {
56164 setAnimationStatus(skipAnimation || prefersReducedMotion ? "OUT" : "ANIMATING_OUT");
56165 }
56166 }, [becameSelected, becameUnselected, skipAnimation, prefersReducedMotion]);
56167 const animationDirection = isRTL && isBack || !isRTL && !isBack ? "end" : "start";
56168 const isAnimatingIn = animationStatus === "ANIMATING_IN";
56169 const isAnimatingOut = animationStatus === "ANIMATING_OUT";
56170 let animationType;
56171 if (isAnimatingIn) {
56172 animationType = "in";
56173 } else if (isAnimatingOut) {
56174 animationType = "out";
56175 }
56176 const onScreenAnimationEnd = (0,external_wp_element_namespaceObject.useCallback)((e) => {
56177 onAnimationEnd?.(e);
56178 if (isExitAnimation(animationDirection, animationStatus, e.animationName)) {
56179 setAnimationStatus("OUT");
56180 } else if (isEnterAnimation(animationDirection, animationStatus, e.animationName)) {
56181 setAnimationStatus("IN");
56182 }
56183 }, [onAnimationEnd, animationStatus, animationDirection]);
56184 (0,external_wp_element_namespaceObject.useEffect)(() => {
56185 let animationTimeout;
56186 if (isAnimatingOut) {
56187 animationTimeout = window.setTimeout(() => {
56188 setAnimationStatus("OUT");
56189 animationTimeout = void 0;
56190 }, TOTAL_ANIMATION_DURATION.OUT * ANIMATION_TIMEOUT_MARGIN);
56191 } else if (isAnimatingIn) {
56192 animationTimeout = window.setTimeout(() => {
56193 setAnimationStatus("IN");
56194 animationTimeout = void 0;
56195 }, TOTAL_ANIMATION_DURATION.IN * ANIMATION_TIMEOUT_MARGIN);
56196 }
56197 return () => {
56198 if (animationTimeout) {
56199 window.clearTimeout(animationTimeout);
56200 animationTimeout = void 0;
56201 }
56202 };
56203 }, [isAnimatingOut, isAnimatingIn]);
56204 return {
56205 animationStyles: navigatorScreenAnimation,
56206 // Render the screen's contents in the DOM not only when the screen is
56207 // selected, but also while it is animating out.
56208 shouldRenderScreen: isMatch || animationStatus === "IN" || animationStatus === "ANIMATING_OUT",
56209 screenProps: {
56210 onAnimationEnd: onScreenAnimationEnd,
56211 "data-animation-direction": animationDirection,
56212 "data-animation-type": animationType,
56213 "data-skip-animation": skipAnimation || void 0
56214 }
56215 };
56216}
56217
56218
56219;// ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/component.js
56220
56221
56222
56223
56224
56225
56226
56227
56228
56229
56230
56231
56232function UnconnectedNavigatorScreen(props, forwardedRef) {
56233 if (!/^\//.test(props.path)) {
56234 true ? external_wp_warning_default()("wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.") : 0;
56235 }
56236 const screenId = (0,external_wp_element_namespaceObject.useId)();
56237 const {
56238 children,
56239 className,
56240 path,
56241 onAnimationEnd: onAnimationEndProp,
56242 ...otherProps
56243 } = useContextSystem(props, "Navigator.Screen");
56244 const {
56245 location,
56246 match,
56247 addScreen,
56248 removeScreen
56249 } = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
56250 const {
56251 isInitial,
56252 isBack,
56253 focusTargetSelector,
56254 skipFocus
56255 } = location;
56256 const isMatch = match === screenId;
56257 const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(null);
56258 const skipAnimationAndFocusRestoration = !!isInitial && !isBack;
56259 (0,external_wp_element_namespaceObject.useEffect)(() => {
56260 const screen = {
56261 id: screenId,
56262 path: (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path)
56263 };
56264 addScreen(screen);
56265 return () => removeScreen(screen);
56266 }, [screenId, path, addScreen, removeScreen]);
56267 const {
56268 animationStyles,
56269 shouldRenderScreen,
56270 screenProps
56271 } = useScreenAnimatePresence({
56272 isMatch,
56273 isBack,
56274 onAnimationEnd: onAnimationEndProp,
56275 skipAnimation: skipAnimationAndFocusRestoration
56276 });
56277 const cx = useCx();
56278 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen, animationStyles, className), [className, cx, animationStyles]);
56279 const locationRef = (0,external_wp_element_namespaceObject.useRef)(location);
56280 (0,external_wp_element_namespaceObject.useEffect)(() => {
56281 locationRef.current = location;
56282 }, [location]);
56283 (0,external_wp_element_namespaceObject.useEffect)(() => {
56284 const wrapperEl = wrapperRef.current;
56285 if (skipAnimationAndFocusRestoration || !isMatch || !wrapperEl || locationRef.current.hasRestoredFocus || skipFocus) {
56286 return;
56287 }
56288 const activeElement = wrapperEl.ownerDocument.activeElement;
56289 if (wrapperEl.contains(activeElement)) {
56290 return;
56291 }
56292 let elementToFocus = null;
56293 if (isBack && focusTargetSelector) {
56294 elementToFocus = wrapperEl.querySelector(focusTargetSelector);
56295 }
56296 if (!elementToFocus) {
56297 const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(wrapperEl);
56298 elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperEl;
56299 }
56300 locationRef.current.hasRestoredFocus = true;
56301 elementToFocus.focus();
56302 }, [skipAnimationAndFocusRestoration, isMatch, isBack, focusTargetSelector, skipFocus]);
56303 const mergedWrapperRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, wrapperRef]);
56304 return shouldRenderScreen ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
56305 ref: mergedWrapperRef,
56306 className: classes,
56307 ...screenProps,
56308 ...otherProps,
56309 children
56310 }) : null;
56311}
56312const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, "Navigator.Screen");
56313
56314
56315;// ./node_modules/@wordpress/components/build-module/navigator/use-navigator.js
56316
56317
56318function useNavigator() {
56319 const {
56320 location,
56321 params,
56322 goTo,
56323 goBack,
56324 goToParent
56325 } = (0,external_wp_element_namespaceObject.useContext)(NavigatorContext);
56326 return {
56327 location,
56328 goTo,
56329 goBack,
56330 goToParent,
56331 params
56332 };
56333}
56334
56335
56336;// ./node_modules/@wordpress/components/build-module/navigator/navigator-button/hook.js
56337
56338
56339
56340
56341
56342const cssSelectorForAttribute = (attrName, attrValue) => `[${attrName}="${attrValue}"]`;
56343function useNavigatorButton(props) {
56344 const {
56345 path,
56346 onClick,
56347 as = button_default,
56348 attributeName = "id",
56349 ...otherProps
56350 } = useContextSystem(props, "Navigator.Button");
56351 const escapedPath = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(path);
56352 const {
56353 goTo
56354 } = useNavigator();
56355 const handleClick = (0,external_wp_element_namespaceObject.useCallback)((e) => {
56356 e.preventDefault();
56357 goTo(escapedPath, {
56358 focusTargetSelector: cssSelectorForAttribute(attributeName, escapedPath)
56359 });
56360 onClick?.(e);
56361 }, [goTo, onClick, attributeName, escapedPath]);
56362 return {
56363 as,
56364 onClick: handleClick,
56365 ...otherProps,
56366 [attributeName]: escapedPath
56367 };
56368}
56369
56370
56371;// ./node_modules/@wordpress/components/build-module/navigator/navigator-button/component.js
56372
56373
56374
56375
56376function UnconnectedNavigatorButton(props, forwardedRef) {
56377 const navigatorButtonProps = useNavigatorButton(props);
56378 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
56379 ref: forwardedRef,
56380 ...navigatorButtonProps
56381 });
56382}
56383const NavigatorButton = contextConnect(UnconnectedNavigatorButton, "Navigator.Button");
56384
56385
56386;// ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/hook.js
56387
56388
56389
56390
56391function useNavigatorBackButton(props) {
56392 const {
56393 onClick,
56394 as = button_default,
56395 ...otherProps
56396 } = useContextSystem(props, "Navigator.BackButton");
56397 const {
56398 goBack
56399 } = useNavigator();
56400 const handleClick = (0,external_wp_element_namespaceObject.useCallback)((e) => {
56401 e.preventDefault();
56402 goBack();
56403 onClick?.(e);
56404 }, [goBack, onClick]);
56405 return {
56406 as,
56407 onClick: handleClick,
56408 ...otherProps
56409 };
56410}
56411
56412
56413;// ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/component.js
56414
56415
56416
56417
56418function UnconnectedNavigatorBackButton(props, forwardedRef) {
56419 const navigatorBackButtonProps = useNavigatorBackButton(props);
56420 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
56421 ref: forwardedRef,
56422 ...navigatorBackButtonProps
56423 });
56424}
56425const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, "Navigator.BackButton");
56426
56427
56428;// ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js
56429
56430
56431
56432
56433function UnconnectedNavigatorToParentButton(props, forwardedRef) {
56434 external_wp_deprecated_default()("wp.components.NavigatorToParentButton", {
56435 since: "6.7",
56436 alternative: "wp.components.Navigator.BackButton"
56437 });
56438 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigatorBackButton, {
56439 ref: forwardedRef,
56440 ...props
56441 });
56442}
56443const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, "Navigator.ToParentButton");
56444
56445
56446;// ./node_modules/@wordpress/components/build-module/navigator/legacy.js
56447
56448
56449
56450
56451
56452
56453const NavigatorProvider = Object.assign(component_Navigator, {
56454 displayName: "NavigatorProvider"
56455});
56456const legacy_NavigatorScreen = Object.assign(NavigatorScreen, {
56457 displayName: "NavigatorScreen"
56458});
56459const legacy_NavigatorButton = Object.assign(NavigatorButton, {
56460 displayName: "NavigatorButton"
56461});
56462const legacy_NavigatorBackButton = Object.assign(NavigatorBackButton, {
56463 displayName: "NavigatorBackButton"
56464});
56465const legacy_NavigatorToParentButton = Object.assign(NavigatorToParentButton, {
56466 displayName: "NavigatorToParentButton"
56467});
56468
56469
56470;// ./node_modules/@wordpress/components/build-module/navigator/index.js
56471
56472
56473
56474
56475
56476const navigator_Navigator = Object.assign(component_Navigator, {
56477 /**
56478 * The `Navigator.Screen` component represents a single view/screen/panel and
56479 * should be used in combination with the `Navigator`, the `Navigator.Button`
56480 * and the `Navigator.BackButton` components.
56481 *
56482 * @example
56483 * ```jsx
56484 * import { Navigator } from '@wordpress/components';
56485 *
56486 * const MyNavigation = () => (
56487 * <Navigator initialPath="/">
56488 * <Navigator.Screen path="/">
56489 * <p>This is the home screen.</p>
56490 * <Navigator.Button path="/child">
56491 * Navigate to child screen.
56492 * </Navigator.Button>
56493 * </Navigator.Screen>
56494 *
56495 * <Navigator.Screen path="/child">
56496 * <p>This is the child screen.</p>
56497 * <Navigator.BackButton>
56498 * Go back
56499 * </Navigator.BackButton>
56500 * </Navigator.Screen>
56501 * </Navigator>
56502 * );
56503 * ```
56504 */
56505 Screen: Object.assign(NavigatorScreen, {
56506 displayName: "Navigator.Screen"
56507 }),
56508 /**
56509 * The `Navigator.Button` component can be used to navigate to a screen and
56510 * should be used in combination with the `Navigator`, the `Navigator.Screen`
56511 * and the `Navigator.BackButton` components.
56512 *
56513 * @example
56514 * ```jsx
56515 * import { Navigator } from '@wordpress/components';
56516 *
56517 * const MyNavigation = () => (
56518 * <Navigator initialPath="/">
56519 * <Navigator.Screen path="/">
56520 * <p>This is the home screen.</p>
56521 * <Navigator.Button path="/child">
56522 * Navigate to child screen.
56523 * </Navigator.Button>
56524 * </Navigator.Screen>
56525 *
56526 * <Navigator.Screen path="/child">
56527 * <p>This is the child screen.</p>
56528 * <Navigator.BackButton>
56529 * Go back
56530 * </Navigator.BackButton>
56531 * </Navigator.Screen>
56532 * </Navigator>
56533 * );
56534 * ```
56535 */
56536 Button: Object.assign(NavigatorButton, {
56537 displayName: "Navigator.Button"
56538 }),
56539 /**
56540 * The `Navigator.BackButton` component can be used to navigate to a screen and
56541 * should be used in combination with the `Navigator`, the `Navigator.Screen`
56542 * and the `Navigator.Button` components.
56543 *
56544 * @example
56545 * ```jsx
56546 * import { Navigator } from '@wordpress/components';
56547 *
56548 * const MyNavigation = () => (
56549 * <Navigator initialPath="/">
56550 * <Navigator.Screen path="/">
56551 * <p>This is the home screen.</p>
56552 * <Navigator.Button path="/child">
56553 * Navigate to child screen.
56554 * </Navigator.Button>
56555 * </Navigator.Screen>
56556 *
56557 * <Navigator.Screen path="/child">
56558 * <p>This is the child screen.</p>
56559 * <Navigator.BackButton>
56560 * Go back
56561 * </Navigator.BackButton>
56562 * </Navigator.Screen>
56563 * </Navigator>
56564 * );
56565 * ```
56566 */
56567 BackButton: Object.assign(NavigatorBackButton, {
56568 displayName: "Navigator.BackButton"
56569 })
56570});
56571
56572
56573;// ./node_modules/@wordpress/components/build-module/notice/index.js
56574
56575
56576
56577
56578
56579
56580
56581
56582const notice_noop = () => {
56583};
56584function useSpokenMessage(message, politeness) {
56585 const spokenMessage = typeof message === "string" ? message : (0,external_wp_element_namespaceObject.renderToString)(message);
56586 (0,external_wp_element_namespaceObject.useEffect)(() => {
56587 if (spokenMessage) {
56588 (0,external_wp_a11y_namespaceObject.speak)(spokenMessage, politeness);
56589 }
56590 }, [spokenMessage, politeness]);
56591}
56592function getDefaultPoliteness(status) {
56593 switch (status) {
56594 case "success":
56595 case "warning":
56596 case "info":
56597 return "polite";
56598 // The default will also catch the 'error' status.
56599 default:
56600 return "assertive";
56601 }
56602}
56603function getStatusLabel(status) {
56604 switch (status) {
56605 case "warning":
56606 return (0,external_wp_i18n_namespaceObject.__)("Warning notice");
56607 case "info":
56608 return (0,external_wp_i18n_namespaceObject.__)("Information notice");
56609 case "error":
56610 return (0,external_wp_i18n_namespaceObject.__)("Error notice");
56611 // The default will also catch the 'success' status.
56612 default:
56613 return (0,external_wp_i18n_namespaceObject.__)("Notice");
56614 }
56615}
56616function Notice({
56617 className,
56618 status = "info",
56619 children,
56620 spokenMessage = children,
56621 onRemove = notice_noop,
56622 isDismissible = true,
56623 actions = [],
56624 politeness = getDefaultPoliteness(status),
56625 __unstableHTML,
56626 // onDismiss is a callback executed when the notice is dismissed.
56627 // It is distinct from onRemove, which _looks_ like a callback but is
56628 // actually the function to call to remove the notice from the UI.
56629 onDismiss = notice_noop
56630}) {
56631 useSpokenMessage(spokenMessage, politeness);
56632 const classes = dist_clsx(className, "components-notice", "is-" + status, {
56633 "is-dismissible": isDismissible
56634 });
56635 if (__unstableHTML && typeof children === "string") {
56636 children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
56637 children
56638 });
56639 }
56640 const onDismissNotice = () => {
56641 onDismiss();
56642 onRemove();
56643 };
56644 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56645 className: classes,
56646 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
56647 children: getStatusLabel(status)
56648 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56649 className: "components-notice__content",
56650 children: [children, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
56651 className: "components-notice__actions",
56652 children: actions.map(({
56653 className: buttonCustomClasses,
56654 label,
56655 isPrimary,
56656 variant,
56657 noDefaultClasses = false,
56658 onClick,
56659 url
56660 }, index) => {
56661 let computedVariant = variant;
56662 if (variant !== "primary" && !noDefaultClasses) {
56663 computedVariant = !url ? "secondary" : "link";
56664 }
56665 if (typeof computedVariant === "undefined" && isPrimary) {
56666 computedVariant = "primary";
56667 }
56668 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
56669 __next40pxDefaultSize: true,
56670 href: url,
56671 variant: computedVariant,
56672 onClick: url ? void 0 : onClick,
56673 className: dist_clsx("components-notice__action", buttonCustomClasses),
56674 children: label
56675 }, index);
56676 })
56677 })]
56678 }), isDismissible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
56679 size: "small",
56680 className: "components-notice__dismiss",
56681 icon: close_default,
56682 label: (0,external_wp_i18n_namespaceObject.__)("Close"),
56683 onClick: onDismissNotice
56684 })]
56685 });
56686}
56687var notice_default = Notice;
56688
56689
56690;// ./node_modules/@wordpress/components/build-module/notice/list.js
56691
56692
56693
56694
56695const list_noop = () => {
56696};
56697function NoticeList({
56698 notices,
56699 onRemove = list_noop,
56700 className,
56701 children
56702}) {
56703 const removeNotice = (id) => () => onRemove(id);
56704 className = dist_clsx("components-notice-list", className);
56705 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56706 className,
56707 children: [children, [...notices].reverse().map((notice) => {
56708 const {
56709 content,
56710 ...restNotice
56711 } = notice;
56712 return /* @__PURE__ */ (0,external_React_.createElement)(notice_default, {
56713 ...restNotice,
56714 key: notice.id,
56715 onRemove: removeNotice(notice.id)
56716 }, notice.content);
56717 })]
56718 });
56719}
56720var list_default = NoticeList;
56721
56722
56723;// ./node_modules/@wordpress/components/build-module/panel/header.js
56724
56725function PanelHeader({
56726 label,
56727 children
56728}) {
56729 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56730 className: "components-panel__header",
56731 children: [label && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
56732 children: label
56733 }), children]
56734 });
56735}
56736var header_default = PanelHeader;
56737
56738
56739;// ./node_modules/@wordpress/components/build-module/panel/index.js
56740
56741
56742
56743
56744function UnforwardedPanel({
56745 header,
56746 className,
56747 children
56748}, ref) {
56749 const classNames = dist_clsx(className, "components-panel");
56750 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56751 className: classNames,
56752 ref,
56753 children: [header && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, {
56754 label: header
56755 }), children]
56756 });
56757}
56758const Panel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanel);
56759var panel_default = Panel;
56760
56761
56762;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
56763
56764
56765var chevron_up_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });
56766
56767
56768;// ./node_modules/@wordpress/components/build-module/panel/body.js
56769
56770
56771
56772
56773
56774
56775
56776
56777const body_noop = () => {
56778};
56779function UnforwardedPanelBody(props, ref) {
56780 const {
56781 buttonProps = {},
56782 children,
56783 className,
56784 icon,
56785 initialOpen,
56786 onToggle = body_noop,
56787 opened,
56788 title,
56789 scrollAfterOpen = true
56790 } = props;
56791 const [isOpened, setIsOpened] = use_controlled_state_default(opened, {
56792 initial: initialOpen === void 0 ? true : initialOpen,
56793 fallback: false
56794 });
56795 const nodeRef = (0,external_wp_element_namespaceObject.useRef)(null);
56796 const scrollBehavior = (0,external_wp_compose_namespaceObject.useReducedMotion)() ? "auto" : "smooth";
56797 const handleOnToggle = (event) => {
56798 event.preventDefault();
56799 const next = !isOpened;
56800 setIsOpened(next);
56801 onToggle(next);
56802 };
56803 const scrollAfterOpenRef = (0,external_wp_element_namespaceObject.useRef)();
56804 scrollAfterOpenRef.current = scrollAfterOpen;
56805 use_update_effect_default(() => {
56806 if (isOpened && scrollAfterOpenRef.current && nodeRef.current?.scrollIntoView) {
56807 nodeRef.current.scrollIntoView({
56808 inline: "nearest",
56809 block: "nearest",
56810 behavior: scrollBehavior
56811 });
56812 }
56813 }, [isOpened, scrollBehavior]);
56814 const classes = dist_clsx("components-panel__body", className, {
56815 "is-opened": isOpened
56816 });
56817 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56818 className: classes,
56819 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([nodeRef, ref]),
56820 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelBodyTitle, {
56821 icon,
56822 isOpened: Boolean(isOpened),
56823 onClick: handleOnToggle,
56824 title,
56825 ...buttonProps
56826 }), typeof children === "function" ? children({
56827 opened: Boolean(isOpened)
56828 }) : isOpened && children]
56829 });
56830}
56831const PanelBodyTitle = (0,external_wp_element_namespaceObject.forwardRef)(({
56832 isOpened,
56833 icon,
56834 title,
56835 ...props
56836}, ref) => {
56837 if (!title) {
56838 return null;
56839 }
56840 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
56841 className: "components-panel__body-title",
56842 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(button_default, {
56843 __next40pxDefaultSize: true,
56844 className: "components-panel__body-toggle",
56845 "aria-expanded": isOpened,
56846 ref,
56847 ...props,
56848 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
56849 "aria-hidden": "true",
56850 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
56851 className: "components-panel__arrow",
56852 icon: isOpened ? chevron_up_default : chevron_down_default
56853 })
56854 }), title, icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
56855 icon,
56856 className: "components-panel__icon",
56857 size: 20
56858 })]
56859 })
56860 });
56861});
56862const PanelBody = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelBody);
56863var body_default = PanelBody;
56864
56865
56866;// ./node_modules/@wordpress/components/build-module/panel/row.js
56867
56868
56869
56870function UnforwardedPanelRow({
56871 className,
56872 children
56873}, ref) {
56874 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
56875 className: dist_clsx("components-panel__row", className),
56876 ref,
56877 children
56878 });
56879}
56880const PanelRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelRow);
56881var row_default = PanelRow;
56882
56883
56884;// ./node_modules/@wordpress/components/build-module/placeholder/index.js
56885
56886
56887
56888
56889
56890
56891
56892const PlaceholderIllustration = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
56893 className: "components-placeholder__illustration",
56894 fill: "none",
56895 xmlns: "http://www.w3.org/2000/svg",
56896 viewBox: "0 0 60 60",
56897 preserveAspectRatio: "none",
56898 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
56899 vectorEffect: "non-scaling-stroke",
56900 d: "M60 60 0 0"
56901 })
56902});
56903function Placeholder(props) {
56904 const {
56905 icon,
56906 children,
56907 label,
56908 instructions,
56909 className,
56910 notices,
56911 preview,
56912 isColumnLayout,
56913 withIllustration,
56914 ...additionalProps
56915 } = props;
56916 const [resizeListener, {
56917 width
56918 }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
56919 let modifierClassNames;
56920 if (typeof width === "number") {
56921 modifierClassNames = {
56922 "is-large": width >= 480,
56923 "is-medium": width >= 160 && width < 480,
56924 "is-small": width < 160
56925 };
56926 }
56927 const classes = dist_clsx("components-placeholder", className, modifierClassNames, withIllustration ? "has-illustration" : null);
56928 const fieldsetClasses = dist_clsx("components-placeholder__fieldset", {
56929 "is-column-layout": isColumnLayout
56930 });
56931 (0,external_wp_element_namespaceObject.useEffect)(() => {
56932 if (instructions) {
56933 (0,external_wp_a11y_namespaceObject.speak)(instructions);
56934 }
56935 }, [instructions]);
56936 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56937 ...additionalProps,
56938 className: classes,
56939 children: [withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
56940 className: "components-placeholder__preview",
56941 children: preview
56942 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
56943 className: "components-placeholder__label",
56944 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
56945 icon
56946 }), label]
56947 }), !!instructions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
56948 className: "components-placeholder__instructions",
56949 children: instructions
56950 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
56951 className: fieldsetClasses,
56952 children
56953 })]
56954 });
56955}
56956var placeholder_default = Placeholder;
56957
56958
56959;// ./node_modules/@wordpress/components/build-module/progress-bar/styles.js
56960
56961function progress_bar_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
56962 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
56963}
56964
56965
56966
56967function animateProgressBar(isRtl = false) {
56968 const animationDirection = isRtl ? "right" : "left";
56969 return emotion_react_browser_esm_keyframes({
56970 "0%": {
56971 [animationDirection]: "-50%"
56972 },
56973 "100%": {
56974 [animationDirection]: "100%"
56975 }
56976 });
56977}
56978const INDETERMINATE_TRACK_WIDTH = 50;
56979const styles_Track = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
56980 target: "e15u147w2"
56981} : 0)("position:relative;overflow:hidden;height:", config_values_default.borderWidthFocus, ";background-color:color-mix(\n in srgb,\n ", COLORS.theme.foreground, ",\n transparent 90%\n );border-radius:", config_values_default.radiusFull, ";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}" + ( true ? "" : 0));
56982var progress_bar_styles_ref = true ? {
56983 name: "152sa26",
56984 styles: "width:var(--indicator-width);transition:width 0.4s ease-in-out"
56985} : 0;
56986const Indicator = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
56987 target: "e15u147w1"
56988} : 0)("display:inline-block;position:absolute;top:0;height:100%;border-radius:", config_values_default.radiusFull, ";background-color:color-mix(\n in srgb,\n ", COLORS.theme.foreground, ",\n transparent 10%\n );outline:2px solid transparent;outline-offset:-2px;", ({
56989 isIndeterminate
56990}) => isIndeterminate ? /* @__PURE__ */ emotion_react_browser_esm_css({
56991 animationDuration: "1.5s",
56992 animationTimingFunction: "ease-in-out",
56993 animationIterationCount: "infinite",
56994 animationName: animateProgressBar((0,external_wp_i18n_namespaceObject.isRTL)()),
56995 width: `${INDETERMINATE_TRACK_WIDTH}%`
56996}, true ? "" : 0, true ? "" : 0) : progress_bar_styles_ref, ";" + ( true ? "" : 0));
56997const ProgressElement = /* @__PURE__ */ emotion_styled_base_browser_esm("progress", true ? {
56998 target: "e15u147w0"
56999} : 0)( true ? {
57000 name: "11fb690",
57001 styles: "position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"
57002} : 0);
57003
57004
57005;// ./node_modules/@wordpress/components/build-module/progress-bar/index.js
57006
57007
57008
57009
57010function UnforwardedProgressBar(props, ref) {
57011 const {
57012 className,
57013 value,
57014 ...progressProps
57015 } = props;
57016 const isIndeterminate = !Number.isFinite(value);
57017 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Track, {
57018 className,
57019 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Indicator, {
57020 style: {
57021 "--indicator-width": !isIndeterminate ? `${value}%` : void 0
57022 },
57023 isIndeterminate
57024 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ProgressElement, {
57025 max: 100,
57026 value,
57027 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Loading \u2026"),
57028 ref,
57029 ...progressProps
57030 })]
57031 });
57032}
57033const ProgressBar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedProgressBar);
57034var progress_bar_default = ProgressBar;
57035
57036
57037;// ./node_modules/@wordpress/components/build-module/query-controls/terms.js
57038const ensureParentsAreDefined = (terms) => {
57039 return terms.every((term) => term.parent !== null);
57040};
57041function buildTermsTree(flatTerms) {
57042 const flatTermsWithParentAndChildren = flatTerms.map((term) => ({
57043 children: [],
57044 parent: null,
57045 ...term,
57046 id: String(term.id)
57047 }));
57048 if (!ensureParentsAreDefined(flatTermsWithParentAndChildren)) {
57049 return flatTermsWithParentAndChildren;
57050 }
57051 const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => {
57052 const {
57053 parent
57054 } = term;
57055 if (!acc[parent]) {
57056 acc[parent] = [];
57057 }
57058 acc[parent].push(term);
57059 return acc;
57060 }, {});
57061 const fillWithChildren = (terms) => {
57062 return terms.map((term) => {
57063 const children = termsByParent[term.id];
57064 return {
57065 ...term,
57066 children: children && children.length ? fillWithChildren(children) : []
57067 };
57068 });
57069 };
57070 return fillWithChildren(termsByParent["0"] || []);
57071}
57072
57073
57074;// external ["wp","htmlEntities"]
57075const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
57076;// ./node_modules/@wordpress/components/build-module/tree-select/index.js
57077
57078
57079
57080
57081
57082
57083
57084const tree_select_CONTEXT_VALUE = {
57085 BaseControl: {
57086 // Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`
57087 // via the context system to override the value set by SelectControl.
57088 _overrides: {
57089 __associatedWPComponentName: "TreeSelect"
57090 }
57091 }
57092};
57093function getSelectOptions(tree, level = 0) {
57094 return tree.flatMap((treeNode) => [{
57095 value: treeNode.id,
57096 label: "\xA0".repeat(level * 3) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name)
57097 }, ...getSelectOptions(treeNode.children || [], level + 1)]);
57098}
57099function TreeSelect(props) {
57100 const {
57101 label,
57102 noOptionLabel,
57103 onChange,
57104 selectedId,
57105 tree = [],
57106 ...restProps
57107 } = useDeprecated36pxDefaultSizeProp(props);
57108 const options = (0,external_wp_element_namespaceObject.useMemo)(() => {
57109 return [noOptionLabel && {
57110 value: "",
57111 label: noOptionLabel
57112 }, ...getSelectOptions(tree)].filter((option) => !!option);
57113 }, [noOptionLabel, tree]);
57114 maybeWarnDeprecated36pxSize({
57115 componentName: "TreeSelect",
57116 size: restProps.size,
57117 __next40pxDefaultSize: restProps.__next40pxDefaultSize
57118 });
57119 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
57120 value: tree_select_CONTEXT_VALUE,
57121 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SelectControl, {
57122 __shouldNotWarnDeprecated36pxSize: true,
57123 label,
57124 options,
57125 onChange,
57126 value: selectedId,
57127 ...restProps
57128 })
57129 });
57130}
57131var tree_select_default = TreeSelect;
57132
57133
57134;// ./node_modules/@wordpress/components/build-module/query-controls/author-select.js
57135
57136
57137
57138function AuthorSelect({
57139 __next40pxDefaultSize,
57140 label,
57141 noOptionLabel,
57142 authorList,
57143 selectedAuthorId,
57144 onChange: onChangeProp
57145}) {
57146 if (!authorList) {
57147 return null;
57148 }
57149 const termsTree = buildTermsTree(authorList);
57150 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_select_default, {
57151 label,
57152 noOptionLabel,
57153 onChange: onChangeProp,
57154 tree: termsTree,
57155 selectedId: selectedAuthorId !== void 0 ? String(selectedAuthorId) : void 0,
57156 __nextHasNoMarginBottom: true,
57157 __next40pxDefaultSize
57158 });
57159}
57160
57161
57162;// ./node_modules/@wordpress/components/build-module/query-controls/category-select.js
57163
57164
57165
57166
57167function CategorySelect({
57168 __next40pxDefaultSize,
57169 label,
57170 noOptionLabel,
57171 categoriesList,
57172 selectedCategoryId,
57173 onChange: onChangeProp,
57174 ...props
57175}) {
57176 const termsTree = (0,external_wp_element_namespaceObject.useMemo)(() => {
57177 return buildTermsTree(categoriesList);
57178 }, [categoriesList]);
57179 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_select_default, {
57180 label,
57181 noOptionLabel,
57182 onChange: onChangeProp,
57183 tree: termsTree,
57184 selectedId: selectedCategoryId !== void 0 ? String(selectedCategoryId) : void 0,
57185 ...props,
57186 __nextHasNoMarginBottom: true,
57187 __next40pxDefaultSize
57188 });
57189}
57190
57191
57192;// ./node_modules/@wordpress/components/build-module/query-controls/index.js
57193
57194
57195
57196
57197
57198
57199
57200
57201const DEFAULT_MIN_ITEMS = 1;
57202const DEFAULT_MAX_ITEMS = 100;
57203const MAX_CATEGORIES_SUGGESTIONS = 20;
57204function isSingleCategorySelection(props) {
57205 return "categoriesList" in props;
57206}
57207function isMultipleCategorySelection(props) {
57208 return "categorySuggestions" in props;
57209}
57210const defaultOrderByOptions = [{
57211 label: (0,external_wp_i18n_namespaceObject.__)("Newest to oldest"),
57212 value: "date/desc"
57213}, {
57214 label: (0,external_wp_i18n_namespaceObject.__)("Oldest to newest"),
57215 value: "date/asc"
57216}, {
57217 /* translators: Label for ordering posts by title in ascending order. */
57218 label: (0,external_wp_i18n_namespaceObject.__)("A \u2192 Z"),
57219 value: "title/asc"
57220}, {
57221 /* translators: Label for ordering posts by title in descending order. */
57222 label: (0,external_wp_i18n_namespaceObject.__)("Z \u2192 A"),
57223 value: "title/desc"
57224}];
57225function QueryControls({
57226 authorList,
57227 selectedAuthorId,
57228 numberOfItems,
57229 order,
57230 orderBy,
57231 orderByOptions = defaultOrderByOptions,
57232 maxItems = DEFAULT_MAX_ITEMS,
57233 minItems = DEFAULT_MIN_ITEMS,
57234 onAuthorChange,
57235 onNumberOfItemsChange,
57236 onOrderChange,
57237 onOrderByChange,
57238 // Props for single OR multiple category selection are not destructured here,
57239 // but instead are destructured inline where necessary.
57240 ...props
57241}) {
57242 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
57243 spacing: "4",
57244 className: "components-query-controls",
57245 children: [onOrderChange && onOrderByChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
57246 __nextHasNoMarginBottom: true,
57247 __next40pxDefaultSize: true,
57248 label: (0,external_wp_i18n_namespaceObject.__)("Order by"),
57249 value: orderBy === void 0 || order === void 0 ? void 0 : `${orderBy}/${order}`,
57250 options: orderByOptions,
57251 onChange: (value) => {
57252 if (typeof value !== "string") {
57253 return;
57254 }
57255 const [newOrderBy, newOrder] = value.split("/");
57256 if (newOrder !== order) {
57257 onOrderChange(newOrder);
57258 }
57259 if (newOrderBy !== orderBy) {
57260 onOrderByChange(newOrderBy);
57261 }
57262 }
57263 }, "query-controls-order-select"), isSingleCategorySelection(props) && props.categoriesList && props.onCategoryChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CategorySelect, {
57264 __next40pxDefaultSize: true,
57265 categoriesList: props.categoriesList,
57266 label: (0,external_wp_i18n_namespaceObject.__)("Category"),
57267 noOptionLabel: (0,external_wp_i18n_namespaceObject._x)("All", "categories"),
57268 selectedCategoryId: props.selectedCategoryId,
57269 onChange: props.onCategoryChange
57270 }, "query-controls-category-select"), isMultipleCategorySelection(props) && props.categorySuggestions && props.onCategoryChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(form_token_field_default, {
57271 __next40pxDefaultSize: true,
57272 __nextHasNoMarginBottom: true,
57273 label: (0,external_wp_i18n_namespaceObject.__)("Categories"),
57274 value: props.selectedCategories && props.selectedCategories.map((item) => ({
57275 id: item.id,
57276 // Keeping the fallback to `item.value` for legacy reasons,
57277 // even if items of `selectedCategories` should not have a
57278 // `value` property.
57279 // @ts-expect-error
57280 value: item.name || item.value
57281 })),
57282 suggestions: Object.keys(props.categorySuggestions),
57283 onChange: props.onCategoryChange,
57284 maxSuggestions: MAX_CATEGORIES_SUGGESTIONS
57285 }, "query-controls-categories-select"), onAuthorChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AuthorSelect, {
57286 __next40pxDefaultSize: true,
57287 authorList,
57288 label: (0,external_wp_i18n_namespaceObject.__)("Author"),
57289 noOptionLabel: (0,external_wp_i18n_namespaceObject._x)("All", "authors"),
57290 selectedAuthorId,
57291 onChange: onAuthorChange
57292 }, "query-controls-author-select"), onNumberOfItemsChange && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_default, {
57293 __nextHasNoMarginBottom: true,
57294 __next40pxDefaultSize: true,
57295 label: (0,external_wp_i18n_namespaceObject.__)("Number of items"),
57296 value: numberOfItems,
57297 onChange: onNumberOfItemsChange,
57298 min: minItems,
57299 max: maxItems,
57300 required: true
57301 }, "query-controls-range-control")]
57302 });
57303}
57304var query_controls_default = QueryControls;
57305
57306
57307;// ./node_modules/@wordpress/components/build-module/radio-group/context.js
57308
57309const RadioGroupContext = (0,external_wp_element_namespaceObject.createContext)({
57310 store: void 0,
57311 disabled: void 0
57312});
57313RadioGroupContext.displayName = "RadioGroupContext";
57314
57315
57316;// ./node_modules/@wordpress/components/build-module/radio-group/radio.js
57317
57318
57319
57320
57321
57322
57323function UnforwardedRadio({
57324 value,
57325 children,
57326 ...props
57327}, ref) {
57328 const {
57329 store,
57330 disabled
57331 } = (0,external_wp_element_namespaceObject.useContext)(RadioGroupContext);
57332 const selectedValue = useStoreState(store, "value");
57333 const isChecked = selectedValue !== void 0 && selectedValue === value;
57334 maybeWarnDeprecated36pxSize({
57335 componentName: "Radio",
57336 size: void 0,
57337 __next40pxDefaultSize: props.__next40pxDefaultSize
57338 });
57339 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Radio, {
57340 disabled,
57341 store,
57342 ref,
57343 value,
57344 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
57345 variant: isChecked ? "primary" : "secondary",
57346 ...props
57347 }),
57348 children: children || value
57349 });
57350}
57351const radio_Radio = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadio);
57352var radio_default = radio_Radio;
57353
57354
57355;// ./node_modules/@wordpress/components/build-module/radio-group/index.js
57356
57357
57358
57359
57360
57361
57362
57363function UnforwardedRadioGroup({
57364 label,
57365 checked,
57366 defaultChecked,
57367 disabled,
57368 onChange,
57369 children,
57370 ...props
57371}, ref) {
57372 const radioStore = useRadioStore({
57373 value: checked,
57374 defaultValue: defaultChecked,
57375 setValue: (newValue) => {
57376 onChange?.(newValue !== null && newValue !== void 0 ? newValue : void 0);
57377 },
57378 rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
57379 });
57380 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
57381 store: radioStore,
57382 disabled
57383 }), [radioStore, disabled]);
57384 external_wp_deprecated_default()("wp.components.__experimentalRadioGroup", {
57385 alternative: "wp.components.RadioControl or wp.components.__experimentalToggleGroupControl",
57386 since: "6.8"
57387 });
57388 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroupContext.Provider, {
57389 value: contextValue,
57390 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, {
57391 store: radioStore,
57392 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_group_default, {
57393 __shouldNotWarnDeprecated: true,
57394 children
57395 }),
57396 "aria-label": label,
57397 ref,
57398 ...props
57399 })
57400 });
57401}
57402const radio_group_RadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadioGroup);
57403var radio_group_default = radio_group_RadioGroup;
57404
57405
57406;// ./node_modules/@wordpress/components/build-module/radio-control/index.js
57407
57408
57409
57410
57411
57412
57413
57414function generateOptionDescriptionId(radioGroupId, index) {
57415 return `${radioGroupId}-${index}-option-description`;
57416}
57417function generateOptionId(radioGroupId, index) {
57418 return `${radioGroupId}-${index}`;
57419}
57420function generateHelpId(radioGroupId) {
57421 return `${radioGroupId}__help`;
57422}
57423function RadioControl(props) {
57424 const {
57425 label,
57426 className,
57427 selected,
57428 help,
57429 onChange,
57430 onClick,
57431 hideLabelFromVision,
57432 options = [],
57433 id: preferredId,
57434 ...additionalProps
57435 } = props;
57436 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(RadioControl, "inspector-radio-control", preferredId);
57437 const onChangeValue = (event) => onChange(event.target.value);
57438 if (!options?.length) {
57439 return null;
57440 }
57441 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
57442 id,
57443 className: dist_clsx(className, "components-radio-control"),
57444 "aria-describedby": !!help ? generateHelpId(id) : void 0,
57445 children: [hideLabelFromVision ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_component_default, {
57446 as: "legend",
57447 children: label
57448 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default.VisualLabel, {
57449 as: "legend",
57450 children: label
57451 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(v_stack_component_component_default, {
57452 spacing: 3,
57453 className: dist_clsx("components-radio-control__group-wrapper", {
57454 "has-help": !!help
57455 }),
57456 children: options.map((option, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
57457 className: "components-radio-control__option",
57458 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
57459 id: generateOptionId(id, index),
57460 className: "components-radio-control__input",
57461 type: "radio",
57462 name: id,
57463 value: option.value,
57464 onChange: onChangeValue,
57465 checked: option.value === selected,
57466 "aria-describedby": !!option.description ? generateOptionDescriptionId(id, index) : void 0,
57467 onClick: (event) => {
57468 event.currentTarget.focus();
57469 onClick?.(event);
57470 },
57471 ...additionalProps
57472 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
57473 className: "components-radio-control__label",
57474 htmlFor: generateOptionId(id, index),
57475 children: option.label
57476 }), !!option.description ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
57477 __nextHasNoMarginBottom: true,
57478 id: generateOptionDescriptionId(id, index),
57479 className: "components-radio-control__option-description",
57480 children: option.description
57481 }) : null]
57482 }, generateOptionId(id, index)))
57483 }), !!help && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledHelp, {
57484 __nextHasNoMarginBottom: true,
57485 id: generateHelpId(id),
57486 className: "components-base-control__help",
57487 children: help
57488 })]
57489 });
57490}
57491var radio_control_default = RadioControl;
57492
57493
57494;// ./node_modules/re-resizable/lib/resizer.js
57495var resizer_extends = (undefined && undefined.__extends) || (function () {
57496 var extendStatics = function (d, b) {
57497 extendStatics = Object.setPrototypeOf ||
57498 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
57499 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
57500 return extendStatics(d, b);
57501 };
57502 return function (d, b) {
57503 extendStatics(d, b);
57504 function __() { this.constructor = d; }
57505 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57506 };
57507})();
57508var resizer_assign = (undefined && undefined.__assign) || function () {
57509 resizer_assign = Object.assign || function(t) {
57510 for (var s, i = 1, n = arguments.length; i < n; i++) {
57511 s = arguments[i];
57512 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
57513 t[p] = s[p];
57514 }
57515 return t;
57516 };
57517 return resizer_assign.apply(this, arguments);
57518};
57519
57520var rowSizeBase = {
57521 width: '100%',
57522 height: '10px',
57523 top: '0px',
57524 left: '0px',
57525 cursor: 'row-resize',
57526};
57527var colSizeBase = {
57528 width: '10px',
57529 height: '100%',
57530 top: '0px',
57531 left: '0px',
57532 cursor: 'col-resize',
57533};
57534var edgeBase = {
57535 width: '20px',
57536 height: '20px',
57537 position: 'absolute',
57538};
57539var resizer_styles = {
57540 top: resizer_assign(resizer_assign({}, rowSizeBase), { top: '-5px' }),
57541 right: resizer_assign(resizer_assign({}, colSizeBase), { left: undefined, right: '-5px' }),
57542 bottom: resizer_assign(resizer_assign({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
57543 left: resizer_assign(resizer_assign({}, colSizeBase), { left: '-5px' }),
57544 topRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', top: '-10px', cursor: 'ne-resize' }),
57545 bottomRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', bottom: '-10px', cursor: 'se-resize' }),
57546 bottomLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', bottom: '-10px', cursor: 'sw-resize' }),
57547 topLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
57548};
57549var Resizer = /** @class */ (function (_super) {
57550 resizer_extends(Resizer, _super);
57551 function Resizer() {
57552 var _this = _super !== null && _super.apply(this, arguments) || this;
57553 _this.onMouseDown = function (e) {
57554 _this.props.onResizeStart(e, _this.props.direction);
57555 };
57556 _this.onTouchStart = function (e) {
57557 _this.props.onResizeStart(e, _this.props.direction);
57558 };
57559 return _this;
57560 }
57561 Resizer.prototype.render = function () {
57562 return (external_React_.createElement("div", { className: this.props.className || '', style: resizer_assign(resizer_assign({ position: 'absolute', userSelect: 'none' }, resizer_styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
57563 };
57564 return Resizer;
57565}(external_React_.PureComponent));
57566
57567
57568;// ./node_modules/re-resizable/lib/index.js
57569var lib_extends = (undefined && undefined.__extends) || (function () {
57570 var extendStatics = function (d, b) {
57571 extendStatics = Object.setPrototypeOf ||
57572 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
57573 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
57574 return extendStatics(d, b);
57575 };
57576 return function (d, b) {
57577 extendStatics(d, b);
57578 function __() { this.constructor = d; }
57579 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57580 };
57581})();
57582var lib_assign = (undefined && undefined.__assign) || function () {
57583 lib_assign = Object.assign || function(t) {
57584 for (var s, i = 1, n = arguments.length; i < n; i++) {
57585 s = arguments[i];
57586 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
57587 t[p] = s[p];
57588 }
57589 return t;
57590 };
57591 return lib_assign.apply(this, arguments);
57592};
57593
57594
57595
57596var DEFAULT_SIZE = {
57597 width: 'auto',
57598 height: 'auto',
57599};
57600var lib_clamp = function (n, min, max) { return Math.max(Math.min(n, max), min); };
57601var snap = function (n, size) { return Math.round(n / size) * size; };
57602var hasDirection = function (dir, target) {
57603 return new RegExp(dir, 'i').test(target);
57604};
57605// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
57606var isTouchEvent = function (event) {
57607 return Boolean(event.touches && event.touches.length);
57608};
57609var isMouseEvent = function (event) {
57610 return Boolean((event.clientX || event.clientX === 0) &&
57611 (event.clientY || event.clientY === 0));
57612};
57613var findClosestSnap = function (n, snapArray, snapGap) {
57614 if (snapGap === void 0) { snapGap = 0; }
57615 var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
57616 var gap = Math.abs(snapArray[closestGapIndex] - n);
57617 return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
57618};
57619var getStringSize = function (n) {
57620 n = n.toString();
57621 if (n === 'auto') {
57622 return n;
57623 }
57624 if (n.endsWith('px')) {
57625 return n;
57626 }
57627 if (n.endsWith('%')) {
57628 return n;
57629 }
57630 if (n.endsWith('vh')) {
57631 return n;
57632 }
57633 if (n.endsWith('vw')) {
57634 return n;
57635 }
57636 if (n.endsWith('vmax')) {
57637 return n;
57638 }
57639 if (n.endsWith('vmin')) {
57640 return n;
57641 }
57642 return n + "px";
57643};
57644var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
57645 if (size && typeof size === 'string') {
57646 if (size.endsWith('px')) {
57647 return Number(size.replace('px', ''));
57648 }
57649 if (size.endsWith('%')) {
57650 var ratio = Number(size.replace('%', '')) / 100;
57651 return parentSize * ratio;
57652 }
57653 if (size.endsWith('vw')) {
57654 var ratio = Number(size.replace('vw', '')) / 100;
57655 return innerWidth * ratio;
57656 }
57657 if (size.endsWith('vh')) {
57658 var ratio = Number(size.replace('vh', '')) / 100;
57659 return innerHeight * ratio;
57660 }
57661 }
57662 return size;
57663};
57664var calculateNewMax = function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
57665 maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
57666 maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
57667 minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
57668 minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
57669 return {
57670 maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
57671 maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
57672 minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
57673 minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
57674 };
57675};
57676var definedProps = [
57677 'as',
57678 'style',
57679 'className',
57680 'grid',
57681 'snap',
57682 'bounds',
57683 'boundsByDirection',
57684 'size',
57685 'defaultSize',
57686 'minWidth',
57687 'minHeight',
57688 'maxWidth',
57689 'maxHeight',
57690 'lockAspectRatio',
57691 'lockAspectRatioExtraWidth',
57692 'lockAspectRatioExtraHeight',
57693 'enable',
57694 'handleStyles',
57695 'handleClasses',
57696 'handleWrapperStyle',
57697 'handleWrapperClass',
57698 'children',
57699 'onResizeStart',
57700 'onResize',
57701 'onResizeStop',
57702 'handleComponent',
57703 'scale',
57704 'resizeRatio',
57705 'snapGap',
57706];
57707// HACK: This class is used to calculate % size.
57708var baseClassName = '__resizable_base__';
57709var Resizable = /** @class */ (function (_super) {
57710 lib_extends(Resizable, _super);
57711 function Resizable(props) {
57712 var _this = _super.call(this, props) || this;
57713 _this.ratio = 1;
57714 _this.resizable = null;
57715 // For parent boundary
57716 _this.parentLeft = 0;
57717 _this.parentTop = 0;
57718 // For boundary
57719 _this.resizableLeft = 0;
57720 _this.resizableRight = 0;
57721 _this.resizableTop = 0;
57722 _this.resizableBottom = 0;
57723 // For target boundary
57724 _this.targetLeft = 0;
57725 _this.targetTop = 0;
57726 _this.appendBase = function () {
57727 if (!_this.resizable || !_this.window) {
57728 return null;
57729 }
57730 var parent = _this.parentNode;
57731 if (!parent) {
57732 return null;
57733 }
57734 var element = _this.window.document.createElement('div');
57735 element.style.width = '100%';
57736 element.style.height = '100%';
57737 element.style.position = 'absolute';
57738 element.style.transform = 'scale(0, 0)';
57739 element.style.left = '0';
57740 element.style.flex = '0 0 100%';
57741 if (element.classList) {
57742 element.classList.add(baseClassName);
57743 }
57744 else {
57745 element.className += baseClassName;
57746 }
57747 parent.appendChild(element);
57748 return element;
57749 };
57750 _this.removeBase = function (base) {
57751 var parent = _this.parentNode;
57752 if (!parent) {
57753 return;
57754 }
57755 parent.removeChild(base);
57756 };
57757 _this.ref = function (c) {
57758 if (c) {
57759 _this.resizable = c;
57760 }
57761 };
57762 _this.state = {
57763 isResizing: false,
57764 width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined'
57765 ? 'auto'
57766 : _this.propsSize && _this.propsSize.width,
57767 height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined'
57768 ? 'auto'
57769 : _this.propsSize && _this.propsSize.height,
57770 direction: 'right',
57771 original: {
57772 x: 0,
57773 y: 0,
57774 width: 0,
57775 height: 0,
57776 },
57777 backgroundStyle: {
57778 height: '100%',
57779 width: '100%',
57780 backgroundColor: 'rgba(0,0,0,0)',
57781 cursor: 'auto',
57782 opacity: 0,
57783 position: 'fixed',
57784 zIndex: 9999,
57785 top: '0',
57786 left: '0',
57787 bottom: '0',
57788 right: '0',
57789 },
57790 flexBasis: undefined,
57791 };
57792 _this.onResizeStart = _this.onResizeStart.bind(_this);
57793 _this.onMouseMove = _this.onMouseMove.bind(_this);
57794 _this.onMouseUp = _this.onMouseUp.bind(_this);
57795 return _this;
57796 }
57797 Object.defineProperty(Resizable.prototype, "parentNode", {
57798 get: function () {
57799 if (!this.resizable) {
57800 return null;
57801 }
57802 return this.resizable.parentNode;
57803 },
57804 enumerable: false,
57805 configurable: true
57806 });
57807 Object.defineProperty(Resizable.prototype, "window", {
57808 get: function () {
57809 if (!this.resizable) {
57810 return null;
57811 }
57812 if (!this.resizable.ownerDocument) {
57813 return null;
57814 }
57815 return this.resizable.ownerDocument.defaultView;
57816 },
57817 enumerable: false,
57818 configurable: true
57819 });
57820 Object.defineProperty(Resizable.prototype, "propsSize", {
57821 get: function () {
57822 return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
57823 },
57824 enumerable: false,
57825 configurable: true
57826 });
57827 Object.defineProperty(Resizable.prototype, "size", {
57828 get: function () {
57829 var width = 0;
57830 var height = 0;
57831 if (this.resizable && this.window) {
57832 var orgWidth = this.resizable.offsetWidth;
57833 var orgHeight = this.resizable.offsetHeight;
57834 // HACK: Set position `relative` to get parent size.
57835 // This is because when re-resizable set `absolute`, I can not get base width correctly.
57836 var orgPosition = this.resizable.style.position;
57837 if (orgPosition !== 'relative') {
57838 this.resizable.style.position = 'relative';
57839 }
57840 // INFO: Use original width or height if set auto.
57841 width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
57842 height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
57843 // Restore original position
57844 this.resizable.style.position = orgPosition;
57845 }
57846 return { width: width, height: height };
57847 },
57848 enumerable: false,
57849 configurable: true
57850 });
57851 Object.defineProperty(Resizable.prototype, "sizeStyle", {
57852 get: function () {
57853 var _this = this;
57854 var size = this.props.size;
57855 var getSize = function (key) {
57856 if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
57857 return 'auto';
57858 }
57859 if (_this.propsSize && _this.propsSize[key] && _this.propsSize[key].toString().endsWith('%')) {
57860 if (_this.state[key].toString().endsWith('%')) {
57861 return _this.state[key].toString();
57862 }
57863 var parentSize = _this.getParentSize();
57864 var value = Number(_this.state[key].toString().replace('px', ''));
57865 var percent = (value / parentSize[key]) * 100;
57866 return percent + "%";
57867 }
57868 return getStringSize(_this.state[key]);
57869 };
57870 var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
57871 ? getStringSize(size.width)
57872 : getSize('width');
57873 var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
57874 ? getStringSize(size.height)
57875 : getSize('height');
57876 return { width: width, height: height };
57877 },
57878 enumerable: false,
57879 configurable: true
57880 });
57881 Resizable.prototype.getParentSize = function () {
57882 if (!this.parentNode) {
57883 if (!this.window) {
57884 return { width: 0, height: 0 };
57885 }
57886 return { width: this.window.innerWidth, height: this.window.innerHeight };
57887 }
57888 var base = this.appendBase();
57889 if (!base) {
57890 return { width: 0, height: 0 };
57891 }
57892 // INFO: To calculate parent width with flex layout
57893 var wrapChanged = false;
57894 var wrap = this.parentNode.style.flexWrap;
57895 if (wrap !== 'wrap') {
57896 wrapChanged = true;
57897 this.parentNode.style.flexWrap = 'wrap';
57898 // HACK: Use relative to get parent padding size
57899 }
57900 base.style.position = 'relative';
57901 base.style.minWidth = '100%';
57902 base.style.minHeight = '100%';
57903 var size = {
57904 width: base.offsetWidth,
57905 height: base.offsetHeight,
57906 };
57907 if (wrapChanged) {
57908 this.parentNode.style.flexWrap = wrap;
57909 }
57910 this.removeBase(base);
57911 return size;
57912 };
57913 Resizable.prototype.bindEvents = function () {
57914 if (this.window) {
57915 this.window.addEventListener('mouseup', this.onMouseUp);
57916 this.window.addEventListener('mousemove', this.onMouseMove);
57917 this.window.addEventListener('mouseleave', this.onMouseUp);
57918 this.window.addEventListener('touchmove', this.onMouseMove, {
57919 capture: true,
57920 passive: false,
57921 });
57922 this.window.addEventListener('touchend', this.onMouseUp);
57923 }
57924 };
57925 Resizable.prototype.unbindEvents = function () {
57926 if (this.window) {
57927 this.window.removeEventListener('mouseup', this.onMouseUp);
57928 this.window.removeEventListener('mousemove', this.onMouseMove);
57929 this.window.removeEventListener('mouseleave', this.onMouseUp);
57930 this.window.removeEventListener('touchmove', this.onMouseMove, true);
57931 this.window.removeEventListener('touchend', this.onMouseUp);
57932 }
57933 };
57934 Resizable.prototype.componentDidMount = function () {
57935 if (!this.resizable || !this.window) {
57936 return;
57937 }
57938 var computedStyle = this.window.getComputedStyle(this.resizable);
57939 this.setState({
57940 width: this.state.width || this.size.width,
57941 height: this.state.height || this.size.height,
57942 flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
57943 });
57944 };
57945 Resizable.prototype.componentWillUnmount = function () {
57946 if (this.window) {
57947 this.unbindEvents();
57948 }
57949 };
57950 Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
57951 var propsSize = this.propsSize && this.propsSize[kind];
57952 return this.state[kind] === 'auto' &&
57953 this.state.original[kind] === newSize &&
57954 (typeof propsSize === 'undefined' || propsSize === 'auto')
57955 ? 'auto'
57956 : newSize;
57957 };
57958 Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
57959 var boundsByDirection = this.props.boundsByDirection;
57960 var direction = this.state.direction;
57961 var widthByDirection = boundsByDirection && hasDirection('left', direction);
57962 var heightByDirection = boundsByDirection && hasDirection('top', direction);
57963 var boundWidth;
57964 var boundHeight;
57965 if (this.props.bounds === 'parent') {
57966 var parent_1 = this.parentNode;
57967 if (parent_1) {
57968 boundWidth = widthByDirection
57969 ? this.resizableRight - this.parentLeft
57970 : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
57971 boundHeight = heightByDirection
57972 ? this.resizableBottom - this.parentTop
57973 : parent_1.offsetHeight + (this.parentTop - this.resizableTop);
57974 }
57975 }
57976 else if (this.props.bounds === 'window') {
57977 if (this.window) {
57978 boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
57979 boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
57980 }
57981 }
57982 else if (this.props.bounds) {
57983 boundWidth = widthByDirection
57984 ? this.resizableRight - this.targetLeft
57985 : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
57986 boundHeight = heightByDirection
57987 ? this.resizableBottom - this.targetTop
57988 : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
57989 }
57990 if (boundWidth && Number.isFinite(boundWidth)) {
57991 maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
57992 }
57993 if (boundHeight && Number.isFinite(boundHeight)) {
57994 maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
57995 }
57996 return { maxWidth: maxWidth, maxHeight: maxHeight };
57997 };
57998 Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
57999 var scale = this.props.scale || 1;
58000 var resizeRatio = this.props.resizeRatio || 1;
58001 var _a = this.state, direction = _a.direction, original = _a.original;
58002 var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
58003 var newWidth = original.width;
58004 var newHeight = original.height;
58005 var extraHeight = lockAspectRatioExtraHeight || 0;
58006 var extraWidth = lockAspectRatioExtraWidth || 0;
58007 if (hasDirection('right', direction)) {
58008 newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;
58009 if (lockAspectRatio) {
58010 newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
58011 }
58012 }
58013 if (hasDirection('left', direction)) {
58014 newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;
58015 if (lockAspectRatio) {
58016 newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
58017 }
58018 }
58019 if (hasDirection('bottom', direction)) {
58020 newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;
58021 if (lockAspectRatio) {
58022 newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
58023 }
58024 }
58025 if (hasDirection('top', direction)) {
58026 newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;
58027 if (lockAspectRatio) {
58028 newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
58029 }
58030 }
58031 return { newWidth: newWidth, newHeight: newHeight };
58032 };
58033 Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
58034 var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
58035 var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
58036 var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
58037 var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
58038 var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
58039 var extraHeight = lockAspectRatioExtraHeight || 0;
58040 var extraWidth = lockAspectRatioExtraWidth || 0;
58041 if (lockAspectRatio) {
58042 var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
58043 var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
58044 var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
58045 var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
58046 var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
58047 var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
58048 var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
58049 var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
58050 newWidth = lib_clamp(newWidth, lockedMinWidth, lockedMaxWidth);
58051 newHeight = lib_clamp(newHeight, lockedMinHeight, lockedMaxHeight);
58052 }
58053 else {
58054 newWidth = lib_clamp(newWidth, computedMinWidth, computedMaxWidth);
58055 newHeight = lib_clamp(newHeight, computedMinHeight, computedMaxHeight);
58056 }
58057 return { newWidth: newWidth, newHeight: newHeight };
58058 };
58059 Resizable.prototype.setBoundingClientRect = function () {
58060 // For parent boundary
58061 if (this.props.bounds === 'parent') {
58062 var parent_2 = this.parentNode;
58063 if (parent_2) {
58064 var parentRect = parent_2.getBoundingClientRect();
58065 this.parentLeft = parentRect.left;
58066 this.parentTop = parentRect.top;
58067 }
58068 }
58069 // For target(html element) boundary
58070 if (this.props.bounds && typeof this.props.bounds !== 'string') {
58071 var targetRect = this.props.bounds.getBoundingClientRect();
58072 this.targetLeft = targetRect.left;
58073 this.targetTop = targetRect.top;
58074 }
58075 // For boundary
58076 if (this.resizable) {
58077 var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;
58078 this.resizableLeft = left;
58079 this.resizableRight = right;
58080 this.resizableTop = top_1;
58081 this.resizableBottom = bottom;
58082 }
58083 };
58084 Resizable.prototype.onResizeStart = function (event, direction) {
58085 if (!this.resizable || !this.window) {
58086 return;
58087 }
58088 var clientX = 0;
58089 var clientY = 0;
58090 if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
58091 clientX = event.nativeEvent.clientX;
58092 clientY = event.nativeEvent.clientY;
58093 }
58094 else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
58095 clientX = event.nativeEvent.touches[0].clientX;
58096 clientY = event.nativeEvent.touches[0].clientY;
58097 }
58098 if (this.props.onResizeStart) {
58099 if (this.resizable) {
58100 var startResize = this.props.onResizeStart(event, direction, this.resizable);
58101 if (startResize === false) {
58102 return;
58103 }
58104 }
58105 }
58106 // Fix #168
58107 if (this.props.size) {
58108 if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
58109 this.setState({ height: this.props.size.height });
58110 }
58111 if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
58112 this.setState({ width: this.props.size.width });
58113 }
58114 }
58115 // For lockAspectRatio case
58116 this.ratio =
58117 typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
58118 var flexBasis;
58119 var computedStyle = this.window.getComputedStyle(this.resizable);
58120 if (computedStyle.flexBasis !== 'auto') {
58121 var parent_3 = this.parentNode;
58122 if (parent_3) {
58123 var dir = this.window.getComputedStyle(parent_3).flexDirection;
58124 this.flexDir = dir.startsWith('row') ? 'row' : 'column';
58125 flexBasis = computedStyle.flexBasis;
58126 }
58127 }
58128 // For boundary
58129 this.setBoundingClientRect();
58130 this.bindEvents();
58131 var state = {
58132 original: {
58133 x: clientX,
58134 y: clientY,
58135 width: this.size.width,
58136 height: this.size.height,
58137 },
58138 isResizing: true,
58139 backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
58140 direction: direction,
58141 flexBasis: flexBasis,
58142 };
58143 this.setState(state);
58144 };
58145 Resizable.prototype.onMouseMove = function (event) {
58146 var _this = this;
58147 if (!this.state.isResizing || !this.resizable || !this.window) {
58148 return;
58149 }
58150 if (this.window.TouchEvent && isTouchEvent(event)) {
58151 try {
58152 event.preventDefault();
58153 event.stopPropagation();
58154 }
58155 catch (e) {
58156 // Ignore on fail
58157 }
58158 }
58159 var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
58160 var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
58161 var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
58162 var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
58163 var parentSize = this.getParentSize();
58164 var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
58165 maxWidth = max.maxWidth;
58166 maxHeight = max.maxHeight;
58167 minWidth = max.minWidth;
58168 minHeight = max.minHeight;
58169 // Calculate new size
58170 var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
58171 // Calculate max size from boundary settings
58172 var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
58173 if (this.props.snap && this.props.snap.x) {
58174 newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
58175 }
58176 if (this.props.snap && this.props.snap.y) {
58177 newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
58178 }
58179 // Calculate new size from aspect ratio
58180 var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
58181 newWidth = newSize.newWidth;
58182 newHeight = newSize.newHeight;
58183 if (this.props.grid) {
58184 var newGridWidth = snap(newWidth, this.props.grid[0]);
58185 var newGridHeight = snap(newHeight, this.props.grid[1]);
58186 var gap = this.props.snapGap || 0;
58187 newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
58188 newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
58189 }
58190 var delta = {
58191 width: newWidth - original.width,
58192 height: newHeight - original.height,
58193 };
58194 if (width && typeof width === 'string') {
58195 if (width.endsWith('%')) {
58196 var percent = (newWidth / parentSize.width) * 100;
58197 newWidth = percent + "%";
58198 }
58199 else if (width.endsWith('vw')) {
58200 var vw = (newWidth / this.window.innerWidth) * 100;
58201 newWidth = vw + "vw";
58202 }
58203 else if (width.endsWith('vh')) {
58204 var vh = (newWidth / this.window.innerHeight) * 100;
58205 newWidth = vh + "vh";
58206 }
58207 }
58208 if (height && typeof height === 'string') {
58209 if (height.endsWith('%')) {
58210 var percent = (newHeight / parentSize.height) * 100;
58211 newHeight = percent + "%";
58212 }
58213 else if (height.endsWith('vw')) {
58214 var vw = (newHeight / this.window.innerWidth) * 100;
58215 newHeight = vw + "vw";
58216 }
58217 else if (height.endsWith('vh')) {
58218 var vh = (newHeight / this.window.innerHeight) * 100;
58219 newHeight = vh + "vh";
58220 }
58221 }
58222 var newState = {
58223 width: this.createSizeForCssProperty(newWidth, 'width'),
58224 height: this.createSizeForCssProperty(newHeight, 'height'),
58225 };
58226 if (this.flexDir === 'row') {
58227 newState.flexBasis = newState.width;
58228 }
58229 else if (this.flexDir === 'column') {
58230 newState.flexBasis = newState.height;
58231 }
58232 // For v18, update state sync
58233 (0,external_ReactDOM_namespaceObject.flushSync)(function () {
58234 _this.setState(newState);
58235 });
58236 if (this.props.onResize) {
58237 this.props.onResize(event, direction, this.resizable, delta);
58238 }
58239 };
58240 Resizable.prototype.onMouseUp = function (event) {
58241 var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;
58242 if (!isResizing || !this.resizable) {
58243 return;
58244 }
58245 var delta = {
58246 width: this.size.width - original.width,
58247 height: this.size.height - original.height,
58248 };
58249 if (this.props.onResizeStop) {
58250 this.props.onResizeStop(event, direction, this.resizable, delta);
58251 }
58252 if (this.props.size) {
58253 this.setState(this.props.size);
58254 }
58255 this.unbindEvents();
58256 this.setState({
58257 isResizing: false,
58258 backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
58259 });
58260 };
58261 Resizable.prototype.updateSize = function (size) {
58262 this.setState({ width: size.width, height: size.height });
58263 };
58264 Resizable.prototype.renderResizer = function () {
58265 var _this = this;
58266 var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
58267 if (!enable) {
58268 return null;
58269 }
58270 var resizers = Object.keys(enable).map(function (dir) {
58271 if (enable[dir] !== false) {
58272 return (external_React_.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
58273 }
58274 return null;
58275 });
58276 // #93 Wrap the resize box in span (will not break 100% width/height)
58277 return (external_React_.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
58278 };
58279 Resizable.prototype.render = function () {
58280 var _this = this;
58281 var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
58282 if (definedProps.indexOf(key) !== -1) {
58283 return acc;
58284 }
58285 acc[key] = _this.props[key];
58286 return acc;
58287 }, {});
58288 var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
58289 if (this.state.flexBasis) {
58290 style.flexBasis = this.state.flexBasis;
58291 }
58292 var Wrapper = this.props.as || 'div';
58293 return (external_React_.createElement(Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
58294 this.state.isResizing && external_React_.createElement("div", { style: this.state.backgroundStyle }),
58295 this.props.children,
58296 this.renderResizer()));
58297 };
58298 Resizable.defaultProps = {
58299 as: 'div',
58300 onResizeStart: function () { },
58301 onResize: function () { },
58302 onResizeStop: function () { },
58303 enable: {
58304 top: true,
58305 right: true,
58306 bottom: true,
58307 left: true,
58308 topRight: true,
58309 bottomRight: true,
58310 bottomLeft: true,
58311 topLeft: true,
58312 },
58313 style: {},
58314 grid: [1, 1],
58315 lockAspectRatio: false,
58316 lockAspectRatioExtraWidth: 0,
58317 lockAspectRatioExtraHeight: 0,
58318 scale: 1,
58319 resizeRatio: 1,
58320 snapGap: 0,
58321 };
58322 return Resizable;
58323}(external_React_.PureComponent));
58324
58325
58326;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/utils.js
58327
58328
58329const utils_noop = () => {
58330};
58331const POSITIONS = {
58332 bottom: "bottom",
58333 corner: "corner"
58334};
58335function useResizeLabel({
58336 axis,
58337 fadeTimeout = 180,
58338 onResize = utils_noop,
58339 position = POSITIONS.bottom,
58340 showPx = false
58341}) {
58342 const [resizeListener, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
58343 const isAxisControlled = !!axis;
58344 const [moveX, setMoveX] = (0,external_wp_element_namespaceObject.useState)(false);
58345 const [moveY, setMoveY] = (0,external_wp_element_namespaceObject.useState)(false);
58346 const {
58347 width,
58348 height
58349 } = sizes;
58350 const heightRef = (0,external_wp_element_namespaceObject.useRef)(height);
58351 const widthRef = (0,external_wp_element_namespaceObject.useRef)(width);
58352 const moveTimeoutRef = (0,external_wp_element_namespaceObject.useRef)();
58353 const debounceUnsetMoveXY = (0,external_wp_element_namespaceObject.useCallback)(() => {
58354 const unsetMoveXY = () => {
58355 if (isAxisControlled) {
58356 return;
58357 }
58358 setMoveX(false);
58359 setMoveY(false);
58360 };
58361 if (moveTimeoutRef.current) {
58362 window.clearTimeout(moveTimeoutRef.current);
58363 }
58364 moveTimeoutRef.current = window.setTimeout(unsetMoveXY, fadeTimeout);
58365 }, [fadeTimeout, isAxisControlled]);
58366 (0,external_wp_element_namespaceObject.useEffect)(() => {
58367 const isRendered = width !== null || height !== null;
58368 if (!isRendered) {
58369 return;
58370 }
58371 const didWidthChange = width !== widthRef.current;
58372 const didHeightChange = height !== heightRef.current;
58373 if (!didWidthChange && !didHeightChange) {
58374 return;
58375 }
58376 if (width && !widthRef.current && height && !heightRef.current) {
58377 widthRef.current = width;
58378 heightRef.current = height;
58379 return;
58380 }
58381 if (didWidthChange) {
58382 setMoveX(true);
58383 widthRef.current = width;
58384 }
58385 if (didHeightChange) {
58386 setMoveY(true);
58387 heightRef.current = height;
58388 }
58389 onResize({
58390 width,
58391 height
58392 });
58393 debounceUnsetMoveXY();
58394 }, [width, height, onResize, debounceUnsetMoveXY]);
58395 const label = getSizeLabel({
58396 axis,
58397 height,
58398 moveX,
58399 moveY,
58400 position,
58401 showPx,
58402 width
58403 });
58404 return {
58405 label,
58406 resizeListener
58407 };
58408}
58409function getSizeLabel({
58410 axis,
58411 height,
58412 moveX = false,
58413 moveY = false,
58414 position = POSITIONS.bottom,
58415 showPx = false,
58416 width
58417}) {
58418 if (!moveX && !moveY) {
58419 return void 0;
58420 }
58421 if (position === POSITIONS.corner) {
58422 return `${width} x ${height}`;
58423 }
58424 const labelUnit = showPx ? " px" : "";
58425 if (axis) {
58426 if (axis === "x" && moveX) {
58427 return `${width}${labelUnit}`;
58428 }
58429 if (axis === "y" && moveY) {
58430 return `${height}${labelUnit}`;
58431 }
58432 }
58433 if (moveX && moveY) {
58434 return `${width} x ${height}`;
58435 }
58436 if (moveX) {
58437 return `${width}${labelUnit}`;
58438 }
58439 if (moveY) {
58440 return `${height}${labelUnit}`;
58441 }
58442 return void 0;
58443}
58444
58445
58446;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js
58447
58448function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
58449 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
58450}
58451
58452
58453const resize_tooltip_styles_Root = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
58454 target: "e1wq7y4k3"
58455} : 0)( true ? {
58456 name: "1cd7zoc",
58457 styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"
58458} : 0);
58459const TooltipWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
58460 target: "e1wq7y4k2"
58461} : 0)( true ? {
58462 name: "ajymcs",
58463 styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"
58464} : 0);
58465const resize_tooltip_styles_Tooltip = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
58466 target: "e1wq7y4k1"
58467} : 0)("background:", COLORS.theme.foreground, ";border-radius:", config_values_default.radiusSmall, ";box-sizing:border-box;font-family:", font("default.fontFamily"), ";font-size:12px;color:", COLORS.theme.foregroundInverted, ";padding:4px 8px;position:relative;" + ( true ? "" : 0));
58468const LabelText = /* @__PURE__ */ emotion_styled_base_browser_esm(text_component_component_default, true ? {
58469 target: "e1wq7y4k0"
58470} : 0)("&&&{color:", COLORS.theme.foregroundInverted, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0));
58471
58472
58473;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js
58474
58475
58476
58477
58478
58479const CORNER_OFFSET = 4;
58480const CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;
58481function resize_tooltip_label_Label({
58482 label,
58483 position = POSITIONS.corner,
58484 zIndex = 1e3,
58485 ...props
58486}, ref) {
58487 const showLabel = !!label;
58488 const isBottom = position === POSITIONS.bottom;
58489 const isCorner = position === POSITIONS.corner;
58490 if (!showLabel) {
58491 return null;
58492 }
58493 let style = {
58494 opacity: showLabel ? 1 : void 0,
58495 zIndex
58496 };
58497 let labelStyle = {};
58498 if (isBottom) {
58499 style = {
58500 ...style,
58501 position: "absolute",
58502 bottom: CURSOR_OFFSET_TOP * -1,
58503 left: "50%",
58504 transform: "translate(-50%, 0)"
58505 };
58506 labelStyle = {
58507 transform: `translate(0, 100%)`
58508 };
58509 }
58510 if (isCorner) {
58511 style = {
58512 ...style,
58513 position: "absolute",
58514 top: CORNER_OFFSET,
58515 right: (0,external_wp_i18n_namespaceObject.isRTL)() ? void 0 : CORNER_OFFSET,
58516 left: (0,external_wp_i18n_namespaceObject.isRTL)() ? CORNER_OFFSET : void 0
58517 };
58518 }
58519 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipWrapper, {
58520 "aria-hidden": "true",
58521 className: "components-resizable-tooltip__tooltip-wrapper",
58522 ref,
58523 style,
58524 ...props,
58525 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_styles_Tooltip, {
58526 className: "components-resizable-tooltip__tooltip",
58527 style: labelStyle,
58528 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(LabelText, {
58529 as: "span",
58530 children: label
58531 })
58532 })
58533 });
58534}
58535const label_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(resize_tooltip_label_Label);
58536var label_default = label_ForwardedComponent;
58537
58538
58539;// ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js
58540
58541
58542
58543
58544
58545
58546const resize_tooltip_noop = () => {
58547};
58548function ResizeTooltip({
58549 axis,
58550 className,
58551 fadeTimeout = 180,
58552 isVisible = true,
58553 labelRef,
58554 onResize = resize_tooltip_noop,
58555 position = POSITIONS.bottom,
58556 showPx = true,
58557 zIndex = 1e3,
58558 ...props
58559}, ref) {
58560 const {
58561 label,
58562 resizeListener
58563 } = useResizeLabel({
58564 axis,
58565 fadeTimeout,
58566 onResize,
58567 showPx,
58568 position
58569 });
58570 if (!isVisible) {
58571 return null;
58572 }
58573 const classes = dist_clsx("components-resize-tooltip", className);
58574 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(resize_tooltip_styles_Root, {
58575 "aria-hidden": "true",
58576 className: classes,
58577 ref,
58578 ...props,
58579 children: [resizeListener, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(label_default, {
58580 "aria-hidden": props["aria-hidden"],
58581 label,
58582 position,
58583 ref: labelRef,
58584 zIndex
58585 })]
58586 });
58587}
58588const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(ResizeTooltip);
58589var resize_tooltip_default = resize_tooltip_ForwardedComponent;
58590
58591
58592;// ./node_modules/@wordpress/components/build-module/resizable-box/index.js
58593
58594
58595
58596
58597
58598const HANDLE_CLASS_NAME = "components-resizable-box__handle";
58599const SIDE_HANDLE_CLASS_NAME = "components-resizable-box__side-handle";
58600const CORNER_HANDLE_CLASS_NAME = "components-resizable-box__corner-handle";
58601const HANDLE_CLASSES = {
58602 top: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-top"),
58603 right: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-right"),
58604 bottom: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom"),
58605 left: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, "components-resizable-box__handle-left"),
58606 topLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-top", "components-resizable-box__handle-left"),
58607 topRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-top", "components-resizable-box__handle-right"),
58608 bottomRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom", "components-resizable-box__handle-right"),
58609 bottomLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, "components-resizable-box__handle-bottom", "components-resizable-box__handle-left")
58610};
58611const HANDLE_STYLES_OVERRIDES = {
58612 width: void 0,
58613 height: void 0,
58614 top: void 0,
58615 right: void 0,
58616 bottom: void 0,
58617 left: void 0
58618};
58619const HANDLE_STYLES = {
58620 top: HANDLE_STYLES_OVERRIDES,
58621 right: HANDLE_STYLES_OVERRIDES,
58622 bottom: HANDLE_STYLES_OVERRIDES,
58623 left: HANDLE_STYLES_OVERRIDES,
58624 topLeft: HANDLE_STYLES_OVERRIDES,
58625 topRight: HANDLE_STYLES_OVERRIDES,
58626 bottomRight: HANDLE_STYLES_OVERRIDES,
58627 bottomLeft: HANDLE_STYLES_OVERRIDES
58628};
58629function UnforwardedResizableBox({
58630 className,
58631 children,
58632 showHandle = true,
58633 __experimentalShowTooltip: showTooltip = false,
58634 __experimentalTooltipProps: tooltipProps = {},
58635 ...props
58636}, ref) {
58637 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Resizable, {
58638 className: dist_clsx("components-resizable-box__container", showHandle && "has-show-handle", className),
58639 handleComponent: Object.fromEntries(Object.keys(HANDLE_CLASSES).map((key) => [key, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
58640 tabIndex: -1
58641 }, key)])),
58642 handleClasses: HANDLE_CLASSES,
58643 handleStyles: HANDLE_STYLES,
58644 ref,
58645 ...props,
58646 children: [children, showTooltip && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_default, {
58647 ...tooltipProps
58648 })]
58649 });
58650}
58651const ResizableBox = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedResizableBox);
58652var resizable_box_default = ResizableBox;
58653
58654
58655;// ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js
58656
58657
58658
58659function ResponsiveWrapper({
58660 naturalWidth,
58661 naturalHeight,
58662 children,
58663 isInline = false
58664}) {
58665 if (external_wp_element_namespaceObject.Children.count(children) !== 1) {
58666 return null;
58667 }
58668 const TagName = isInline ? "span" : "div";
58669 let aspectRatio;
58670 if (naturalWidth && naturalHeight) {
58671 aspectRatio = `${naturalWidth} / ${naturalHeight}`;
58672 }
58673 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
58674 className: "components-responsive-wrapper",
58675 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
58676 children: (0,external_wp_element_namespaceObject.cloneElement)(children, {
58677 className: dist_clsx("components-responsive-wrapper__content", children.props.className),
58678 style: {
58679 ...children.props.style,
58680 aspectRatio
58681 }
58682 })
58683 })
58684 });
58685}
58686var responsive_wrapper_default = ResponsiveWrapper;
58687
58688
58689;// ./node_modules/@wordpress/components/build-module/sandbox/index.js
58690
58691
58692
58693const observeAndResizeJS = function() {
58694 const {
58695 MutationObserver
58696 } = window;
58697 if (!MutationObserver || !document.body || !window.parent) {
58698 return;
58699 }
58700 function sendResize() {
58701 const clientBoundingRect = document.body.getBoundingClientRect();
58702 window.parent.postMessage({
58703 action: "resize",
58704 width: clientBoundingRect.width,
58705 height: clientBoundingRect.height
58706 }, "*");
58707 }
58708 const observer = new MutationObserver(sendResize);
58709 observer.observe(document.body, {
58710 attributes: true,
58711 attributeOldValue: false,
58712 characterData: true,
58713 characterDataOldValue: false,
58714 childList: true,
58715 subtree: true
58716 });
58717 window.addEventListener("load", sendResize, true);
58718 function removeViewportStyles(ruleOrNode) {
58719 if (ruleOrNode.style) {
58720 ["width", "height", "minHeight", "maxHeight"].forEach(function(style2) {
58721 if (/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(ruleOrNode.style[style2])) {
58722 ruleOrNode.style[style2] = "";
58723 }
58724 });
58725 }
58726 }
58727 Array.prototype.forEach.call(document.querySelectorAll("[style]"), removeViewportStyles);
58728 Array.prototype.forEach.call(document.styleSheets, function(stylesheet) {
58729 Array.prototype.forEach.call(stylesheet.cssRules || stylesheet.rules, removeViewportStyles);
58730 });
58731 document.body.style.position = "absolute";
58732 document.body.style.width = "100%";
58733 document.body.setAttribute("data-resizable-iframe-connected", "");
58734 sendResize();
58735 window.addEventListener("resize", sendResize, true);
58736};
58737const sandbox_style = `
58738 body {
58739 margin: 0;
58740 }
58741 html,
58742 body,
58743 body > div {
58744 width: 100%;
58745 }
58746 html.wp-has-aspect-ratio,
58747 body.wp-has-aspect-ratio,
58748 body.wp-has-aspect-ratio > div,
58749 body.wp-has-aspect-ratio > div iframe {
58750 width: 100%;
58751 height: 100%;
58752 overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */
58753 }
58754 body > div > * {
58755 margin-top: 0 !important; /* Has to have !important to override inline styles. */
58756 margin-bottom: 0 !important;
58757 }
58758`;
58759function SandBox({
58760 html = "",
58761 title = "",
58762 type,
58763 styles = [],
58764 scripts = [],
58765 onFocus,
58766 tabIndex
58767}) {
58768 const ref = (0,external_wp_element_namespaceObject.useRef)();
58769 const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(0);
58770 const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(0);
58771 function isFrameAccessible() {
58772 try {
58773 return !!ref.current?.contentDocument?.body;
58774 } catch (e) {
58775 return false;
58776 }
58777 }
58778 function trySandBox(forceRerender = false) {
58779 if (!isFrameAccessible()) {
58780 return;
58781 }
58782 const {
58783 contentDocument,
58784 ownerDocument
58785 } = ref.current;
58786 if (!forceRerender && null !== contentDocument?.body.getAttribute("data-resizable-iframe-connected")) {
58787 return;
58788 }
58789 const htmlDoc = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("html", {
58790 lang: ownerDocument.documentElement.lang,
58791 className: type,
58792 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("head", {
58793 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("title", {
58794 children: title
58795 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
58796 dangerouslySetInnerHTML: {
58797 __html: sandbox_style
58798 }
58799 }), styles.map((rules, i) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("style", {
58800 dangerouslySetInnerHTML: {
58801 __html: rules
58802 }
58803 }, i))]
58804 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("body", {
58805 "data-resizable-iframe-connected": "data-resizable-iframe-connected",
58806 className: type,
58807 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
58808 dangerouslySetInnerHTML: {
58809 __html: html
58810 }
58811 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("script", {
58812 type: "text/javascript",
58813 dangerouslySetInnerHTML: {
58814 __html: `(${observeAndResizeJS.toString()})();`
58815 }
58816 }), scripts.map((src) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("script", {
58817 src
58818 }, src))]
58819 })]
58820 });
58821 contentDocument.open();
58822 contentDocument.write("<!DOCTYPE html>" + (0,external_wp_element_namespaceObject.renderToString)(htmlDoc));
58823 contentDocument.close();
58824 }
58825 (0,external_wp_element_namespaceObject.useEffect)(() => {
58826 trySandBox();
58827 function tryNoForceSandBox() {
58828 trySandBox(false);
58829 }
58830 function checkMessageForResize(event) {
58831 const iframe2 = ref.current;
58832 if (!iframe2 || iframe2.contentWindow !== event.source) {
58833 return;
58834 }
58835 let data = event.data || {};
58836 if ("string" === typeof data) {
58837 try {
58838 data = JSON.parse(data);
58839 } catch (e) {
58840 }
58841 }
58842 if ("resize" !== data.action) {
58843 return;
58844 }
58845 setWidth(data.width);
58846 setHeight(data.height);
58847 }
58848 const iframe = ref.current;
58849 const defaultView = iframe?.ownerDocument?.defaultView;
58850 iframe?.addEventListener("load", tryNoForceSandBox, false);
58851 defaultView?.addEventListener("message", checkMessageForResize);
58852 return () => {
58853 iframe?.removeEventListener("load", tryNoForceSandBox, false);
58854 defaultView?.removeEventListener("message", checkMessageForResize);
58855 };
58856 }, []);
58857 (0,external_wp_element_namespaceObject.useEffect)(() => {
58858 trySandBox();
58859 }, [title, styles, scripts]);
58860 (0,external_wp_element_namespaceObject.useEffect)(() => {
58861 trySandBox(true);
58862 }, [html, type]);
58863 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
58864 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
58865 title,
58866 tabIndex,
58867 className: "components-sandbox",
58868 sandbox: "allow-scripts allow-same-origin allow-presentation",
58869 onFocus,
58870 width: Math.ceil(width),
58871 height: Math.ceil(height)
58872 });
58873}
58874var sandbox_default = SandBox;
58875
58876
58877;// ./node_modules/@wordpress/components/build-module/snackbar/index.js
58878
58879
58880
58881
58882
58883
58884
58885
58886const NOTICE_TIMEOUT = 1e4;
58887function snackbar_useSpokenMessage(message, politeness) {
58888 const spokenMessage = typeof message === "string" ? message : (0,external_wp_element_namespaceObject.renderToString)(message);
58889 (0,external_wp_element_namespaceObject.useEffect)(() => {
58890 if (spokenMessage) {
58891 (0,external_wp_a11y_namespaceObject.speak)(spokenMessage, politeness);
58892 }
58893 }, [spokenMessage, politeness]);
58894}
58895function UnforwardedSnackbar({
58896 className,
58897 children,
58898 spokenMessage = children,
58899 politeness = "polite",
58900 actions = [],
58901 onRemove,
58902 icon = null,
58903 explicitDismiss = false,
58904 // onDismiss is a callback executed when the snackbar is dismissed.
58905 // It is distinct from onRemove, which _looks_ like a callback but is
58906 // actually the function to call to remove the snackbar from the UI.
58907 onDismiss,
58908 listRef
58909}, ref) {
58910 function dismissMe(event) {
58911 if (event && event.preventDefault) {
58912 event.preventDefault();
58913 }
58914 listRef?.current?.focus();
58915 onDismiss?.();
58916 onRemove?.();
58917 }
58918 function onActionClick(event, onClick) {
58919 event.stopPropagation();
58920 onRemove?.();
58921 if (onClick) {
58922 onClick(event);
58923 }
58924 }
58925 snackbar_useSpokenMessage(spokenMessage, politeness);
58926 const callbacksRef = (0,external_wp_element_namespaceObject.useRef)({
58927 onDismiss,
58928 onRemove
58929 });
58930 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
58931 callbacksRef.current = {
58932 onDismiss,
58933 onRemove
58934 };
58935 });
58936 (0,external_wp_element_namespaceObject.useEffect)(() => {
58937 const timeoutHandle = setTimeout(() => {
58938 if (!explicitDismiss) {
58939 callbacksRef.current.onDismiss?.();
58940 callbacksRef.current.onRemove?.();
58941 }
58942 }, NOTICE_TIMEOUT);
58943 return () => clearTimeout(timeoutHandle);
58944 }, [explicitDismiss]);
58945 const classes = dist_clsx(className, "components-snackbar", {
58946 "components-snackbar-explicit-dismiss": !!explicitDismiss
58947 });
58948 if (actions && actions.length > 1) {
58949 true ? external_wp_warning_default()("Snackbar can only have one action. Use Notice if your message requires many actions.") : 0;
58950 actions = [actions[0]];
58951 }
58952 const snackbarContentClassnames = dist_clsx("components-snackbar__content", {
58953 "components-snackbar__content-with-icon": !!icon
58954 });
58955 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
58956 ref,
58957 className: classes,
58958 onClick: !explicitDismiss ? dismissMe : void 0,
58959 tabIndex: 0,
58960 role: !explicitDismiss ? "button" : void 0,
58961 onKeyPress: !explicitDismiss ? dismissMe : void 0,
58962 "aria-label": !explicitDismiss ? (0,external_wp_i18n_namespaceObject.__)("Dismiss this notice") : void 0,
58963 "data-testid": "snackbar",
58964 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
58965 className: snackbarContentClassnames,
58966 children: [icon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
58967 className: "components-snackbar__icon",
58968 children: icon
58969 }), children, actions.map(({
58970 label,
58971 onClick,
58972 url,
58973 openInNewTab = false
58974 }, index) => url !== void 0 && openInNewTab ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_link_default, {
58975 href: url,
58976 onClick: (event) => onActionClick(event, onClick),
58977 className: "components-snackbar__action",
58978 children: label
58979 }, index) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
58980 __next40pxDefaultSize: true,
58981 href: url,
58982 variant: "link",
58983 onClick: (event) => onActionClick(event, onClick),
58984 className: "components-snackbar__action",
58985 children: label
58986 }, index)), explicitDismiss && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
58987 role: "button",
58988 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Dismiss this notice"),
58989 tabIndex: 0,
58990 className: "components-snackbar__dismiss-button",
58991 onClick: dismissMe,
58992 onKeyPress: dismissMe,
58993 children: "\u2715"
58994 })]
58995 })
58996 });
58997}
58998const Snackbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSnackbar);
58999var snackbar_default = Snackbar;
59000
59001
59002;// ./node_modules/@wordpress/components/build-module/snackbar/list.js
59003
59004
59005
59006
59007
59008
59009const SNACKBAR_VARIANTS = {
59010 init: {
59011 height: 0,
59012 opacity: 0
59013 },
59014 open: {
59015 height: "auto",
59016 opacity: 1,
59017 transition: {
59018 height: {
59019 type: "tween",
59020 duration: 0.3,
59021 ease: [0, 0, 0.2, 1]
59022 },
59023 opacity: {
59024 type: "tween",
59025 duration: 0.25,
59026 delay: 0.05,
59027 ease: [0, 0, 0.2, 1]
59028 }
59029 }
59030 },
59031 exit: {
59032 opacity: 0,
59033 transition: {
59034 type: "tween",
59035 duration: 0.1,
59036 ease: [0, 0, 0.2, 1]
59037 }
59038 }
59039};
59040function SnackbarList({
59041 notices,
59042 className,
59043 children,
59044 onRemove
59045}) {
59046 const listRef = (0,external_wp_element_namespaceObject.useRef)(null);
59047 const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
59048 className = dist_clsx("components-snackbar-list", className);
59049 const removeNotice = (notice) => () => onRemove?.(notice.id);
59050 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
59051 className,
59052 tabIndex: -1,
59053 ref: listRef,
59054 "data-testid": "snackbar-list",
59055 children: [children, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(AnimatePresence, {
59056 children: notices.map((notice) => {
59057 const {
59058 content,
59059 ...restNotice
59060 } = notice;
59061 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(motion.div, {
59062 layout: !isReducedMotion,
59063 initial: "init",
59064 animate: "open",
59065 exit: "exit",
59066 variants: isReducedMotion ? void 0 : SNACKBAR_VARIANTS,
59067 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
59068 className: "components-snackbar-list__notice-container",
59069 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(snackbar_default, {
59070 ...restNotice,
59071 onRemove: removeNotice(notice),
59072 listRef,
59073 children: notice.content
59074 })
59075 })
59076 }, notice.id);
59077 })
59078 })]
59079 });
59080}
59081var list_list_default = SnackbarList;
59082
59083
59084;// ./node_modules/@wordpress/components/build-module/surface/component.js
59085
59086
59087
59088
59089function UnconnectedSurface(props, forwardedRef) {
59090 const surfaceProps = useSurface(props);
59091 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
59092 ...surfaceProps,
59093 ref: forwardedRef
59094 });
59095}
59096const component_Surface = contextConnect(UnconnectedSurface, "Surface");
59097var surface_component_component_default = component_Surface;
59098
59099
59100;// ./node_modules/@ariakit/core/esm/tab/tab-store.js
59101"use client";
59102
59103
59104
59105
59106
59107
59108
59109
59110// src/tab/tab-store.ts
59111function createTabStore(_a = {}) {
59112 var _b = _a, {
59113 composite: parentComposite,
59114 combobox
59115 } = _b, props = _3YLGPPWQ_objRest(_b, [
59116 "composite",
59117 "combobox"
59118 ]);
59119 const independentKeys = [
59120 "items",
59121 "renderedItems",
59122 "moves",
59123 "orientation",
59124 "virtualFocus",
59125 "includesBaseElement",
59126 "baseElement",
59127 "focusLoop",
59128 "focusShift",
59129 "focusWrap"
59130 ];
59131 const store = mergeStore(
59132 props.store,
59133 omit2(parentComposite, independentKeys),
59134 omit2(combobox, independentKeys)
59135 );
59136 const syncState = store == null ? void 0 : store.getState();
59137 const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
59138 store,
59139 // We need to explicitly set the default value of `includesBaseElement` to
59140 // `false` since we don't want the composite store to default it to `true`
59141 // when the activeId state is null, which could be the case when rendering
59142 // combobox with tab.
59143 includesBaseElement: defaultValue(
59144 props.includesBaseElement,
59145 syncState == null ? void 0 : syncState.includesBaseElement,
59146 false
59147 ),
59148 orientation: defaultValue(
59149 props.orientation,
59150 syncState == null ? void 0 : syncState.orientation,
59151 "horizontal"
59152 ),
59153 focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
59154 }));
59155 const panels = createCollectionStore();
59156 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), {
59157 selectedId: defaultValue(
59158 props.selectedId,
59159 syncState == null ? void 0 : syncState.selectedId,
59160 props.defaultSelectedId
59161 ),
59162 selectOnMove: defaultValue(
59163 props.selectOnMove,
59164 syncState == null ? void 0 : syncState.selectOnMove,
59165 true
59166 )
59167 });
59168 const tab = createStore(initialState, composite, store);
59169 setup(
59170 tab,
59171 () => sync(tab, ["moves"], () => {
59172 const { activeId, selectOnMove } = tab.getState();
59173 if (!selectOnMove) return;
59174 if (!activeId) return;
59175 const tabItem = composite.item(activeId);
59176 if (!tabItem) return;
59177 if (tabItem.dimmed) return;
59178 if (tabItem.disabled) return;
59179 tab.setState("selectedId", tabItem.id);
59180 })
59181 );
59182 let syncActiveId = true;
59183 setup(
59184 tab,
59185 () => batch(tab, ["selectedId"], (state, prev) => {
59186 if (!syncActiveId) {
59187 syncActiveId = true;
59188 return;
59189 }
59190 if (parentComposite && state.selectedId === prev.selectedId) return;
59191 tab.setState("activeId", state.selectedId);
59192 })
59193 );
59194 setup(
59195 tab,
59196 () => sync(tab, ["selectedId", "renderedItems"], (state) => {
59197 if (state.selectedId !== void 0) return;
59198 const { activeId, renderedItems } = tab.getState();
59199 const tabItem = composite.item(activeId);
59200 if (tabItem && !tabItem.disabled && !tabItem.dimmed) {
59201 tab.setState("selectedId", tabItem.id);
59202 } else {
59203 const tabItem2 = renderedItems.find(
59204 (item) => !item.disabled && !item.dimmed
59205 );
59206 tab.setState("selectedId", tabItem2 == null ? void 0 : tabItem2.id);
59207 }
59208 })
59209 );
59210 setup(
59211 tab,
59212 () => sync(tab, ["renderedItems"], (state) => {
59213 const tabs = state.renderedItems;
59214 if (!tabs.length) return;
59215 return sync(panels, ["renderedItems"], (state2) => {
59216 const items = state2.renderedItems;
59217 const hasOrphanPanels = items.some((panel) => !panel.tabId);
59218 if (!hasOrphanPanels) return;
59219 items.forEach((panel, i) => {
59220 if (panel.tabId) return;
59221 const tabItem = tabs[i];
59222 if (!tabItem) return;
59223 panels.renderItem(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, panel), { tabId: tabItem.id }));
59224 });
59225 });
59226 })
59227 );
59228 let selectedIdFromSelectedValue = null;
59229 setup(tab, () => {
59230 const backupSelectedId = () => {
59231 selectedIdFromSelectedValue = tab.getState().selectedId;
59232 };
59233 const restoreSelectedId = () => {
59234 syncActiveId = false;
59235 tab.setState("selectedId", selectedIdFromSelectedValue);
59236 };
59237 if (parentComposite && "setSelectElement" in parentComposite) {
59238 return chain(
59239 sync(parentComposite, ["value"], backupSelectedId),
59240 sync(parentComposite, ["mounted"], restoreSelectedId)
59241 );
59242 }
59243 if (!combobox) return;
59244 return chain(
59245 sync(combobox, ["selectedValue"], backupSelectedId),
59246 sync(combobox, ["mounted"], restoreSelectedId)
59247 );
59248 });
59249 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), tab), {
59250 panels,
59251 setSelectedId: (id) => tab.setState("selectedId", id),
59252 select: (id) => {
59253 tab.setState("selectedId", id);
59254 composite.move(id);
59255 }
59256 });
59257}
59258
59259
59260;// ./node_modules/@ariakit/react-core/esm/__chunks/PY4NZ6HS.js
59261"use client";
59262
59263
59264
59265
59266
59267
59268
59269// src/tab/tab-store.ts
59270
59271
59272function useTabStoreProps(store, update, props) {
59273 useUpdateEffect(update, [props.composite, props.combobox]);
59274 store = useCompositeStoreProps(store, update, props);
59275 useStoreProps(store, props, "selectedId", "setSelectedId");
59276 useStoreProps(store, props, "selectOnMove");
59277 const [panels, updatePanels] = YV4JVR4I_useStore(() => store.panels, {});
59278 useUpdateEffect(updatePanels, [store, updatePanels]);
59279 return Object.assign(
59280 (0,external_React_.useMemo)(() => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { panels }), [store, panels]),
59281 { composite: props.composite, combobox: props.combobox }
59282 );
59283}
59284function useTabStore(props = {}) {
59285 const combobox = useComboboxContext();
59286 const composite = useSelectContext() || combobox;
59287 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
59288 composite: props.composite !== void 0 ? props.composite : composite,
59289 combobox: props.combobox !== void 0 ? props.combobox : combobox
59290 });
59291 const [store, update] = YV4JVR4I_useStore(createTabStore, props);
59292 return useTabStoreProps(store, update, props);
59293}
59294
59295
59296
59297;// ./node_modules/@ariakit/react-core/esm/__chunks/UYGDZTLQ.js
59298"use client";
59299
59300
59301
59302// src/tab/tab-context.tsx
59303var UYGDZTLQ_ctx = createStoreContext(
59304 [CompositeContextProvider],
59305 [CompositeScopedContextProvider]
59306);
59307var useTabContext = UYGDZTLQ_ctx.useContext;
59308var useTabScopedContext = UYGDZTLQ_ctx.useScopedContext;
59309var useTabProviderContext = UYGDZTLQ_ctx.useProviderContext;
59310var TabContextProvider = UYGDZTLQ_ctx.ContextProvider;
59311var TabScopedContextProvider = UYGDZTLQ_ctx.ScopedContextProvider;
59312
59313
59314
59315;// ./node_modules/@ariakit/react-core/esm/tab/tab-list.js
59316"use client";
59317
59318
59319
59320
59321
59322
59323
59324
59325
59326
59327
59328
59329// src/tab/tab-list.tsx
59330
59331
59332var tab_list_TagName = "div";
59333var useTabList = createHook(
59334 function useTabList2(_a) {
59335 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
59336 const context = useTabProviderContext();
59337 store = store || context;
59338 invariant(
59339 store,
59340 false && 0
59341 );
59342 const orientation = store.useState(
59343 (state) => state.orientation === "both" ? void 0 : state.orientation
59344 );
59345 props = useWrapElement(
59346 props,
59347 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabScopedContextProvider, { value: store, children: element }),
59348 [store]
59349 );
59350 if (store.composite) {
59351 props = _3YLGPPWQ_spreadValues({
59352 focusable: false
59353 }, props);
59354 }
59355 props = _3YLGPPWQ_spreadValues({
59356 role: "tablist",
59357 "aria-orientation": orientation
59358 }, props);
59359 props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
59360 return props;
59361 }
59362);
59363var TabList = forwardRef2(function TabList2(props) {
59364 const htmlProps = useTabList(props);
59365 return LMDWO4NN_createElement(tab_list_TagName, htmlProps);
59366});
59367
59368
59369;// ./node_modules/@ariakit/react-core/esm/tab/tab.js
59370"use client";
59371
59372
59373
59374
59375
59376
59377
59378
59379
59380
59381
59382
59383
59384
59385
59386// src/tab/tab.tsx
59387
59388
59389
59390var tab_TagName = "button";
59391var useTab = createHook(function useTab2(_a) {
59392 var _b = _a, {
59393 store,
59394 getItem: getItemProp
59395 } = _b, props = __objRest(_b, [
59396 "store",
59397 "getItem"
59398 ]);
59399 var _a2;
59400 const context = useTabScopedContext();
59401 store = store || context;
59402 invariant(
59403 store,
59404 false && 0
59405 );
59406 const defaultId = useId();
59407 const id = props.id || defaultId;
59408 const dimmed = disabledFromProps(props);
59409 const getItem = (0,external_React_.useCallback)(
59410 (item) => {
59411 const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { dimmed });
59412 if (getItemProp) {
59413 return getItemProp(nextItem);
59414 }
59415 return nextItem;
59416 },
59417 [dimmed, getItemProp]
59418 );
59419 const onClickProp = props.onClick;
59420 const onClick = useEvent((event) => {
59421 onClickProp == null ? void 0 : onClickProp(event);
59422 if (event.defaultPrevented) return;
59423 store == null ? void 0 : store.setSelectedId(id);
59424 });
59425 const panelId = store.panels.useState(
59426 (state) => {
59427 var _a3;
59428 return (_a3 = state.items.find((item) => item.tabId === id)) == null ? void 0 : _a3.id;
59429 }
59430 );
59431 const shouldRegisterItem = defaultId ? props.shouldRegisterItem : false;
59432 const isActive = store.useState((state) => !!id && state.activeId === id);
59433 const selected = store.useState((state) => !!id && state.selectedId === id);
59434 const hasActiveItem = store.useState((state) => !!store.item(state.activeId));
59435 const canRegisterComposedItem = isActive || selected && !hasActiveItem;
59436 const accessibleWhenDisabled = selected || ((_a2 = props.accessibleWhenDisabled) != null ? _a2 : true);
59437 const isWithinVirtualFocusComposite = useStoreState(
59438 store.combobox || store.composite,
59439 "virtualFocus"
59440 );
59441 if (isWithinVirtualFocusComposite) {
59442 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
59443 tabIndex: -1
59444 });
59445 }
59446 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
59447 id,
59448 role: "tab",
59449 "aria-selected": selected,
59450 "aria-controls": panelId || void 0
59451 }, props), {
59452 onClick
59453 });
59454 if (store.composite) {
59455 const defaultProps = {
59456 id,
59457 accessibleWhenDisabled,
59458 store: store.composite,
59459 shouldRegisterItem: canRegisterComposedItem && shouldRegisterItem,
59460 rowId: props.rowId,
59461 render: props.render
59462 };
59463 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
59464 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
59465 CompositeItem,
59466 _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), {
59467 render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItem, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, defaultProps), { store: store.combobox })) : defaultProps.render
59468 })
59469 )
59470 });
59471 }
59472 props = useCompositeItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
59473 store
59474 }, props), {
59475 accessibleWhenDisabled,
59476 getItem,
59477 shouldRegisterItem
59478 }));
59479 return props;
59480});
59481var Tab = memo2(
59482 forwardRef2(function Tab2(props) {
59483 const htmlProps = useTab(props);
59484 return LMDWO4NN_createElement(tab_TagName, htmlProps);
59485 })
59486);
59487
59488
59489;// ./node_modules/@ariakit/react-core/esm/tab/tab-panel.js
59490"use client";
59491
59492
59493
59494
59495
59496
59497
59498
59499
59500
59501
59502
59503
59504
59505
59506
59507// src/tab/tab-panel.tsx
59508
59509
59510
59511
59512var tab_panel_TagName = "div";
59513var useTabPanel = createHook(
59514 function useTabPanel2(_a) {
59515 var _b = _a, {
59516 store,
59517 unmountOnHide,
59518 tabId: tabIdProp,
59519 getItem: getItemProp,
59520 scrollRestoration,
59521 scrollElement
59522 } = _b, props = __objRest(_b, [
59523 "store",
59524 "unmountOnHide",
59525 "tabId",
59526 "getItem",
59527 "scrollRestoration",
59528 "scrollElement"
59529 ]);
59530 const context = useTabProviderContext();
59531 store = store || context;
59532 invariant(
59533 store,
59534 false && 0
59535 );
59536 const ref = (0,external_React_.useRef)(null);
59537 const id = useId(props.id);
59538 const tabId = useStoreState(
59539 store.panels,
59540 () => {
59541 var _a2;
59542 return tabIdProp || ((_a2 = store == null ? void 0 : store.panels.item(id)) == null ? void 0 : _a2.tabId);
59543 }
59544 );
59545 const open = useStoreState(
59546 store,
59547 (state) => !!tabId && state.selectedId === tabId
59548 );
59549 const disclosure = useDisclosureStore({ open });
59550 const mounted = useStoreState(disclosure, "mounted");
59551 const scrollPositionRef = (0,external_React_.useRef)(
59552 /* @__PURE__ */ new Map()
59553 );
59554 const getScrollElement = useEvent(() => {
59555 const panelElement = ref.current;
59556 if (!panelElement) return null;
59557 if (!scrollElement) return panelElement;
59558 if (typeof scrollElement === "function") {
59559 return scrollElement(panelElement);
59560 }
59561 if ("current" in scrollElement) {
59562 return scrollElement.current;
59563 }
59564 return scrollElement;
59565 });
59566 (0,external_React_.useEffect)(() => {
59567 var _a2, _b2;
59568 if (!scrollRestoration) return;
59569 if (!mounted) return;
59570 const element = getScrollElement();
59571 if (!element) return;
59572 if (scrollRestoration === "reset") {
59573 element.scroll(0, 0);
59574 return;
59575 }
59576 if (!tabId) return;
59577 const position = scrollPositionRef.current.get(tabId);
59578 element.scroll((_a2 = position == null ? void 0 : position.x) != null ? _a2 : 0, (_b2 = position == null ? void 0 : position.y) != null ? _b2 : 0);
59579 const onScroll = () => {
59580 scrollPositionRef.current.set(tabId, {
59581 x: element.scrollLeft,
59582 y: element.scrollTop
59583 });
59584 };
59585 element.addEventListener("scroll", onScroll);
59586 return () => {
59587 element.removeEventListener("scroll", onScroll);
59588 };
59589 }, [scrollRestoration, mounted, tabId, getScrollElement, store]);
59590 const [hasTabbableChildren, setHasTabbableChildren] = (0,external_React_.useState)(false);
59591 (0,external_React_.useEffect)(() => {
59592 const element = ref.current;
59593 if (!element) return;
59594 const tabbable = getAllTabbableIn(element);
59595 setHasTabbableChildren(!!tabbable.length);
59596 }, []);
59597 const getItem = (0,external_React_.useCallback)(
59598 (item) => {
59599 const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { id: id || item.id, tabId: tabIdProp });
59600 if (getItemProp) {
59601 return getItemProp(nextItem);
59602 }
59603 return nextItem;
59604 },
59605 [id, tabIdProp, getItemProp]
59606 );
59607 const onKeyDownProp = props.onKeyDown;
59608 const onKeyDown = useEvent((event) => {
59609 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
59610 if (event.defaultPrevented) return;
59611 if (!(store == null ? void 0 : store.composite)) return;
59612 const keyMap = {
59613 ArrowLeft: store.previous,
59614 ArrowRight: store.next,
59615 Home: store.first,
59616 End: store.last
59617 };
59618 const action = keyMap[event.key];
59619 if (!action) return;
59620 const { selectedId } = store.getState();
59621 const nextId = action({ activeId: selectedId });
59622 if (!nextId) return;
59623 event.preventDefault();
59624 store.move(nextId);
59625 });
59626 props = useWrapElement(
59627 props,
59628 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabScopedContextProvider, { value: store, children: element }),
59629 [store]
59630 );
59631 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
59632 id,
59633 role: "tabpanel",
59634 "aria-labelledby": tabId || void 0
59635 }, props), {
59636 children: unmountOnHide && !mounted ? null : props.children,
59637 ref: useMergeRefs(ref, props.ref),
59638 onKeyDown
59639 });
59640 props = useFocusable(_3YLGPPWQ_spreadValues({
59641 // If the tab panel is rendered as part of another composite widget such
59642 // as combobox, it should not be focusable.
59643 focusable: !store.composite && !hasTabbableChildren
59644 }, props));
59645 props = useDisclosureContent(_3YLGPPWQ_spreadValues({ store: disclosure }, props));
59646 props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store: store.panels }, props), { getItem }));
59647 return props;
59648 }
59649);
59650var TabPanel = forwardRef2(function TabPanel2(props) {
59651 const htmlProps = useTabPanel(props);
59652 return LMDWO4NN_createElement(tab_panel_TagName, htmlProps);
59653});
59654
59655
59656;// ./node_modules/@wordpress/components/build-module/tab-panel/index.js
59657
59658
59659
59660
59661
59662
59663
59664const extractTabName = (id) => {
59665 if (typeof id === "undefined" || id === null) {
59666 return;
59667 }
59668 return id.match(/^tab-panel-[0-9]*-(.*)/)?.[1];
59669};
59670const UnforwardedTabPanel = ({
59671 className,
59672 children,
59673 tabs,
59674 selectOnMove = true,
59675 initialTabName,
59676 orientation = "horizontal",
59677 activeClass = "is-active",
59678 onSelect
59679}, ref) => {
59680 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(tab_panel_TabPanel, "tab-panel");
59681 const prependInstanceId = (0,external_wp_element_namespaceObject.useCallback)((tabName) => {
59682 if (typeof tabName === "undefined") {
59683 return;
59684 }
59685 return `${instanceId}-${tabName}`;
59686 }, [instanceId]);
59687 const tabStore = useTabStore({
59688 setSelectedId: (newTabValue) => {
59689 if (typeof newTabValue === "undefined" || newTabValue === null) {
59690 return;
59691 }
59692 const newTab = tabs.find((t) => prependInstanceId(t.name) === newTabValue);
59693 if (newTab?.disabled || newTab === selectedTab) {
59694 return;
59695 }
59696 const simplifiedTabName = extractTabName(newTabValue);
59697 if (typeof simplifiedTabName === "undefined") {
59698 return;
59699 }
59700 onSelect?.(simplifiedTabName);
59701 },
59702 orientation,
59703 selectOnMove,
59704 defaultSelectedId: prependInstanceId(initialTabName),
59705 rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
59706 });
59707 const selectedTabName = extractTabName(useStoreState(tabStore, "selectedId"));
59708 const setTabStoreSelectedId = (0,external_wp_element_namespaceObject.useCallback)((tabName) => {
59709 tabStore.setState("selectedId", prependInstanceId(tabName));
59710 }, [prependInstanceId, tabStore]);
59711 const selectedTab = tabs.find(({
59712 name
59713 }) => name === selectedTabName);
59714 const previousSelectedTabName = (0,external_wp_compose_namespaceObject.usePrevious)(selectedTabName);
59715 (0,external_wp_element_namespaceObject.useEffect)(() => {
59716 if (previousSelectedTabName !== selectedTabName && selectedTabName === initialTabName && !!selectedTabName) {
59717 onSelect?.(selectedTabName);
59718 }
59719 }, [selectedTabName, initialTabName, onSelect, previousSelectedTabName]);
59720 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
59721 if (selectedTab) {
59722 return;
59723 }
59724 const initialTab = tabs.find((tab) => tab.name === initialTabName);
59725 if (initialTabName && !initialTab) {
59726 return;
59727 }
59728 if (initialTab && !initialTab.disabled) {
59729 setTabStoreSelectedId(initialTab.name);
59730 } else {
59731 const firstEnabledTab = tabs.find((tab) => !tab.disabled);
59732 if (firstEnabledTab) {
59733 setTabStoreSelectedId(firstEnabledTab.name);
59734 }
59735 }
59736 }, [tabs, selectedTab, initialTabName, instanceId, setTabStoreSelectedId]);
59737 (0,external_wp_element_namespaceObject.useEffect)(() => {
59738 if (!selectedTab?.disabled) {
59739 return;
59740 }
59741 const firstEnabledTab = tabs.find((tab) => !tab.disabled);
59742 if (firstEnabledTab) {
59743 setTabStoreSelectedId(firstEnabledTab.name);
59744 }
59745 }, [tabs, selectedTab?.disabled, setTabStoreSelectedId, instanceId]);
59746 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
59747 className,
59748 ref,
59749 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabList, {
59750 store: tabStore,
59751 className: "components-tab-panel__tabs",
59752 children: tabs.map((tab) => {
59753 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tab, {
59754 id: prependInstanceId(tab.name),
59755 className: dist_clsx("components-tab-panel__tabs-item", tab.className, {
59756 [activeClass]: tab.name === selectedTabName
59757 }),
59758 disabled: tab.disabled,
59759 "aria-controls": `${prependInstanceId(tab.name)}-view`,
59760 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
59761 __next40pxDefaultSize: true,
59762 icon: tab.icon,
59763 label: tab.icon && tab.title,
59764 showTooltip: !!tab.icon
59765 }),
59766 children: !tab.icon && tab.title
59767 }, tab.name);
59768 })
59769 }), selectedTab && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabPanel, {
59770 id: `${prependInstanceId(selectedTab.name)}-view`,
59771 store: tabStore,
59772 tabId: prependInstanceId(selectedTab.name),
59773 className: "components-tab-panel__tab-content",
59774 children: children(selectedTab)
59775 })]
59776 });
59777};
59778const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabPanel);
59779var tab_panel_default = tab_panel_TabPanel;
59780
59781
59782;// ./node_modules/@wordpress/components/build-module/text-control/index.js
59783
59784
59785
59786
59787
59788
59789function UnforwardedTextControl(props, ref) {
59790 const {
59791 __nextHasNoMarginBottom,
59792 __next40pxDefaultSize = false,
59793 label,
59794 hideLabelFromVision,
59795 value,
59796 help,
59797 id: idProp,
59798 className,
59799 onChange,
59800 type = "text",
59801 ...additionalProps
59802 } = props;
59803 const id = (0,external_wp_compose_namespaceObject.useInstanceId)(TextControl, "inspector-text-control", idProp);
59804 const onChangeValue = (event) => onChange(event.target.value);
59805 maybeWarnDeprecated36pxSize({
59806 componentName: "TextControl",
59807 size: void 0,
59808 __next40pxDefaultSize
59809 });
59810 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
59811 __nextHasNoMarginBottom,
59812 __associatedWPComponentName: "TextControl",
59813 label,
59814 hideLabelFromVision,
59815 id,
59816 help,
59817 className,
59818 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
59819 className: dist_clsx("components-text-control__input", {
59820 "is-next-40px-default-size": __next40pxDefaultSize
59821 }),
59822 type,
59823 id,
59824 value,
59825 onChange: onChangeValue,
59826 "aria-describedby": !!help ? id + "__help" : void 0,
59827 ref,
59828 ...additionalProps
59829 })
59830 });
59831}
59832const TextControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextControl);
59833var text_control_default = TextControl;
59834
59835
59836;// ./node_modules/@wordpress/components/build-module/utils/breakpoint-values.js
59837var breakpoint_values_default = {
59838 huge: "1440px",
59839 wide: "1280px",
59840 "x-large": "1080px",
59841 large: "960px",
59842 // admin sidebar auto folds
59843 medium: "782px",
59844 // Adminbar goes big.
59845 small: "600px",
59846 mobile: "480px",
59847 "zoomed-in": "280px"
59848};
59849
59850
59851;// ./node_modules/@wordpress/components/build-module/utils/breakpoint.js
59852
59853const breakpoint = (point) => `@media (min-width: ${breakpoint_values_default[point]})`;
59854
59855
59856;// ./node_modules/@wordpress/components/build-module/textarea-control/styles/textarea-control-styles.js
59857
59858
59859
59860
59861
59862
59863const inputStyleNeutral = /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:0 0 0 transparent;border-radius:", config_values_default.radiusSmall, ";border:", config_values_default.borderWidth, " solid ", COLORS.ui.border, ";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}" + ( true ? "" : 0), true ? "" : 0);
59864const inputStyleFocus = /* @__PURE__ */ emotion_react_browser_esm_css("border-color:", COLORS.theme.accent, ";box-shadow:0 0 0 calc( ", config_values_default.borderWidthFocus, " - ", config_values_default.borderWidth, " ) ", COLORS.theme.accent, ";outline:2px solid transparent;" + ( true ? "" : 0), true ? "" : 0);
59865const StyledTextarea = /* @__PURE__ */ emotion_styled_base_browser_esm("textarea", true ? {
59866 target: "e1w5nnrk0"
59867} : 0)("width:100%;display:block;font-family:", font("default.fontFamily"), ";line-height:20px;background:", COLORS.theme.background, ";color:", COLORS.theme.foreground, ";resize:vertical;padding:9px 11px;", inputStyleNeutral, ";font-size:", font("mobileTextMinFontSize"), ";", breakpoint("small"), "{font-size:", font("default.fontSize"), ";}&:focus{", inputStyleFocus, ";}&::-webkit-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.darkGrayPlaceholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}&::-moz-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}&:-ms-input-placeholder{color:", COLORS.ui.lightGrayPlaceholder, ";}}" + ( true ? "" : 0));
59868
59869
59870;// ./node_modules/@wordpress/components/build-module/textarea-control/index.js
59871
59872
59873
59874
59875
59876
59877function UnforwardedTextareaControl(props, ref) {
59878 const {
59879 __nextHasNoMarginBottom,
59880 label,
59881 hideLabelFromVision,
59882 value,
59883 help,
59884 onChange,
59885 rows = 4,
59886 className,
59887 ...additionalProps
59888 } = props;
59889 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TextareaControl);
59890 const id = `inspector-textarea-control-${instanceId}`;
59891 const onChangeValue = (event) => onChange(event.target.value);
59892 const classes = dist_clsx("components-textarea-control", className);
59893 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
59894 __nextHasNoMarginBottom,
59895 __associatedWPComponentName: "TextareaControl",
59896 label,
59897 hideLabelFromVision,
59898 id,
59899 help,
59900 className: classes,
59901 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledTextarea, {
59902 className: "components-textarea-control__input",
59903 id,
59904 rows,
59905 onChange: onChangeValue,
59906 "aria-describedby": !!help ? id + "__help" : void 0,
59907 value,
59908 ref,
59909 ...additionalProps
59910 })
59911 });
59912}
59913const TextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextareaControl);
59914var textarea_control_default = TextareaControl;
59915
59916
59917;// ./node_modules/@wordpress/components/build-module/text-highlight/index.js
59918
59919
59920
59921const TextHighlight = (props) => {
59922 const {
59923 text = "",
59924 highlight = ""
59925 } = props;
59926 const trimmedHighlightText = highlight.trim();
59927 if (!trimmedHighlightText) {
59928 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
59929 children: text
59930 });
59931 }
59932 const regex = new RegExp(`(${escapeRegExp(trimmedHighlightText)})`, "gi");
59933 return (0,external_wp_element_namespaceObject.createInterpolateElement)(text.replace(regex, "<mark>$&</mark>"), {
59934 mark: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {})
59935 });
59936};
59937var text_highlight_default = TextHighlight;
59938
59939
59940;// ./node_modules/@wordpress/icons/build-module/library/tip.js
59941
59942
59943var tip_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z" }) });
59944
59945
59946;// ./node_modules/@wordpress/components/build-module/tip/index.js
59947
59948
59949function Tip(props) {
59950 const {
59951 children
59952 } = props;
59953 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
59954 className: "components-tip",
59955 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
59956 icon: tip_default
59957 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
59958 children
59959 })]
59960 });
59961}
59962var tip_tip_default = Tip;
59963
59964
59965;// ./node_modules/@wordpress/components/build-module/toggle-control/index.js
59966
59967
59968
59969
59970
59971
59972
59973
59974
59975
59976
59977
59978function UnforwardedToggleControl({
59979 __nextHasNoMarginBottom,
59980 label,
59981 checked,
59982 help,
59983 className,
59984 onChange,
59985 disabled
59986}, ref) {
59987 function onChangeToggle(event) {
59988 onChange(event.target.checked);
59989 }
59990 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleControl);
59991 const id = `inspector-toggle-control-${instanceId}`;
59992 const cx = useCx();
59993 const classes = cx("components-toggle-control", className, !__nextHasNoMarginBottom && /* @__PURE__ */ emotion_react_browser_esm_css({
59994 marginBottom: space(3)
59995 }, true ? "" : 0, true ? "" : 0));
59996 if (!__nextHasNoMarginBottom) {
59997 external_wp_deprecated_default()("Bottom margin styles for wp.components.ToggleControl", {
59998 since: "6.7",
59999 version: "7.0",
60000 hint: "Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."
60001 });
60002 }
60003 let describedBy, helpLabel;
60004 if (help) {
60005 if (typeof help === "function") {
60006 if (checked !== void 0) {
60007 helpLabel = help(checked);
60008 }
60009 } else {
60010 helpLabel = help;
60011 }
60012 if (helpLabel) {
60013 describedBy = id + "__help";
60014 }
60015 }
60016 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control_default, {
60017 id,
60018 help: helpLabel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
60019 className: "components-toggle-control__help",
60020 children: helpLabel
60021 }),
60022 className: classes,
60023 __nextHasNoMarginBottom: true,
60024 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
60025 justify: "flex-start",
60026 spacing: 2,
60027 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(form_toggle_default, {
60028 id,
60029 checked,
60030 onChange: onChangeToggle,
60031 "aria-describedby": describedBy,
60032 disabled,
60033 ref
60034 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(flex_block_component_component_default, {
60035 as: "label",
60036 htmlFor: id,
60037 className: dist_clsx("components-toggle-control__label", {
60038 "is-disabled": disabled
60039 }),
60040 children: label
60041 })]
60042 })
60043 });
60044}
60045const ToggleControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleControl);
60046var toggle_control_default = ToggleControl;
60047
60048
60049;// ./node_modules/@ariakit/react-core/esm/__chunks/A3WPL2ZJ.js
60050"use client";
60051
60052
60053
60054// src/toolbar/toolbar-context.tsx
60055var A3WPL2ZJ_ctx = createStoreContext(
60056 [CompositeContextProvider],
60057 [CompositeScopedContextProvider]
60058);
60059var useToolbarContext = A3WPL2ZJ_ctx.useContext;
60060var useToolbarScopedContext = A3WPL2ZJ_ctx.useScopedContext;
60061var useToolbarProviderContext = A3WPL2ZJ_ctx.useProviderContext;
60062var ToolbarContextProvider = A3WPL2ZJ_ctx.ContextProvider;
60063var ToolbarScopedContextProvider = A3WPL2ZJ_ctx.ScopedContextProvider;
60064
60065
60066
60067;// ./node_modules/@ariakit/react-core/esm/__chunks/BOLVLGVE.js
60068"use client";
60069
60070
60071
60072
60073
60074// src/toolbar/toolbar-item.tsx
60075var BOLVLGVE_TagName = "button";
60076var useToolbarItem = createHook(
60077 function useToolbarItem2(_a) {
60078 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
60079 const context = useToolbarContext();
60080 store = store || context;
60081 props = useCompositeItem(_3YLGPPWQ_spreadValues({ store }, props));
60082 return props;
60083 }
60084);
60085var ToolbarItem = memo2(
60086 forwardRef2(function ToolbarItem2(props) {
60087 const htmlProps = useToolbarItem(props);
60088 return LMDWO4NN_createElement(BOLVLGVE_TagName, htmlProps);
60089 })
60090);
60091
60092
60093
60094;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-context/index.js
60095
60096const ToolbarContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
60097ToolbarContext.displayName = "ToolbarContext";
60098var toolbar_context_default = ToolbarContext;
60099
60100
60101;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-item/index.js
60102
60103
60104
60105
60106
60107function UnforwardedToolbarItem({
60108 children,
60109 as: Component,
60110 ...props
60111}, ref) {
60112 const accessibleToolbarStore = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
60113 const isRenderProp = typeof children === "function";
60114 if (!isRenderProp && !Component) {
60115 true ? external_wp_warning_default()("`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. See https://developer.wordpress.org/block-editor/components/toolbar-item/") : 0;
60116 return null;
60117 }
60118 const allProps = {
60119 ...props,
60120 ref,
60121 "data-toolbar-item": true
60122 };
60123 if (!accessibleToolbarStore) {
60124 if (Component) {
60125 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
60126 ...allProps,
60127 children
60128 });
60129 }
60130 if (!isRenderProp) {
60131 return null;
60132 }
60133 return children(allProps);
60134 }
60135 const render = isRenderProp ? children : Component && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
60136 children
60137 });
60138 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarItem, {
60139 accessibleWhenDisabled: true,
60140 ...allProps,
60141 store: accessibleToolbarStore,
60142 render
60143 });
60144}
60145const toolbar_item_ToolbarItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarItem);
60146var toolbar_item_default = toolbar_item_ToolbarItem;
60147
60148
60149;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/toolbar-button-container.js
60150
60151const ToolbarButtonContainer = ({
60152 children,
60153 className
60154}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
60155 className,
60156 children
60157});
60158var toolbar_button_container_default = ToolbarButtonContainer;
60159
60160
60161;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/index.js
60162
60163
60164
60165
60166
60167
60168
60169function toolbar_button_useDeprecatedProps({
60170 isDisabled,
60171 ...otherProps
60172}) {
60173 return {
60174 disabled: isDisabled,
60175 ...otherProps
60176 };
60177}
60178function UnforwardedToolbarButton(props, ref) {
60179 const {
60180 children,
60181 className,
60182 containerClassName,
60183 extraProps,
60184 isActive,
60185 title,
60186 ...restProps
60187 } = toolbar_button_useDeprecatedProps(props);
60188 const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
60189 if (!accessibleToolbarState) {
60190 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_button_container_default, {
60191 className: containerClassName,
60192 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
60193 ref,
60194 icon: restProps.icon,
60195 size: "compact",
60196 label: title,
60197 shortcut: restProps.shortcut,
60198 "data-subscript": restProps.subscript,
60199 onClick: (event) => {
60200 event.stopPropagation();
60201 if (restProps.onClick) {
60202 restProps.onClick(event);
60203 }
60204 },
60205 className: dist_clsx("components-toolbar__control", className),
60206 isPressed: isActive,
60207 accessibleWhenDisabled: true,
60208 "data-toolbar-item": true,
60209 ...extraProps,
60210 ...restProps,
60211 children
60212 })
60213 });
60214 }
60215 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
60216 className: dist_clsx("components-toolbar-button", className),
60217 ...extraProps,
60218 ...restProps,
60219 ref,
60220 children: (toolbarItemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(button_default, {
60221 size: "compact",
60222 label: title,
60223 isPressed: isActive,
60224 ...toolbarItemProps,
60225 children
60226 })
60227 });
60228}
60229const ToolbarButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarButton);
60230var toolbar_button_default = ToolbarButton;
60231
60232
60233;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-container.js
60234
60235const ToolbarGroupContainer = ({
60236 className,
60237 children,
60238 ...props
60239}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
60240 className,
60241 ...props,
60242 children
60243});
60244var toolbar_group_container_default = ToolbarGroupContainer;
60245
60246
60247;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js
60248
60249
60250
60251
60252
60253function ToolbarGroupCollapsed({
60254 controls = [],
60255 toggleProps,
60256 ...props
60257}) {
60258 const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
60259 const renderDropdownMenu = (internalToggleProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
60260 controls,
60261 toggleProps: {
60262 ...internalToggleProps,
60263 "data-toolbar-item": true
60264 },
60265 ...props
60266 });
60267 if (accessibleToolbarState) {
60268 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
60269 ...toggleProps,
60270 children: renderDropdownMenu
60271 });
60272 }
60273 return renderDropdownMenu(toggleProps);
60274}
60275var toolbar_group_collapsed_default = ToolbarGroupCollapsed;
60276
60277
60278;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/index.js
60279
60280
60281
60282
60283
60284
60285
60286function isNestedArray(arr) {
60287 return Array.isArray(arr) && Array.isArray(arr[0]);
60288}
60289function ToolbarGroup({
60290 controls = [],
60291 children,
60292 className,
60293 isCollapsed,
60294 title,
60295 ...props
60296}) {
60297 const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
60298 if ((!controls || !controls.length) && !children) {
60299 return null;
60300 }
60301 const finalClassName = dist_clsx(
60302 // Unfortunately, there's legacy code referencing to `.components-toolbar`
60303 // So we can't get rid of it
60304 accessibleToolbarState ? "components-toolbar-group" : "components-toolbar",
60305 className
60306 );
60307 let controlSets;
60308 if (isNestedArray(controls)) {
60309 controlSets = controls;
60310 } else {
60311 controlSets = [controls];
60312 }
60313 if (isCollapsed) {
60314 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_group_collapsed_default, {
60315 label: title,
60316 controls: controlSets,
60317 className: finalClassName,
60318 children,
60319 ...props
60320 });
60321 }
60322 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(toolbar_group_container_default, {
60323 className: finalClassName,
60324 ...props,
60325 children: [controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_button_default, {
60326 containerClassName: indexOfSet > 0 && indexOfControl === 0 ? "has-left-divider" : void 0,
60327 ...control
60328 }, [indexOfSet, indexOfControl].join()))), children]
60329 });
60330}
60331var toolbar_group_default = ToolbarGroup;
60332
60333
60334;// ./node_modules/@ariakit/core/esm/toolbar/toolbar-store.js
60335"use client";
60336
60337
60338
60339
60340
60341
60342
60343
60344// src/toolbar/toolbar-store.ts
60345function createToolbarStore(props = {}) {
60346 var _a;
60347 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
60348 return createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
60349 orientation: defaultValue(
60350 props.orientation,
60351 syncState == null ? void 0 : syncState.orientation,
60352 "horizontal"
60353 ),
60354 focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
60355 }));
60356}
60357
60358
60359;// ./node_modules/@ariakit/react-core/esm/__chunks/7M5THDKH.js
60360"use client";
60361
60362
60363
60364// src/toolbar/toolbar-store.ts
60365
60366function useToolbarStoreProps(store, update, props) {
60367 return useCompositeStoreProps(store, update, props);
60368}
60369function useToolbarStore(props = {}) {
60370 const [store, update] = YV4JVR4I_useStore(createToolbarStore, props);
60371 return useToolbarStoreProps(store, update, props);
60372}
60373
60374
60375
60376;// ./node_modules/@ariakit/react-core/esm/toolbar/toolbar.js
60377"use client";
60378
60379
60380
60381
60382
60383
60384
60385
60386
60387
60388
60389
60390
60391
60392
60393
60394// src/toolbar/toolbar.tsx
60395
60396var toolbar_TagName = "div";
60397var useToolbar = createHook(
60398 function useToolbar2(_a) {
60399 var _b = _a, {
60400 store: storeProp,
60401 orientation: orientationProp,
60402 virtualFocus,
60403 focusLoop,
60404 rtl
60405 } = _b, props = __objRest(_b, [
60406 "store",
60407 "orientation",
60408 "virtualFocus",
60409 "focusLoop",
60410 "rtl"
60411 ]);
60412 const context = useToolbarProviderContext();
60413 storeProp = storeProp || context;
60414 const store = useToolbarStore({
60415 store: storeProp,
60416 orientation: orientationProp,
60417 virtualFocus,
60418 focusLoop,
60419 rtl
60420 });
60421 const orientation = store.useState(
60422 (state) => state.orientation === "both" ? void 0 : state.orientation
60423 );
60424 props = useWrapElement(
60425 props,
60426 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarScopedContextProvider, { value: store, children: element }),
60427 [store]
60428 );
60429 props = _3YLGPPWQ_spreadValues({
60430 role: "toolbar",
60431 "aria-orientation": orientation
60432 }, props);
60433 props = useComposite(_3YLGPPWQ_spreadValues({ store }, props));
60434 return props;
60435 }
60436);
60437var Toolbar = forwardRef2(function Toolbar2(props) {
60438 const htmlProps = useToolbar(props);
60439 return LMDWO4NN_createElement(toolbar_TagName, htmlProps);
60440});
60441
60442
60443;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar/toolbar-container.js
60444
60445
60446
60447
60448
60449function UnforwardedToolbarContainer({
60450 label,
60451 ...props
60452}, ref) {
60453 const toolbarStore = useToolbarStore({
60454 focusLoop: true,
60455 rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
60456 });
60457 return (
60458 // This will provide state for `ToolbarButton`'s
60459 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_context_default.Provider, {
60460 value: toolbarStore,
60461 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Toolbar, {
60462 ref,
60463 "aria-label": label,
60464 store: toolbarStore,
60465 ...props
60466 })
60467 })
60468 );
60469}
60470const ToolbarContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarContainer);
60471var toolbar_container_default = ToolbarContainer;
60472
60473
60474;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar/index.js
60475
60476
60477
60478
60479
60480
60481
60482function UnforwardedToolbar({
60483 className,
60484 label,
60485 variant,
60486 ...props
60487}, ref) {
60488 const isVariantDefined = variant !== void 0;
60489 const contextSystemValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
60490 if (isVariantDefined) {
60491 return {};
60492 }
60493 return {
60494 DropdownMenu: {
60495 variant: "toolbar"
60496 },
60497 Dropdown: {
60498 variant: "toolbar"
60499 },
60500 Menu: {
60501 variant: "toolbar"
60502 }
60503 };
60504 }, [isVariantDefined]);
60505 if (!label) {
60506 external_wp_deprecated_default()("Using Toolbar without label prop", {
60507 since: "5.6",
60508 alternative: "ToolbarGroup component",
60509 link: "https://developer.wordpress.org/block-editor/components/toolbar/"
60510 });
60511 const {
60512 title: _title,
60513 ...restProps
60514 } = props;
60515 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_group_default, {
60516 isCollapsed: false,
60517 ...restProps,
60518 className
60519 });
60520 }
60521 const finalClassName = dist_clsx("components-accessible-toolbar", className, variant && `is-${variant}`);
60522 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
60523 value: contextSystemValue,
60524 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_container_default, {
60525 className: finalClassName,
60526 label,
60527 ref,
60528 ...props
60529 })
60530 });
60531}
60532const toolbar_Toolbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbar);
60533var toolbar_default = toolbar_Toolbar;
60534
60535
60536;// ./node_modules/@wordpress/components/build-module/toolbar/toolbar-dropdown-menu/index.js
60537
60538
60539
60540
60541
60542function UnforwardedToolbarDropdownMenu(props, ref) {
60543 const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context_default);
60544 if (!accessibleToolbarState) {
60545 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
60546 ...props
60547 });
60548 }
60549 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar_item_default, {
60550 ref,
60551 ...props.toggleProps,
60552 children: (toolbarItemProps) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
60553 ...props,
60554 popoverProps: {
60555 ...props.popoverProps
60556 },
60557 toggleProps: toolbarItemProps
60558 })
60559 });
60560}
60561const ToolbarDropdownMenu = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarDropdownMenu);
60562var toolbar_dropdown_menu_default = ToolbarDropdownMenu;
60563
60564
60565;// ./node_modules/@wordpress/components/build-module/tools-panel/styles.js
60566
60567function tools_panel_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
60568 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
60569}
60570
60571
60572
60573
60574
60575const toolsPanelGrid = {
60576 columns: (columns) => /* @__PURE__ */ emotion_react_browser_esm_css("grid-template-columns:", `repeat( ${columns}, minmax(0, 1fr) )`, ";" + ( true ? "" : 0), true ? "" : 0),
60577 spacing: /* @__PURE__ */ emotion_react_browser_esm_css("column-gap:", space(4), ";row-gap:", space(4), ";" + ( true ? "" : 0), true ? "" : 0),
60578 item: {
60579 fullWidth: true ? {
60580 name: "18iuzk9",
60581 styles: "grid-column:1/-1"
60582 } : 0
60583 }
60584};
60585const ToolsPanel = (columns) => /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.columns(columns), " ", toolsPanelGrid.spacing, " border-top:", config_values_default.borderWidth, " solid ", COLORS.gray[300], ";margin-top:-1px;padding:", space(4), ";" + ( true ? "" : 0), true ? "" : 0);
60586const ToolsPanelWithInnerWrapper = (columns) => {
60587 return /* @__PURE__ */ emotion_react_browser_esm_css(">div:not( :first-of-type ){display:grid;", toolsPanelGrid.columns(columns), " ", toolsPanelGrid.spacing, " ", toolsPanelGrid.item.fullWidth, ";}" + ( true ? "" : 0), true ? "" : 0);
60588};
60589const ToolsPanelHiddenInnerWrapper = true ? {
60590 name: "huufmu",
60591 styles: ">div:not( :first-of-type ){display:none;}"
60592} : 0;
60593const ToolsPanelHeader = /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.item.fullWidth, " gap:", space(2), ";.components-dropdown-menu{margin:", space(-1), " 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:", space(6), ";}" + ( true ? "" : 0), true ? "" : 0);
60594const ToolsPanelHeading = true ? {
60595 name: "1pmxm02",
60596 styles: "font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"
60597} : 0;
60598const ToolsPanelItem = /* @__PURE__ */ emotion_react_browser_esm_css(toolsPanelGrid.item.fullWidth, "&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ", Wrapper, "{margin-bottom:0;", StyledField, ":last-child{margin-bottom:0;}}", StyledHelp, "{margin-bottom:0;}&& ", LabelWrapper, "{label{line-height:1.4em;}}" + ( true ? "" : 0), true ? "" : 0);
60599const ToolsPanelItemPlaceholder = true ? {
60600 name: "eivff4",
60601 styles: "display:none"
60602} : 0;
60603const styles_DropdownMenu = true ? {
60604 name: "16gsvie",
60605 styles: "min-width:200px"
60606} : 0;
60607const ResetLabel = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
60608 target: "ews648u0"
60609} : 0)("color:", COLORS.theme.accentDarker10, ";font-size:11px;font-weight:500;line-height:1.4;", rtl({
60610 marginLeft: space(3)
60611}), " text-transform:uppercase;" + ( true ? "" : 0));
60612const DefaultControlsItem = /* @__PURE__ */ emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&&[aria-disabled='true']{color:", COLORS.gray[700], ";opacity:1;&:hover{color:", COLORS.gray[700], ";}", ResetLabel, "{opacity:0.3;}}" + ( true ? "" : 0), true ? "" : 0);
60613
60614
60615;// ./node_modules/@wordpress/components/build-module/tools-panel/context.js
60616
60617const tools_panel_context_noop = () => void 0;
60618const ToolsPanelContext = (0,external_wp_element_namespaceObject.createContext)({
60619 menuItems: {
60620 default: {},
60621 optional: {}
60622 },
60623 hasMenuItems: false,
60624 isResetting: false,
60625 shouldRenderPlaceholderItems: false,
60626 registerPanelItem: tools_panel_context_noop,
60627 deregisterPanelItem: tools_panel_context_noop,
60628 flagItemCustomization: tools_panel_context_noop,
60629 registerResetAllFilter: tools_panel_context_noop,
60630 deregisterResetAllFilter: tools_panel_context_noop,
60631 areAllOptionalControlsHidden: true
60632});
60633ToolsPanelContext.displayName = "ToolsPanelContext";
60634const useToolsPanelContext = () => (0,external_wp_element_namespaceObject.useContext)(ToolsPanelContext);
60635
60636
60637;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-header/hook.js
60638
60639
60640
60641
60642
60643function useToolsPanelHeader(props) {
60644 const {
60645 className,
60646 headingLevel = 2,
60647 ...otherProps
60648 } = useContextSystem(props, "ToolsPanelHeader");
60649 const cx = useCx();
60650 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
60651 return cx(ToolsPanelHeader, className);
60652 }, [className, cx]);
60653 const dropdownMenuClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
60654 return cx(styles_DropdownMenu);
60655 }, [cx]);
60656 const headingClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
60657 return cx(ToolsPanelHeading);
60658 }, [cx]);
60659 const defaultControlsItemClassName = (0,external_wp_element_namespaceObject.useMemo)(() => {
60660 return cx(DefaultControlsItem);
60661 }, [cx]);
60662 const {
60663 menuItems,
60664 hasMenuItems,
60665 areAllOptionalControlsHidden
60666 } = useToolsPanelContext();
60667 return {
60668 ...otherProps,
60669 areAllOptionalControlsHidden,
60670 defaultControlsItemClassName,
60671 dropdownMenuClassName,
60672 hasMenuItems,
60673 headingClassName,
60674 headingLevel,
60675 menuItems,
60676 className: classes
60677 };
60678}
60679
60680
60681;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-header/component.js
60682
60683
60684
60685
60686
60687
60688
60689
60690
60691
60692
60693
60694const DefaultControlsGroup = ({
60695 itemClassName,
60696 items,
60697 toggleItem
60698}) => {
60699 if (!items.length) {
60700 return null;
60701 }
60702 const resetSuffix = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetLabel, {
60703 "aria-hidden": true,
60704 children: (0,external_wp_i18n_namespaceObject.__)("Reset")
60705 });
60706 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
60707 children: items.map(([label, hasValue]) => {
60708 if (hasValue) {
60709 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
60710 className: itemClassName,
60711 role: "menuitem",
60712 label: (0,external_wp_i18n_namespaceObject.sprintf)(
60713 // translators: %s: The name of the control being reset e.g. "Padding".
60714 (0,external_wp_i18n_namespaceObject.__)("Reset %s"),
60715 label
60716 ),
60717 onClick: () => {
60718 toggleItem(label);
60719 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
60720 // translators: %s: The name of the control being reset e.g. "Padding".
60721 (0,external_wp_i18n_namespaceObject.__)("%s reset to default"),
60722 label
60723 ), "assertive");
60724 },
60725 suffix: resetSuffix,
60726 children: label
60727 }, label);
60728 }
60729 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
60730 icon: check_default,
60731 className: itemClassName,
60732 role: "menuitemcheckbox",
60733 isSelected: true,
60734 "aria-disabled": true,
60735 children: label
60736 }, label);
60737 })
60738 });
60739};
60740const OptionalControlsGroup = ({
60741 items,
60742 toggleItem
60743}) => {
60744 if (!items.length) {
60745 return null;
60746 }
60747 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
60748 children: items.map(([label, isSelected]) => {
60749 const itemLabel = isSelected ? (0,external_wp_i18n_namespaceObject.sprintf)(
60750 // translators: %s: The name of the control being hidden and reset e.g. "Padding".
60751 (0,external_wp_i18n_namespaceObject.__)("Hide and reset %s"),
60752 label
60753 ) : (0,external_wp_i18n_namespaceObject.sprintf)(
60754 // translators: %s: The name of the control to display e.g. "Padding".
60755 (0,external_wp_i18n_namespaceObject._x)("Show %s", "input control"),
60756 label
60757 );
60758 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
60759 icon: isSelected ? check_default : null,
60760 isSelected,
60761 label: itemLabel,
60762 onClick: () => {
60763 if (isSelected) {
60764 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
60765 // translators: %s: The name of the control being reset e.g. "Padding".
60766 (0,external_wp_i18n_namespaceObject.__)("%s hidden and reset to default"),
60767 label
60768 ), "assertive");
60769 } else {
60770 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(
60771 // translators: %s: The name of the control being reset e.g. "Padding".
60772 (0,external_wp_i18n_namespaceObject.__)("%s is now visible"),
60773 label
60774 ), "assertive");
60775 }
60776 toggleItem(label);
60777 },
60778 role: "menuitemcheckbox",
60779 children: label
60780 }, label);
60781 })
60782 });
60783};
60784const component_ToolsPanelHeader = (props, forwardedRef) => {
60785 const {
60786 areAllOptionalControlsHidden,
60787 defaultControlsItemClassName,
60788 dropdownMenuClassName,
60789 hasMenuItems,
60790 headingClassName,
60791 headingLevel = 2,
60792 label: labelText,
60793 menuItems,
60794 resetAll,
60795 toggleItem,
60796 dropdownMenuProps,
60797 ...headerProps
60798 } = useToolsPanelHeader(props);
60799 if (!labelText) {
60800 return null;
60801 }
60802 const defaultItems = Object.entries(menuItems?.default || {});
60803 const optionalItems = Object.entries(menuItems?.optional || {});
60804 const dropDownMenuIcon = areAllOptionalControlsHidden ? plus_default : more_vertical_default;
60805 const dropDownMenuLabelText = (0,external_wp_i18n_namespaceObject.sprintf)(
60806 // translators: %s: The name of the tool e.g. "Color" or "Typography".
60807 (0,external_wp_i18n_namespaceObject._x)("%s options", "Button label to reveal tool panel options"),
60808 labelText
60809 );
60810 const dropdownMenuDescriptionText = areAllOptionalControlsHidden ? (0,external_wp_i18n_namespaceObject.__)("All options are currently hidden") : void 0;
60811 const canResetAll = [...defaultItems, ...optionalItems].some(([, isSelected]) => isSelected);
60812 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component_component_default, {
60813 ...headerProps,
60814 ref: forwardedRef,
60815 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(heading_component_component_default, {
60816 level: headingLevel,
60817 className: headingClassName,
60818 children: labelText
60819 }), hasMenuItems && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_menu_default, {
60820 ...dropdownMenuProps,
60821 icon: dropDownMenuIcon,
60822 label: dropDownMenuLabelText,
60823 menuProps: {
60824 className: dropdownMenuClassName
60825 },
60826 toggleProps: {
60827 size: "small",
60828 description: dropdownMenuDescriptionText
60829 },
60830 children: () => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
60831 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(menu_group_default, {
60832 label: labelText,
60833 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultControlsGroup, {
60834 items: defaultItems,
60835 toggleItem,
60836 itemClassName: defaultControlsItemClassName
60837 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OptionalControlsGroup, {
60838 items: optionalItems,
60839 toggleItem
60840 })]
60841 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_group_default, {
60842 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_item_default, {
60843 "aria-disabled": !canResetAll,
60844 variant: "tertiary",
60845 onClick: () => {
60846 if (canResetAll) {
60847 resetAll();
60848 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)("All options reset"), "assertive");
60849 }
60850 },
60851 children: (0,external_wp_i18n_namespaceObject.__)("Reset all")
60852 })
60853 })]
60854 })
60855 })]
60856 });
60857};
60858const ConnectedToolsPanelHeader = contextConnect(component_ToolsPanelHeader, "ToolsPanelHeader");
60859var tools_panel_header_component_component_default = ConnectedToolsPanelHeader;
60860
60861
60862;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/hook.js
60863
60864
60865
60866
60867const DEFAULT_COLUMNS = 2;
60868function emptyMenuItems() {
60869 return {
60870 default: {},
60871 optional: {}
60872 };
60873}
60874function emptyState() {
60875 return {
60876 panelItems: [],
60877 menuItemOrder: [],
60878 menuItems: emptyMenuItems()
60879 };
60880}
60881const generateMenuItems = ({
60882 panelItems,
60883 shouldReset,
60884 currentMenuItems,
60885 menuItemOrder
60886}) => {
60887 const newMenuItems = emptyMenuItems();
60888 const menuItems = emptyMenuItems();
60889 panelItems.forEach(({
60890 hasValue,
60891 isShownByDefault,
60892 label
60893 }) => {
60894 const group = isShownByDefault ? "default" : "optional";
60895 const existingItemValue = currentMenuItems?.[group]?.[label];
60896 const value = existingItemValue ? existingItemValue : hasValue();
60897 newMenuItems[group][label] = shouldReset ? false : value;
60898 });
60899 menuItemOrder.forEach((key) => {
60900 if (newMenuItems.default.hasOwnProperty(key)) {
60901 menuItems.default[key] = newMenuItems.default[key];
60902 }
60903 if (newMenuItems.optional.hasOwnProperty(key)) {
60904 menuItems.optional[key] = newMenuItems.optional[key];
60905 }
60906 });
60907 Object.keys(newMenuItems.default).forEach((key) => {
60908 if (!menuItems.default.hasOwnProperty(key)) {
60909 menuItems.default[key] = newMenuItems.default[key];
60910 }
60911 });
60912 Object.keys(newMenuItems.optional).forEach((key) => {
60913 if (!menuItems.optional.hasOwnProperty(key)) {
60914 menuItems.optional[key] = newMenuItems.optional[key];
60915 }
60916 });
60917 return menuItems;
60918};
60919function panelItemsReducer(panelItems, action) {
60920 switch (action.type) {
60921 case "REGISTER_PANEL": {
60922 const newItems = [...panelItems];
60923 const existingIndex = newItems.findIndex((oldItem) => oldItem.label === action.item.label);
60924 if (existingIndex !== -1) {
60925 newItems.splice(existingIndex, 1);
60926 }
60927 newItems.push(action.item);
60928 return newItems;
60929 }
60930 case "UNREGISTER_PANEL": {
60931 const index = panelItems.findIndex((item) => item.label === action.label);
60932 if (index !== -1) {
60933 const newItems = [...panelItems];
60934 newItems.splice(index, 1);
60935 return newItems;
60936 }
60937 return panelItems;
60938 }
60939 default:
60940 return panelItems;
60941 }
60942}
60943function menuItemOrderReducer(menuItemOrder, action) {
60944 switch (action.type) {
60945 case "REGISTER_PANEL": {
60946 if (menuItemOrder.includes(action.item.label)) {
60947 return menuItemOrder;
60948 }
60949 return [...menuItemOrder, action.item.label];
60950 }
60951 default:
60952 return menuItemOrder;
60953 }
60954}
60955function menuItemsReducer(state, action) {
60956 switch (action.type) {
60957 case "REGISTER_PANEL":
60958 case "UNREGISTER_PANEL":
60959 return generateMenuItems({
60960 currentMenuItems: state.menuItems,
60961 panelItems: state.panelItems,
60962 menuItemOrder: state.menuItemOrder,
60963 shouldReset: false
60964 });
60965 case "RESET_ALL":
60966 return generateMenuItems({
60967 panelItems: state.panelItems,
60968 menuItemOrder: state.menuItemOrder,
60969 shouldReset: true
60970 });
60971 case "UPDATE_VALUE": {
60972 const oldValue = state.menuItems[action.group][action.label];
60973 if (action.value === oldValue) {
60974 return state.menuItems;
60975 }
60976 return {
60977 ...state.menuItems,
60978 [action.group]: {
60979 ...state.menuItems[action.group],
60980 [action.label]: action.value
60981 }
60982 };
60983 }
60984 case "TOGGLE_VALUE": {
60985 const currentItem = state.panelItems.find((item) => item.label === action.label);
60986 if (!currentItem) {
60987 return state.menuItems;
60988 }
60989 const menuGroup = currentItem.isShownByDefault ? "default" : "optional";
60990 const newMenuItems = {
60991 ...state.menuItems,
60992 [menuGroup]: {
60993 ...state.menuItems[menuGroup],
60994 [action.label]: !state.menuItems[menuGroup][action.label]
60995 }
60996 };
60997 return newMenuItems;
60998 }
60999 default:
61000 return state.menuItems;
61001 }
61002}
61003function panelReducer(state, action) {
61004 const panelItems = panelItemsReducer(state.panelItems, action);
61005 const menuItemOrder = menuItemOrderReducer(state.menuItemOrder, action);
61006 const menuItems = menuItemsReducer({
61007 panelItems,
61008 menuItemOrder,
61009 menuItems: state.menuItems
61010 }, action);
61011 return {
61012 panelItems,
61013 menuItemOrder,
61014 menuItems
61015 };
61016}
61017function resetAllFiltersReducer(filters, action) {
61018 switch (action.type) {
61019 case "REGISTER":
61020 return [...filters, action.filter];
61021 case "UNREGISTER":
61022 return filters.filter((f) => f !== action.filter);
61023 default:
61024 return filters;
61025 }
61026}
61027const isMenuItemTypeEmpty = (obj) => Object.keys(obj).length === 0;
61028function useToolsPanel(props) {
61029 const {
61030 className,
61031 headingLevel = 2,
61032 resetAll,
61033 panelId,
61034 hasInnerWrapper = false,
61035 shouldRenderPlaceholderItems = false,
61036 __experimentalFirstVisibleItemClass,
61037 __experimentalLastVisibleItemClass,
61038 ...otherProps
61039 } = useContextSystem(props, "ToolsPanel");
61040 const isResettingRef = (0,external_wp_element_namespaceObject.useRef)(false);
61041 const wasResetting = isResettingRef.current;
61042 (0,external_wp_element_namespaceObject.useEffect)(() => {
61043 if (wasResetting) {
61044 isResettingRef.current = false;
61045 }
61046 }, [wasResetting]);
61047 const [{
61048 panelItems,
61049 menuItems
61050 }, panelDispatch] = (0,external_wp_element_namespaceObject.useReducer)(panelReducer, void 0, emptyState);
61051 const [resetAllFilters, dispatchResetAllFilters] = (0,external_wp_element_namespaceObject.useReducer)(resetAllFiltersReducer, []);
61052 const registerPanelItem = (0,external_wp_element_namespaceObject.useCallback)((item) => {
61053 panelDispatch({
61054 type: "REGISTER_PANEL",
61055 item
61056 });
61057 }, []);
61058 const deregisterPanelItem = (0,external_wp_element_namespaceObject.useCallback)((label) => {
61059 panelDispatch({
61060 type: "UNREGISTER_PANEL",
61061 label
61062 });
61063 }, []);
61064 const registerResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((filter) => {
61065 dispatchResetAllFilters({
61066 type: "REGISTER",
61067 filter
61068 });
61069 }, []);
61070 const deregisterResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)((filter) => {
61071 dispatchResetAllFilters({
61072 type: "UNREGISTER",
61073 filter
61074 });
61075 }, []);
61076 const flagItemCustomization = (0,external_wp_element_namespaceObject.useCallback)((value, label, group = "default") => {
61077 panelDispatch({
61078 type: "UPDATE_VALUE",
61079 group,
61080 label,
61081 value
61082 });
61083 }, []);
61084 const areAllOptionalControlsHidden = (0,external_wp_element_namespaceObject.useMemo)(() => {
61085 return isMenuItemTypeEmpty(menuItems.default) && !isMenuItemTypeEmpty(menuItems.optional) && Object.values(menuItems.optional).every((isSelected) => !isSelected);
61086 }, [menuItems]);
61087 const cx = useCx();
61088 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
61089 const wrapperStyle = hasInnerWrapper && ToolsPanelWithInnerWrapper(DEFAULT_COLUMNS);
61090 const emptyStyle = areAllOptionalControlsHidden && ToolsPanelHiddenInnerWrapper;
61091 return cx(ToolsPanel(DEFAULT_COLUMNS), wrapperStyle, emptyStyle, className);
61092 }, [areAllOptionalControlsHidden, className, cx, hasInnerWrapper]);
61093 const toggleItem = (0,external_wp_element_namespaceObject.useCallback)((label) => {
61094 panelDispatch({
61095 type: "TOGGLE_VALUE",
61096 label
61097 });
61098 }, []);
61099 const resetAllItems = (0,external_wp_element_namespaceObject.useCallback)(() => {
61100 if (typeof resetAll === "function") {
61101 isResettingRef.current = true;
61102 resetAll(resetAllFilters);
61103 }
61104 panelDispatch({
61105 type: "RESET_ALL"
61106 });
61107 }, [resetAllFilters, resetAll]);
61108 const getFirstVisibleItemLabel = (items) => {
61109 const optionalItems = menuItems.optional || {};
61110 const firstItem = items.find((item) => item.isShownByDefault || optionalItems[item.label]);
61111 return firstItem?.label;
61112 };
61113 const firstDisplayedItem = getFirstVisibleItemLabel(panelItems);
61114 const lastDisplayedItem = getFirstVisibleItemLabel([...panelItems].reverse());
61115 const hasMenuItems = panelItems.length > 0;
61116 const panelContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
61117 areAllOptionalControlsHidden,
61118 deregisterPanelItem,
61119 deregisterResetAllFilter,
61120 firstDisplayedItem,
61121 flagItemCustomization,
61122 hasMenuItems,
61123 isResetting: isResettingRef.current,
61124 lastDisplayedItem,
61125 menuItems,
61126 panelId,
61127 registerPanelItem,
61128 registerResetAllFilter,
61129 shouldRenderPlaceholderItems,
61130 __experimentalFirstVisibleItemClass,
61131 __experimentalLastVisibleItemClass
61132 }), [areAllOptionalControlsHidden, deregisterPanelItem, deregisterResetAllFilter, firstDisplayedItem, flagItemCustomization, lastDisplayedItem, menuItems, panelId, hasMenuItems, registerResetAllFilter, registerPanelItem, shouldRenderPlaceholderItems, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass]);
61133 return {
61134 ...otherProps,
61135 headingLevel,
61136 panelContext,
61137 resetAllItems,
61138 toggleItem,
61139 className: classes
61140 };
61141}
61142
61143
61144;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/component.js
61145
61146
61147
61148
61149
61150
61151const UnconnectedToolsPanel = (props, forwardedRef) => {
61152 const {
61153 children,
61154 label,
61155 panelContext,
61156 resetAllItems,
61157 toggleItem,
61158 headingLevel,
61159 dropdownMenuProps,
61160 ...toolsPanelProps
61161 } = useToolsPanel(props);
61162 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(grid_component_component_default, {
61163 ...toolsPanelProps,
61164 columns: 2,
61165 ref: forwardedRef,
61166 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsPanelContext.Provider, {
61167 value: panelContext,
61168 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_panel_header_component_component_default, {
61169 label,
61170 resetAll: resetAllItems,
61171 toggleItem,
61172 headingLevel,
61173 dropdownMenuProps
61174 }), children]
61175 })
61176 });
61177};
61178const component_ToolsPanel = contextConnect(UnconnectedToolsPanel, "ToolsPanel");
61179var tools_panel_component_component_default = component_ToolsPanel;
61180
61181
61182;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-item/hook.js
61183
61184
61185
61186
61187
61188
61189const hook_noop = () => {
61190};
61191function useToolsPanelItem(props) {
61192 const {
61193 className,
61194 hasValue,
61195 isShownByDefault = false,
61196 label,
61197 panelId,
61198 resetAllFilter = hook_noop,
61199 onDeselect,
61200 onSelect,
61201 ...otherProps
61202 } = useContextSystem(props, "ToolsPanelItem");
61203 const {
61204 panelId: currentPanelId,
61205 menuItems,
61206 registerResetAllFilter,
61207 deregisterResetAllFilter,
61208 registerPanelItem,
61209 deregisterPanelItem,
61210 flagItemCustomization,
61211 isResetting,
61212 shouldRenderPlaceholderItems: shouldRenderPlaceholder,
61213 firstDisplayedItem,
61214 lastDisplayedItem,
61215 __experimentalFirstVisibleItemClass,
61216 __experimentalLastVisibleItemClass
61217 } = useToolsPanelContext();
61218 const hasValueCallback = (0,external_wp_element_namespaceObject.useCallback)(hasValue, [panelId]);
61219 const resetAllFilterCallback = (0,external_wp_element_namespaceObject.useCallback)(resetAllFilter, [panelId]);
61220 const previousPanelId = (0,external_wp_compose_namespaceObject.usePrevious)(currentPanelId);
61221 const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;
61222 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
61223 if (hasMatchingPanel && previousPanelId !== null) {
61224 registerPanelItem({
61225 hasValue: hasValueCallback,
61226 isShownByDefault,
61227 label,
61228 panelId
61229 });
61230 }
61231 return () => {
61232 if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {
61233 deregisterPanelItem(label);
61234 }
61235 };
61236 }, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);
61237 (0,external_wp_element_namespaceObject.useEffect)(() => {
61238 if (hasMatchingPanel) {
61239 registerResetAllFilter(resetAllFilterCallback);
61240 }
61241 return () => {
61242 if (hasMatchingPanel) {
61243 deregisterResetAllFilter(resetAllFilterCallback);
61244 }
61245 };
61246 }, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);
61247 const menuGroup = isShownByDefault ? "default" : "optional";
61248 const isMenuItemChecked = menuItems?.[menuGroup]?.[label];
61249 const wasMenuItemChecked = (0,external_wp_compose_namespaceObject.usePrevious)(isMenuItemChecked);
61250 const isRegistered = menuItems?.[menuGroup]?.[label] !== void 0;
61251 const isValueSet = hasValue();
61252 (0,external_wp_element_namespaceObject.useEffect)(() => {
61253 if (!isShownByDefault && !isValueSet) {
61254 return;
61255 }
61256 flagItemCustomization(isValueSet, label, menuGroup);
61257 }, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);
61258 (0,external_wp_element_namespaceObject.useEffect)(() => {
61259 if (!isRegistered || isResetting || !hasMatchingPanel) {
61260 return;
61261 }
61262 if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {
61263 onSelect?.();
61264 }
61265 if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {
61266 onDeselect?.();
61267 }
61268 }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);
61269 const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== void 0 : isMenuItemChecked;
61270 const cx = useCx();
61271 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => {
61272 const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;
61273 const firstItemStyle = firstDisplayedItem === label && __experimentalFirstVisibleItemClass;
61274 const lastItemStyle = lastDisplayedItem === label && __experimentalLastVisibleItemClass;
61275 return cx(ToolsPanelItem, shouldApplyPlaceholderStyles && ToolsPanelItemPlaceholder, !shouldApplyPlaceholderStyles && className, firstItemStyle, lastItemStyle);
61276 }, [isShown, shouldRenderPlaceholder, className, cx, firstDisplayedItem, lastDisplayedItem, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass, label]);
61277 return {
61278 ...otherProps,
61279 isShown,
61280 shouldRenderPlaceholder,
61281 className: classes
61282 };
61283}
61284
61285
61286;// ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-item/component.js
61287
61288
61289
61290
61291const UnconnectedToolsPanelItem = (props, forwardedRef) => {
61292 const {
61293 children,
61294 isShown,
61295 shouldRenderPlaceholder,
61296 ...toolsPanelItemProps
61297 } = useToolsPanelItem(props);
61298 if (!isShown) {
61299 return shouldRenderPlaceholder ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
61300 ...toolsPanelItemProps,
61301 ref: forwardedRef
61302 }) : null;
61303 }
61304 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(component_default, {
61305 ...toolsPanelItemProps,
61306 ref: forwardedRef,
61307 children
61308 });
61309};
61310const component_ToolsPanelItem = contextConnect(UnconnectedToolsPanelItem, "ToolsPanelItem");
61311var tools_panel_item_component_component_default = component_ToolsPanelItem;
61312
61313
61314;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js
61315
61316const RovingTabIndexContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
61317RovingTabIndexContext.displayName = "RovingTabIndexContext";
61318const useRovingTabIndexContext = () => (0,external_wp_element_namespaceObject.useContext)(RovingTabIndexContext);
61319const RovingTabIndexProvider = RovingTabIndexContext.Provider;
61320
61321
61322;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index.js
61323
61324
61325
61326function RovingTabIndex({
61327 children
61328}) {
61329 const [lastFocusedElement, setLastFocusedElement] = (0,external_wp_element_namespaceObject.useState)();
61330 const providerValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
61331 lastFocusedElement,
61332 setLastFocusedElement
61333 }), [lastFocusedElement]);
61334 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RovingTabIndexProvider, {
61335 value: providerValue,
61336 children
61337 });
61338}
61339
61340
61341;// ./node_modules/@wordpress/components/build-module/tree-grid/index.js
61342
61343
61344
61345
61346
61347function getRowFocusables(rowElement) {
61348 const focusablesInRow = external_wp_dom_namespaceObject.focus.focusable.find(rowElement, {
61349 sequential: true
61350 });
61351 return focusablesInRow.filter((focusable) => {
61352 return focusable.closest('[role="row"]') === rowElement;
61353 });
61354}
61355function UnforwardedTreeGrid({
61356 children,
61357 onExpandRow = () => {
61358 },
61359 onCollapseRow = () => {
61360 },
61361 onFocusRow = () => {
61362 },
61363 applicationAriaLabel,
61364 ...props
61365}, ref) {
61366 const onKeyDown = (0,external_wp_element_namespaceObject.useCallback)((event) => {
61367 const {
61368 keyCode,
61369 metaKey,
61370 ctrlKey,
61371 altKey
61372 } = event;
61373 const hasModifierKeyPressed = metaKey || ctrlKey || altKey;
61374 if (hasModifierKeyPressed || ![external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT, external_wp_keycodes_namespaceObject.HOME, external_wp_keycodes_namespaceObject.END].includes(keyCode)) {
61375 return;
61376 }
61377 event.stopPropagation();
61378 const {
61379 activeElement
61380 } = document;
61381 const {
61382 currentTarget: treeGridElement
61383 } = event;
61384 if (!activeElement || !treeGridElement.contains(activeElement)) {
61385 return;
61386 }
61387 const activeRow = activeElement.closest('[role="row"]');
61388 if (!activeRow) {
61389 return;
61390 }
61391 const focusablesInRow = getRowFocusables(activeRow);
61392 const currentColumnIndex = focusablesInRow.indexOf(activeElement);
61393 const canExpandCollapse = 0 === currentColumnIndex;
61394 const cannotFocusNextColumn = canExpandCollapse && (activeRow.getAttribute("data-expanded") === "false" || activeRow.getAttribute("aria-expanded") === "false") && keyCode === external_wp_keycodes_namespaceObject.RIGHT;
61395 if ([external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT].includes(keyCode)) {
61396 let nextIndex;
61397 if (keyCode === external_wp_keycodes_namespaceObject.LEFT) {
61398 nextIndex = Math.max(0, currentColumnIndex - 1);
61399 } else {
61400 nextIndex = Math.min(currentColumnIndex + 1, focusablesInRow.length - 1);
61401 }
61402 if (canExpandCollapse) {
61403 if (keyCode === external_wp_keycodes_namespaceObject.LEFT) {
61404 var _activeRow$getAttribu;
61405 if (activeRow.getAttribute("data-expanded") === "true" || activeRow.getAttribute("aria-expanded") === "true") {
61406 onCollapseRow(activeRow);
61407 event.preventDefault();
61408 return;
61409 }
61410 const level = Math.max(parseInt((_activeRow$getAttribu = activeRow?.getAttribute("aria-level")) !== null && _activeRow$getAttribu !== void 0 ? _activeRow$getAttribu : "1", 10) - 1, 1);
61411 const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
61412 let parentRow = activeRow;
61413 const currentRowIndex = rows.indexOf(activeRow);
61414 for (let i = currentRowIndex; i >= 0; i--) {
61415 const ariaLevel = rows[i].getAttribute("aria-level");
61416 if (ariaLevel !== null && parseInt(ariaLevel, 10) === level) {
61417 parentRow = rows[i];
61418 break;
61419 }
61420 }
61421 getRowFocusables(parentRow)?.[0]?.focus();
61422 }
61423 if (keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
61424 if (activeRow.getAttribute("data-expanded") === "false" || activeRow.getAttribute("aria-expanded") === "false") {
61425 onExpandRow(activeRow);
61426 event.preventDefault();
61427 return;
61428 }
61429 const focusableItems = getRowFocusables(activeRow);
61430 if (focusableItems.length > 0) {
61431 focusableItems[nextIndex]?.focus();
61432 }
61433 }
61434 event.preventDefault();
61435 return;
61436 }
61437 if (cannotFocusNextColumn) {
61438 return;
61439 }
61440 focusablesInRow[nextIndex].focus();
61441 event.preventDefault();
61442 } else if ([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN].includes(keyCode)) {
61443 const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
61444 const currentRowIndex = rows.indexOf(activeRow);
61445 let nextRowIndex;
61446 if (keyCode === external_wp_keycodes_namespaceObject.UP) {
61447 nextRowIndex = Math.max(0, currentRowIndex - 1);
61448 } else {
61449 nextRowIndex = Math.min(currentRowIndex + 1, rows.length - 1);
61450 }
61451 if (nextRowIndex === currentRowIndex) {
61452 event.preventDefault();
61453 return;
61454 }
61455 const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]);
61456 if (!focusablesInNextRow || !focusablesInNextRow.length) {
61457 event.preventDefault();
61458 return;
61459 }
61460 const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
61461 focusablesInNextRow[nextIndex].focus();
61462 onFocusRow(event, activeRow, rows[nextRowIndex]);
61463 event.preventDefault();
61464 } else if ([external_wp_keycodes_namespaceObject.HOME, external_wp_keycodes_namespaceObject.END].includes(keyCode)) {
61465 const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
61466 const currentRowIndex = rows.indexOf(activeRow);
61467 let nextRowIndex;
61468 if (keyCode === external_wp_keycodes_namespaceObject.HOME) {
61469 nextRowIndex = 0;
61470 } else {
61471 nextRowIndex = rows.length - 1;
61472 }
61473 if (nextRowIndex === currentRowIndex) {
61474 event.preventDefault();
61475 return;
61476 }
61477 const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]);
61478 if (!focusablesInNextRow || !focusablesInNextRow.length) {
61479 event.preventDefault();
61480 return;
61481 }
61482 const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
61483 focusablesInNextRow[nextIndex].focus();
61484 onFocusRow(event, activeRow, rows[nextRowIndex]);
61485 event.preventDefault();
61486 }
61487 }, [onExpandRow, onCollapseRow, onFocusRow]);
61488 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RovingTabIndex, {
61489 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
61490 role: "application",
61491 "aria-label": applicationAriaLabel,
61492 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("table", {
61493 ...props,
61494 role: "treegrid",
61495 onKeyDown,
61496 ref,
61497 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", {
61498 children
61499 })
61500 })
61501 })
61502 });
61503}
61504const TreeGrid = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGrid);
61505var tree_grid_default = TreeGrid;
61506
61507
61508
61509
61510
61511;// ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js
61512
61513
61514
61515const RovingTabIndexItem = (0,external_wp_element_namespaceObject.forwardRef)(function UnforwardedRovingTabIndexItem({
61516 children,
61517 as: Component,
61518 ...props
61519}, forwardedRef) {
61520 const localRef = (0,external_wp_element_namespaceObject.useRef)();
61521 const ref = forwardedRef || localRef;
61522 const {
61523 lastFocusedElement,
61524 setLastFocusedElement
61525 } = useRovingTabIndexContext();
61526 let tabIndex;
61527 if (lastFocusedElement) {
61528 tabIndex = lastFocusedElement === // TODO: The original implementation simply used `ref.current` here, assuming
61529 // that a forwarded ref would always be an object, which is not necessarily true.
61530 // This workaround maintains the original runtime behavior in a type-safe way,
61531 // but should be revisited.
61532 ("current" in ref ? ref.current : void 0) ? 0 : -1;
61533 }
61534 const onFocus = (event) => setLastFocusedElement?.(event.target);
61535 const allProps = {
61536 ref,
61537 tabIndex,
61538 onFocus,
61539 ...props
61540 };
61541 if (typeof children === "function") {
61542 return children(allProps);
61543 }
61544 if (!Component) {
61545 return null;
61546 }
61547 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
61548 ...allProps,
61549 children
61550 });
61551});
61552var roving_tab_index_item_default = RovingTabIndexItem;
61553
61554
61555;// ./node_modules/@wordpress/components/build-module/tree-grid/item.js
61556
61557
61558
61559function UnforwardedTreeGridItem({
61560 children,
61561 ...props
61562}, ref) {
61563 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(roving_tab_index_item_default, {
61564 ref,
61565 ...props,
61566 children
61567 });
61568}
61569const TreeGridItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridItem);
61570var tree_grid_item_item_default = TreeGridItem;
61571
61572
61573;// ./node_modules/@wordpress/components/build-module/tree-grid/cell.js
61574
61575
61576
61577function UnforwardedTreeGridCell({
61578 children,
61579 withoutGridItem = false,
61580 ...props
61581}, ref) {
61582 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", {
61583 ...props,
61584 role: "gridcell",
61585 children: withoutGridItem ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
61586 children: typeof children === "function" ? children({
61587 ...props,
61588 ref
61589 }) : children
61590 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(tree_grid_item_item_default, {
61591 ref,
61592 children
61593 })
61594 });
61595}
61596const TreeGridCell = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridCell);
61597var cell_default = TreeGridCell;
61598
61599
61600;// ./node_modules/@wordpress/components/build-module/tree-grid/row.js
61601
61602
61603function UnforwardedTreeGridRow({
61604 children,
61605 level,
61606 positionInSet,
61607 setSize,
61608 isExpanded,
61609 ...props
61610}, ref) {
61611 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
61612 ...props,
61613 ref,
61614 role: "row",
61615 "aria-level": level,
61616 "aria-posinset": positionInSet,
61617 "aria-setsize": setSize,
61618 "aria-expanded": isExpanded,
61619 children
61620 });
61621}
61622const TreeGridRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridRow);
61623var row_row_default = TreeGridRow;
61624
61625
61626;// ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
61627
61628
61629
61630function stopPropagation(event) {
61631 event.stopPropagation();
61632}
61633const IsolatedEventContainer = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
61634 external_wp_deprecated_default()("wp.components.IsolatedEventContainer", {
61635 since: "5.7"
61636 });
61637 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
61638 ...props,
61639 ref,
61640 onMouseDown: stopPropagation
61641 });
61642});
61643var isolated_event_container_default = IsolatedEventContainer;
61644
61645
61646;// ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot-fills.js
61647
61648
61649
61650function useSlotFills(name) {
61651 const registry = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context_default);
61652 return (0,external_wp_compose_namespaceObject.useObservableValue)(registry.fills, name);
61653}
61654
61655
61656;// ./node_modules/@wordpress/components/build-module/z-stack/styles.js
61657
61658function z_stack_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
61659 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
61660}
61661
61662const ZStackChildView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
61663 target: "ebn2ljm1"
61664} : 0)("&:not( :first-of-type ){", ({
61665 offsetAmount
61666}) => /* @__PURE__ */ emotion_react_browser_esm_css({
61667 marginInlineStart: offsetAmount
61668}, true ? "" : 0, true ? "" : 0), ";}", ({
61669 zIndex
61670}) => /* @__PURE__ */ emotion_react_browser_esm_css({
61671 zIndex
61672}, true ? "" : 0, true ? "" : 0), ";" + ( true ? "" : 0));
61673var z_stack_styles_ref = true ? {
61674 name: "rs0gp6",
61675 styles: "grid-row-start:1;grid-column-start:1"
61676} : 0;
61677const ZStackView = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
61678 target: "ebn2ljm0"
61679} : 0)("display:inline-grid;grid-auto-flow:column;position:relative;&>", ZStackChildView, "{position:relative;justify-self:start;", ({
61680 isLayered
61681}) => isLayered ? (
61682 // When `isLayered` is true, all items overlap in the same grid cell
61683 z_stack_styles_ref
61684) : void 0, ";}" + ( true ? "" : 0));
61685
61686
61687;// ./node_modules/@wordpress/components/build-module/z-stack/component.js
61688
61689
61690
61691
61692
61693function UnconnectedZStack(props, forwardedRef) {
61694 const {
61695 children,
61696 className,
61697 isLayered = true,
61698 isReversed = false,
61699 offset = 0,
61700 ...otherProps
61701 } = useContextSystem(props, "ZStack");
61702 const validChildren = getValidChildren(children);
61703 const childrenLastIndex = validChildren.length - 1;
61704 const clonedChildren = validChildren.map((child, index) => {
61705 const zIndex = isReversed ? childrenLastIndex - index : index;
61706 const offsetAmount = isLayered ? offset * index : offset;
61707 const key = (0,external_wp_element_namespaceObject.isValidElement)(child) ? child.key : index;
61708 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ZStackChildView, {
61709 offsetAmount,
61710 zIndex,
61711 children: child
61712 }, key);
61713 });
61714 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ZStackView, {
61715 ...otherProps,
61716 className,
61717 isLayered,
61718 ref: forwardedRef,
61719 children: clonedChildren
61720 });
61721}
61722const ZStack = contextConnect(UnconnectedZStack, "ZStack");
61723var z_stack_component_component_default = ZStack;
61724
61725
61726;// ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js
61727
61728
61729
61730
61731const defaultShortcuts = {
61732 previous: [{
61733 modifier: "ctrlShift",
61734 character: "`"
61735 }, {
61736 modifier: "ctrlShift",
61737 character: "~"
61738 }, {
61739 modifier: "access",
61740 character: "p"
61741 }],
61742 next: [{
61743 modifier: "ctrl",
61744 character: "`"
61745 }, {
61746 modifier: "access",
61747 character: "n"
61748 }]
61749};
61750function useNavigateRegions(shortcuts = defaultShortcuts) {
61751 const ref = (0,external_wp_element_namespaceObject.useRef)(null);
61752 const [isFocusingRegions, setIsFocusingRegions] = (0,external_wp_element_namespaceObject.useState)(false);
61753 function focusRegion(offset) {
61754 var _ref$current$querySel;
61755 const regions = Array.from((_ref$current$querySel = ref.current?.querySelectorAll('[role="region"][tabindex="-1"]')) !== null && _ref$current$querySel !== void 0 ? _ref$current$querySel : []);
61756 if (!regions.length) {
61757 return;
61758 }
61759 let nextRegion = regions[0];
61760 const wrappingRegion = ref.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]');
61761 const selectedIndex = wrappingRegion ? regions.indexOf(wrappingRegion) : -1;
61762 if (selectedIndex !== -1) {
61763 let nextIndex = selectedIndex + offset;
61764 nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;
61765 nextIndex = nextIndex === regions.length ? 0 : nextIndex;
61766 nextRegion = regions[nextIndex];
61767 }
61768 nextRegion.focus();
61769 setIsFocusingRegions(true);
61770 }
61771 const clickRef = (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
61772 function onClick() {
61773 setIsFocusingRegions(false);
61774 }
61775 element.addEventListener("click", onClick);
61776 return () => {
61777 element.removeEventListener("click", onClick);
61778 };
61779 }, [setIsFocusingRegions]);
61780 return {
61781 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, clickRef]),
61782 className: isFocusingRegions ? "is-focusing-regions" : "",
61783 onKeyDown(event) {
61784 if (shortcuts.previous.some(({
61785 modifier,
61786 character
61787 }) => {
61788 return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character);
61789 })) {
61790 focusRegion(-1);
61791 } else if (shortcuts.next.some(({
61792 modifier,
61793 character
61794 }) => {
61795 return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character);
61796 })) {
61797 focusRegion(1);
61798 }
61799 }
61800 };
61801}
61802var navigate_regions_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((Component) => ({
61803 shortcuts,
61804 ...props
61805}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
61806 ...useNavigateRegions(shortcuts),
61807 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
61808 ...props
61809 })
61810}), "navigateRegions");
61811
61812
61813;// ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
61814
61815
61816const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => function ComponentWithConstrainedTabbing(props) {
61817 const ref = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)();
61818 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
61819 ref,
61820 tabIndex: -1,
61821 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
61822 ...props
61823 })
61824 });
61825}, "withConstrainedTabbing");
61826var with_constrained_tabbing_default = withConstrainedTabbing;
61827
61828
61829;// ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js
61830
61831
61832
61833
61834var with_fallback_styles_default = (mapNodeToProps) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => {
61835 return class extends external_wp_element_namespaceObject.Component {
61836 constructor(props) {
61837 super(props);
61838 this.nodeRef = this.props.node;
61839 this.state = {
61840 fallbackStyles: void 0,
61841 grabStylesCompleted: false
61842 };
61843 this.bindRef = this.bindRef.bind(this);
61844 }
61845 bindRef(node) {
61846 if (!node) {
61847 return;
61848 }
61849 this.nodeRef = node;
61850 }
61851 componentDidMount() {
61852 this.grabFallbackStyles();
61853 }
61854 componentDidUpdate() {
61855 this.grabFallbackStyles();
61856 }
61857 grabFallbackStyles() {
61858 const {
61859 grabStylesCompleted,
61860 fallbackStyles
61861 } = this.state;
61862 if (this.nodeRef && !grabStylesCompleted) {
61863 const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);
61864 if (!es6_default()(newFallbackStyles, fallbackStyles)) {
61865 this.setState({
61866 fallbackStyles: newFallbackStyles,
61867 grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)
61868 });
61869 }
61870 }
61871 }
61872 render() {
61873 const wrappedComponent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
61874 ...this.props,
61875 ...this.state.fallbackStyles
61876 });
61877 return this.props.node ? wrappedComponent : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
61878 ref: this.bindRef,
61879 children: [" ", wrappedComponent, " "]
61880 });
61881 }
61882 };
61883}, "withFallbackStyles");
61884
61885
61886;// external ["wp","hooks"]
61887const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
61888;// ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js
61889
61890
61891
61892
61893const ANIMATION_FRAME_PERIOD = 16;
61894function withFilters(hookName) {
61895 return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
61896 const namespace = "core/with-filters/" + hookName;
61897 let FilteredComponent;
61898 function ensureFilteredComponent() {
61899 if (FilteredComponent === void 0) {
61900 FilteredComponent = (0,external_wp_hooks_namespaceObject.applyFilters)(hookName, OriginalComponent);
61901 }
61902 }
61903 class FilteredComponentRenderer extends external_wp_element_namespaceObject.Component {
61904 constructor(props) {
61905 super(props);
61906 ensureFilteredComponent();
61907 }
61908 componentDidMount() {
61909 FilteredComponentRenderer.instances.push(this);
61910 if (FilteredComponentRenderer.instances.length === 1) {
61911 (0,external_wp_hooks_namespaceObject.addAction)("hookRemoved", namespace, onHooksUpdated);
61912 (0,external_wp_hooks_namespaceObject.addAction)("hookAdded", namespace, onHooksUpdated);
61913 }
61914 }
61915 componentWillUnmount() {
61916 FilteredComponentRenderer.instances = FilteredComponentRenderer.instances.filter((instance) => instance !== this);
61917 if (FilteredComponentRenderer.instances.length === 0) {
61918 (0,external_wp_hooks_namespaceObject.removeAction)("hookRemoved", namespace);
61919 (0,external_wp_hooks_namespaceObject.removeAction)("hookAdded", namespace);
61920 }
61921 }
61922 render() {
61923 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FilteredComponent, {
61924 ...this.props
61925 });
61926 }
61927 }
61928 FilteredComponentRenderer.instances = [];
61929 const throttledForceUpdate = (0,external_wp_compose_namespaceObject.debounce)(() => {
61930 FilteredComponent = (0,external_wp_hooks_namespaceObject.applyFilters)(hookName, OriginalComponent);
61931 FilteredComponentRenderer.instances.forEach((instance) => {
61932 instance.forceUpdate();
61933 });
61934 }, ANIMATION_FRAME_PERIOD);
61935 function onHooksUpdated(updatedHookName) {
61936 if (updatedHookName === hookName) {
61937 throttledForceUpdate();
61938 }
61939 }
61940 return FilteredComponentRenderer;
61941 }, "withFilters");
61942}
61943
61944
61945;// ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
61946
61947
61948
61949
61950function isComponentLike(object) {
61951 return object instanceof external_wp_element_namespaceObject.Component || typeof object === "function";
61952}
61953var with_focus_return_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
61954 // @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types
61955 (options) => {
61956 const HoC = ({
61957 onFocusReturn
61958 } = {}) => (WrappedComponent) => {
61959 const WithFocusReturn = (props) => {
61960 const ref = (0,external_wp_compose_namespaceObject.useFocusReturn)(onFocusReturn);
61961 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
61962 ref,
61963 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
61964 ...props
61965 })
61966 });
61967 };
61968 return WithFocusReturn;
61969 };
61970 if (isComponentLike(options)) {
61971 const WrappedComponent = options;
61972 return HoC()(WrappedComponent);
61973 }
61974 return HoC(options);
61975 },
61976 "withFocusReturn"
61977);
61978const with_focus_return_Provider = ({
61979 children
61980}) => {
61981 external_wp_deprecated_default()("wp.components.FocusReturnProvider component", {
61982 since: "5.7",
61983 hint: "This provider is not used anymore. You can just remove it from your codebase"
61984 });
61985 return children;
61986};
61987
61988
61989;// ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js
61990
61991
61992
61993
61994
61995var with_notices_default = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
61996 function Component(props, ref) {
61997 const [noticeList, setNoticeList] = (0,external_wp_element_namespaceObject.useState)([]);
61998 const noticeOperations = (0,external_wp_element_namespaceObject.useMemo)(() => {
61999 const createNotice = (notice) => {
62000 const noticeToAdd = notice.id ? notice : {
62001 ...notice,
62002 id: esm_browser_v4()
62003 };
62004 setNoticeList((current) => [...current, noticeToAdd]);
62005 };
62006 return {
62007 createNotice,
62008 createErrorNotice: (msg) => {
62009 createNotice({
62010 status: "error",
62011 content: msg
62012 });
62013 },
62014 removeNotice: (id) => {
62015 setNoticeList((current) => current.filter((notice) => notice.id !== id));
62016 },
62017 removeAllNotices: () => {
62018 setNoticeList([]);
62019 }
62020 };
62021 }, []);
62022 const propsOut = {
62023 ...props,
62024 noticeList,
62025 noticeOperations,
62026 noticeUI: noticeList.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(list_default, {
62027 className: "components-with-notices-ui",
62028 notices: noticeList,
62029 onRemove: noticeOperations.removeNotice
62030 })
62031 };
62032 return isForwardRef ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
62033 ...propsOut,
62034 ref
62035 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
62036 ...propsOut
62037 });
62038 }
62039 let isForwardRef;
62040 const {
62041 render
62042 } = OriginalComponent;
62043 if (typeof render === "function") {
62044 isForwardRef = true;
62045 return (0,external_wp_element_namespaceObject.forwardRef)(Component);
62046 }
62047 return Component;
62048}, "withNotices");
62049
62050
62051;// ./node_modules/@ariakit/react-core/esm/__chunks/B2J376ND.js
62052"use client";
62053
62054
62055
62056
62057
62058// src/menu/menu-context.tsx
62059
62060var menu = createStoreContext(
62061 [CompositeContextProvider, HovercardContextProvider],
62062 [CompositeScopedContextProvider, HovercardScopedContextProvider]
62063);
62064var useMenuContext = menu.useContext;
62065var useMenuScopedContext = menu.useScopedContext;
62066var useMenuProviderContext = menu.useProviderContext;
62067var MenuContextProvider = menu.ContextProvider;
62068var MenuScopedContextProvider = menu.ScopedContextProvider;
62069var useMenuBarContext = (/* unused pure expression or super */ null && (useMenubarContext));
62070var useMenuBarScopedContext = (/* unused pure expression or super */ null && (useMenubarScopedContext));
62071var useMenuBarProviderContext = (/* unused pure expression or super */ null && (useMenubarProviderContext));
62072var MenuBarContextProvider = (/* unused pure expression or super */ null && (MenubarContextProvider));
62073var MenuBarScopedContextProvider = (/* unused pure expression or super */ null && (MenubarScopedContextProvider));
62074var MenuItemCheckedContext = (0,external_React_.createContext)(
62075 void 0
62076);
62077
62078
62079
62080;// ./node_modules/@ariakit/react-core/esm/__chunks/62UHHO2X.js
62081"use client";
62082
62083
62084
62085// src/menubar/menubar-context.tsx
62086
62087var menubar = createStoreContext(
62088 [CompositeContextProvider],
62089 [CompositeScopedContextProvider]
62090);
62091var _62UHHO2X_useMenubarContext = menubar.useContext;
62092var _62UHHO2X_useMenubarScopedContext = menubar.useScopedContext;
62093var _62UHHO2X_useMenubarProviderContext = menubar.useProviderContext;
62094var _62UHHO2X_MenubarContextProvider = menubar.ContextProvider;
62095var _62UHHO2X_MenubarScopedContextProvider = menubar.ScopedContextProvider;
62096var _62UHHO2X_MenuItemCheckedContext = (0,external_React_.createContext)(
62097 void 0
62098);
62099
62100
62101
62102;// ./node_modules/@ariakit/core/esm/menu/menu-store.js
62103"use client";
62104
62105
62106
62107
62108
62109
62110
62111
62112
62113
62114
62115
62116// src/menu/menu-store.ts
62117function createMenuStore(_a = {}) {
62118 var _b = _a, {
62119 combobox,
62120 parent,
62121 menubar
62122 } = _b, props = _3YLGPPWQ_objRest(_b, [
62123 "combobox",
62124 "parent",
62125 "menubar"
62126 ]);
62127 const parentIsMenubar = !!menubar && !parent;
62128 const store = mergeStore(
62129 props.store,
62130 pick2(parent, ["values"]),
62131 omit2(combobox, [
62132 "arrowElement",
62133 "anchorElement",
62134 "contentElement",
62135 "popoverElement",
62136 "disclosureElement"
62137 ])
62138 );
62139 throwOnConflictingProps(props, store);
62140 const syncState = store.getState();
62141 const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
62142 store,
62143 orientation: defaultValue(
62144 props.orientation,
62145 syncState.orientation,
62146 "vertical"
62147 )
62148 }));
62149 const hovercard = createHovercardStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), {
62150 store,
62151 placement: defaultValue(
62152 props.placement,
62153 syncState.placement,
62154 "bottom-start"
62155 ),
62156 timeout: defaultValue(
62157 props.timeout,
62158 syncState.timeout,
62159 parentIsMenubar ? 0 : 150
62160 ),
62161 hideTimeout: defaultValue(props.hideTimeout, syncState.hideTimeout, 0)
62162 }));
62163 const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), hovercard.getState()), {
62164 initialFocus: defaultValue(syncState.initialFocus, "container"),
62165 values: defaultValue(
62166 props.values,
62167 syncState.values,
62168 props.defaultValues,
62169 {}
62170 )
62171 });
62172 const menu = createStore(initialState, composite, hovercard, store);
62173 setup(
62174 menu,
62175 () => sync(menu, ["mounted"], (state) => {
62176 if (state.mounted) return;
62177 menu.setState("activeId", null);
62178 })
62179 );
62180 setup(
62181 menu,
62182 () => sync(parent, ["orientation"], (state) => {
62183 menu.setState(
62184 "placement",
62185 state.orientation === "vertical" ? "right-start" : "bottom-start"
62186 );
62187 })
62188 );
62189 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite), hovercard), menu), {
62190 combobox,
62191 parent,
62192 menubar,
62193 hideAll: () => {
62194 hovercard.hide();
62195 parent == null ? void 0 : parent.hideAll();
62196 },
62197 setInitialFocus: (value) => menu.setState("initialFocus", value),
62198 setValues: (values) => menu.setState("values", values),
62199 setValue: (name, value) => {
62200 if (name === "__proto__") return;
62201 if (name === "constructor") return;
62202 if (Array.isArray(name)) return;
62203 menu.setState("values", (values) => {
62204 const prevValue = values[name];
62205 const nextValue = applyState(value, prevValue);
62206 if (nextValue === prevValue) return values;
62207 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, values), {
62208 [name]: nextValue !== void 0 && nextValue
62209 });
62210 });
62211 }
62212 });
62213}
62214
62215
62216;// ./node_modules/@ariakit/react-core/esm/__chunks/MRTXKBQF.js
62217"use client";
62218
62219
62220
62221
62222
62223
62224
62225
62226
62227// src/menu/menu-store.ts
62228
62229function useMenuStoreProps(store, update, props) {
62230 useUpdateEffect(update, [props.combobox, props.parent, props.menubar]);
62231 useStoreProps(store, props, "values", "setValues");
62232 return Object.assign(
62233 useHovercardStoreProps(
62234 useCompositeStoreProps(store, update, props),
62235 update,
62236 props
62237 ),
62238 {
62239 combobox: props.combobox,
62240 parent: props.parent,
62241 menubar: props.menubar
62242 }
62243 );
62244}
62245function useMenuStore(props = {}) {
62246 const parent = useMenuContext();
62247 const menubar = _62UHHO2X_useMenubarContext();
62248 const combobox = useComboboxProviderContext();
62249 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
62250 parent: props.parent !== void 0 ? props.parent : parent,
62251 menubar: props.menubar !== void 0 ? props.menubar : menubar,
62252 combobox: props.combobox !== void 0 ? props.combobox : combobox
62253 });
62254 const [store, update] = YV4JVR4I_useStore(createMenuStore, props);
62255 return useMenuStoreProps(store, update, props);
62256}
62257
62258
62259
62260;// ./node_modules/@wordpress/components/build-module/menu/context.js
62261
62262const context_Context = (0,external_wp_element_namespaceObject.createContext)(void 0);
62263context_Context.displayName = "MenuContext";
62264
62265
62266;// ./node_modules/@ariakit/react-core/esm/__chunks/MVIULMNR.js
62267"use client";
62268
62269
62270
62271
62272
62273
62274
62275
62276
62277// src/menu/menu-item.tsx
62278
62279
62280
62281
62282var MVIULMNR_TagName = "div";
62283function menuHasFocus(baseElement, items, currentTarget) {
62284 var _a;
62285 if (!baseElement) return false;
62286 if (hasFocusWithin(baseElement)) return true;
62287 const expandedItem = items == null ? void 0 : items.find((item) => {
62288 var _a2;
62289 if (item.element === currentTarget) return false;
62290 return ((_a2 = item.element) == null ? void 0 : _a2.getAttribute("aria-expanded")) === "true";
62291 });
62292 const expandedMenuId = (_a = expandedItem == null ? void 0 : expandedItem.element) == null ? void 0 : _a.getAttribute("aria-controls");
62293 if (!expandedMenuId) return false;
62294 const doc = getDocument(baseElement);
62295 const expandedMenu = doc.getElementById(expandedMenuId);
62296 if (!expandedMenu) return false;
62297 if (hasFocusWithin(expandedMenu)) return true;
62298 return !!expandedMenu.querySelector("[role=menuitem][aria-expanded=true]");
62299}
62300var useMenuItem = createHook(
62301 function useMenuItem2(_a) {
62302 var _b = _a, {
62303 store,
62304 hideOnClick = true,
62305 preventScrollOnKeyDown = true,
62306 focusOnHover,
62307 blurOnHoverEnd
62308 } = _b, props = __objRest(_b, [
62309 "store",
62310 "hideOnClick",
62311 "preventScrollOnKeyDown",
62312 "focusOnHover",
62313 "blurOnHoverEnd"
62314 ]);
62315 const menuContext = useMenuScopedContext(true);
62316 const menubarContext = _62UHHO2X_useMenubarScopedContext();
62317 store = store || menuContext || menubarContext;
62318 invariant(
62319 store,
62320 false && 0
62321 );
62322 const onClickProp = props.onClick;
62323 const hideOnClickProp = useBooleanEvent(hideOnClick);
62324 const hideMenu = "hideAll" in store ? store.hideAll : void 0;
62325 const isWithinMenu = !!hideMenu;
62326 const onClick = useEvent((event) => {
62327 onClickProp == null ? void 0 : onClickProp(event);
62328 if (event.defaultPrevented) return;
62329 if (isDownloading(event)) return;
62330 if (isOpeningInNewTab(event)) return;
62331 if (!hideMenu) return;
62332 const popupType = event.currentTarget.getAttribute("aria-haspopup");
62333 if (popupType === "menu") return;
62334 if (!hideOnClickProp(event)) return;
62335 hideMenu();
62336 });
62337 const contentElement = useStoreState(
62338 store,
62339 (state) => "contentElement" in state ? state.contentElement : null
62340 );
62341 const role = getPopupItemRole(contentElement, "menuitem");
62342 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
62343 role
62344 }, props), {
62345 onClick
62346 });
62347 props = useCompositeItem(_3YLGPPWQ_spreadValues({
62348 store,
62349 preventScrollOnKeyDown
62350 }, props));
62351 props = useCompositeHover(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
62352 store
62353 }, props), {
62354 focusOnHover(event) {
62355 const getFocusOnHover = () => {
62356 if (typeof focusOnHover === "function") return focusOnHover(event);
62357 if (focusOnHover != null) return focusOnHover;
62358 return true;
62359 };
62360 if (!store) return false;
62361 if (!getFocusOnHover()) return false;
62362 const { baseElement, items } = store.getState();
62363 if (isWithinMenu) {
62364 if (event.currentTarget.hasAttribute("aria-expanded")) {
62365 event.currentTarget.focus();
62366 }
62367 return true;
62368 }
62369 if (menuHasFocus(baseElement, items, event.currentTarget)) {
62370 event.currentTarget.focus();
62371 return true;
62372 }
62373 return false;
62374 },
62375 blurOnHoverEnd(event) {
62376 if (typeof blurOnHoverEnd === "function") return blurOnHoverEnd(event);
62377 if (blurOnHoverEnd != null) return blurOnHoverEnd;
62378 return isWithinMenu;
62379 }
62380 }));
62381 return props;
62382 }
62383);
62384var MVIULMNR_MenuItem = memo2(
62385 forwardRef2(function MenuItem2(props) {
62386 const htmlProps = useMenuItem(props);
62387 return LMDWO4NN_createElement(MVIULMNR_TagName, htmlProps);
62388 })
62389);
62390
62391
62392
62393;// ./node_modules/@ariakit/react-core/esm/__chunks/RNCDFVMF.js
62394"use client";
62395
62396
62397// src/checkbox/checkbox-context.tsx
62398var RNCDFVMF_ctx = createStoreContext();
62399var useCheckboxContext = RNCDFVMF_ctx.useContext;
62400var useCheckboxScopedContext = RNCDFVMF_ctx.useScopedContext;
62401var useCheckboxProviderContext = RNCDFVMF_ctx.useProviderContext;
62402var CheckboxContextProvider = RNCDFVMF_ctx.ContextProvider;
62403var CheckboxScopedContextProvider = RNCDFVMF_ctx.ScopedContextProvider;
62404
62405
62406
62407;// ./node_modules/@ariakit/react-core/esm/__chunks/ASMQKSDT.js
62408"use client";
62409
62410
62411
62412
62413
62414
62415
62416
62417// src/checkbox/checkbox.tsx
62418
62419
62420
62421var ASMQKSDT_TagName = "input";
62422function setMixed(element, mixed) {
62423 if (mixed) {
62424 element.indeterminate = true;
62425 } else if (element.indeterminate) {
62426 element.indeterminate = false;
62427 }
62428}
62429function isNativeCheckbox(tagName, type) {
62430 return tagName === "input" && (!type || type === "checkbox");
62431}
62432function getPrimitiveValue(value) {
62433 if (Array.isArray(value)) {
62434 return value.toString();
62435 }
62436 return value;
62437}
62438var useCheckbox = createHook(
62439 function useCheckbox2(_a) {
62440 var _b = _a, {
62441 store,
62442 name,
62443 value: valueProp,
62444 checked: checkedProp,
62445 defaultChecked
62446 } = _b, props = __objRest(_b, [
62447 "store",
62448 "name",
62449 "value",
62450 "checked",
62451 "defaultChecked"
62452 ]);
62453 const context = useCheckboxContext();
62454 store = store || context;
62455 const [_checked, setChecked] = (0,external_React_.useState)(defaultChecked != null ? defaultChecked : false);
62456 const checked = useStoreState(store, (state) => {
62457 if (checkedProp !== void 0) return checkedProp;
62458 if ((state == null ? void 0 : state.value) === void 0) return _checked;
62459 if (valueProp != null) {
62460 if (Array.isArray(state.value)) {
62461 const primitiveValue = getPrimitiveValue(valueProp);
62462 return state.value.includes(primitiveValue);
62463 }
62464 return state.value === valueProp;
62465 }
62466 if (Array.isArray(state.value)) return false;
62467 if (typeof state.value === "boolean") return state.value;
62468 return false;
62469 });
62470 const ref = (0,external_React_.useRef)(null);
62471 const tagName = useTagName(ref, ASMQKSDT_TagName);
62472 const nativeCheckbox = isNativeCheckbox(tagName, props.type);
62473 const mixed = checked ? checked === "mixed" : void 0;
62474 const isChecked = checked === "mixed" ? false : checked;
62475 const disabled = disabledFromProps(props);
62476 const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate();
62477 (0,external_React_.useEffect)(() => {
62478 const element = ref.current;
62479 if (!element) return;
62480 setMixed(element, mixed);
62481 if (nativeCheckbox) return;
62482 element.checked = isChecked;
62483 if (name !== void 0) {
62484 element.name = name;
62485 }
62486 if (valueProp !== void 0) {
62487 element.value = `${valueProp}`;
62488 }
62489 }, [propertyUpdated, mixed, nativeCheckbox, isChecked, name, valueProp]);
62490 const onChangeProp = props.onChange;
62491 const onChange = useEvent((event) => {
62492 if (disabled) {
62493 event.stopPropagation();
62494 event.preventDefault();
62495 return;
62496 }
62497 setMixed(event.currentTarget, mixed);
62498 if (!nativeCheckbox) {
62499 event.currentTarget.checked = !event.currentTarget.checked;
62500 schedulePropertyUpdate();
62501 }
62502 onChangeProp == null ? void 0 : onChangeProp(event);
62503 if (event.defaultPrevented) return;
62504 const elementChecked = event.currentTarget.checked;
62505 setChecked(elementChecked);
62506 store == null ? void 0 : store.setValue((prevValue) => {
62507 if (valueProp == null) return elementChecked;
62508 const primitiveValue = getPrimitiveValue(valueProp);
62509 if (!Array.isArray(prevValue)) {
62510 return prevValue === primitiveValue ? false : primitiveValue;
62511 }
62512 if (elementChecked) {
62513 if (prevValue.includes(primitiveValue)) {
62514 return prevValue;
62515 }
62516 return [...prevValue, primitiveValue];
62517 }
62518 return prevValue.filter((v) => v !== primitiveValue);
62519 });
62520 });
62521 const onClickProp = props.onClick;
62522 const onClick = useEvent((event) => {
62523 onClickProp == null ? void 0 : onClickProp(event);
62524 if (event.defaultPrevented) return;
62525 if (nativeCheckbox) return;
62526 onChange(event);
62527 });
62528 props = useWrapElement(
62529 props,
62530 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CheckboxCheckedContext.Provider, { value: isChecked, children: element }),
62531 [isChecked]
62532 );
62533 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
62534 role: !nativeCheckbox ? "checkbox" : void 0,
62535 type: nativeCheckbox ? "checkbox" : void 0,
62536 "aria-checked": checked
62537 }, props), {
62538 ref: useMergeRefs(ref, props.ref),
62539 onChange,
62540 onClick
62541 });
62542 props = useCommand(_3YLGPPWQ_spreadValues({ clickOnEnter: !nativeCheckbox }, props));
62543 return removeUndefinedValues(_3YLGPPWQ_spreadValues({
62544 name: nativeCheckbox ? name : void 0,
62545 value: nativeCheckbox ? valueProp : void 0,
62546 checked: isChecked
62547 }, props));
62548 }
62549);
62550var Checkbox = forwardRef2(function Checkbox2(props) {
62551 const htmlProps = useCheckbox(props);
62552 return LMDWO4NN_createElement(ASMQKSDT_TagName, htmlProps);
62553});
62554
62555
62556
62557;// ./node_modules/@ariakit/core/esm/checkbox/checkbox-store.js
62558"use client";
62559
62560
62561
62562
62563// src/checkbox/checkbox-store.ts
62564function createCheckboxStore(props = {}) {
62565 var _a;
62566 throwOnConflictingProps(props, props.store);
62567 const syncState = (_a = props.store) == null ? void 0 : _a.getState();
62568 const initialState = {
62569 value: defaultValue(
62570 props.value,
62571 syncState == null ? void 0 : syncState.value,
62572 props.defaultValue,
62573 false
62574 )
62575 };
62576 const checkbox = createStore(initialState, props.store);
62577 return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, checkbox), {
62578 setValue: (value) => checkbox.setState("value", value)
62579 });
62580}
62581
62582
62583;// ./node_modules/@ariakit/react-core/esm/__chunks/HAVBGUA3.js
62584"use client";
62585
62586
62587
62588// src/checkbox/checkbox-store.ts
62589
62590function useCheckboxStoreProps(store, update, props) {
62591 useUpdateEffect(update, [props.store]);
62592 useStoreProps(store, props, "value", "setValue");
62593 return store;
62594}
62595function useCheckboxStore(props = {}) {
62596 const [store, update] = YV4JVR4I_useStore(createCheckboxStore, props);
62597 return useCheckboxStoreProps(store, update, props);
62598}
62599
62600
62601
62602;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-checkbox.js
62603"use client";
62604
62605
62606
62607
62608
62609
62610
62611
62612
62613
62614
62615
62616
62617
62618
62619
62620
62621
62622
62623
62624
62625
62626
62627
62628
62629
62630// src/menu/menu-item-checkbox.tsx
62631
62632
62633var menu_item_checkbox_TagName = "div";
62634function menu_item_checkbox_getPrimitiveValue(value) {
62635 if (Array.isArray(value)) {
62636 return value.toString();
62637 }
62638 return value;
62639}
62640function getValue(storeValue, value, checked) {
62641 if (value === void 0) {
62642 if (Array.isArray(storeValue)) return storeValue;
62643 return !!checked;
62644 }
62645 const primitiveValue = menu_item_checkbox_getPrimitiveValue(value);
62646 if (!Array.isArray(storeValue)) {
62647 if (checked) {
62648 return primitiveValue;
62649 }
62650 return storeValue === primitiveValue ? false : storeValue;
62651 }
62652 if (checked) {
62653 if (storeValue.includes(primitiveValue)) {
62654 return storeValue;
62655 }
62656 return [...storeValue, primitiveValue];
62657 }
62658 return storeValue.filter((v) => v !== primitiveValue);
62659}
62660var useMenuItemCheckbox = createHook(
62661 function useMenuItemCheckbox2(_a) {
62662 var _b = _a, {
62663 store,
62664 name,
62665 value,
62666 checked,
62667 defaultChecked: defaultCheckedProp,
62668 hideOnClick = false
62669 } = _b, props = __objRest(_b, [
62670 "store",
62671 "name",
62672 "value",
62673 "checked",
62674 "defaultChecked",
62675 "hideOnClick"
62676 ]);
62677 const context = useMenuScopedContext();
62678 store = store || context;
62679 invariant(
62680 store,
62681 false && 0
62682 );
62683 const defaultChecked = useInitialValue(defaultCheckedProp);
62684 (0,external_React_.useEffect)(() => {
62685 store == null ? void 0 : store.setValue(name, (prevValue = []) => {
62686 if (!defaultChecked) return prevValue;
62687 return getValue(prevValue, value, true);
62688 });
62689 }, [store, name, value, defaultChecked]);
62690 (0,external_React_.useEffect)(() => {
62691 if (checked === void 0) return;
62692 store == null ? void 0 : store.setValue(name, (prevValue) => {
62693 return getValue(prevValue, value, checked);
62694 });
62695 }, [store, name, value, checked]);
62696 const checkboxStore = useCheckboxStore({
62697 value: store.useState((state) => state.values[name]),
62698 setValue(internalValue) {
62699 store == null ? void 0 : store.setValue(name, () => {
62700 if (checked === void 0) return internalValue;
62701 const nextValue = getValue(internalValue, value, checked);
62702 if (!Array.isArray(nextValue)) return nextValue;
62703 if (!Array.isArray(internalValue)) return nextValue;
62704 if (shallowEqual(internalValue, nextValue)) return internalValue;
62705 return nextValue;
62706 });
62707 }
62708 });
62709 props = _3YLGPPWQ_spreadValues({
62710 role: "menuitemcheckbox"
62711 }, props);
62712 props = useCheckbox(_3YLGPPWQ_spreadValues({
62713 store: checkboxStore,
62714 name,
62715 value,
62716 checked
62717 }, props));
62718 props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props));
62719 return props;
62720 }
62721);
62722var MenuItemCheckbox = memo2(
62723 forwardRef2(function MenuItemCheckbox2(props) {
62724 const htmlProps = useMenuItemCheckbox(props);
62725 return LMDWO4NN_createElement(menu_item_checkbox_TagName, htmlProps);
62726 })
62727);
62728
62729
62730;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-radio.js
62731"use client";
62732
62733
62734
62735
62736
62737
62738
62739
62740
62741
62742
62743
62744
62745
62746
62747
62748
62749
62750
62751
62752
62753
62754
62755
62756// src/menu/menu-item-radio.tsx
62757
62758
62759
62760var menu_item_radio_TagName = "div";
62761function menu_item_radio_getValue(prevValue, value, checked) {
62762 if (checked === void 0) return prevValue;
62763 if (checked) return value;
62764 return prevValue;
62765}
62766var useMenuItemRadio = createHook(
62767 function useMenuItemRadio2(_a) {
62768 var _b = _a, {
62769 store,
62770 name,
62771 value,
62772 checked,
62773 onChange: onChangeProp,
62774 hideOnClick = false
62775 } = _b, props = __objRest(_b, [
62776 "store",
62777 "name",
62778 "value",
62779 "checked",
62780 "onChange",
62781 "hideOnClick"
62782 ]);
62783 const context = useMenuScopedContext();
62784 store = store || context;
62785 invariant(
62786 store,
62787 false && 0
62788 );
62789 const defaultChecked = useInitialValue(props.defaultChecked);
62790 (0,external_React_.useEffect)(() => {
62791 store == null ? void 0 : store.setValue(name, (prevValue = false) => {
62792 return menu_item_radio_getValue(prevValue, value, defaultChecked);
62793 });
62794 }, [store, name, value, defaultChecked]);
62795 (0,external_React_.useEffect)(() => {
62796 if (checked === void 0) return;
62797 store == null ? void 0 : store.setValue(name, (prevValue) => {
62798 return menu_item_radio_getValue(prevValue, value, checked);
62799 });
62800 }, [store, name, value, checked]);
62801 const isChecked = store.useState((state) => state.values[name] === value);
62802 props = useWrapElement(
62803 props,
62804 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheckedContext.Provider, { value: !!isChecked, children: element }),
62805 [isChecked]
62806 );
62807 props = _3YLGPPWQ_spreadValues({
62808 role: "menuitemradio"
62809 }, props);
62810 props = useRadio(_3YLGPPWQ_spreadValues({
62811 name,
62812 value,
62813 checked: isChecked,
62814 onChange(event) {
62815 onChangeProp == null ? void 0 : onChangeProp(event);
62816 if (event.defaultPrevented) return;
62817 const element = event.currentTarget;
62818 store == null ? void 0 : store.setValue(name, (prevValue) => {
62819 return menu_item_radio_getValue(prevValue, value, checked != null ? checked : element.checked);
62820 });
62821 }
62822 }, props));
62823 props = useMenuItem(_3YLGPPWQ_spreadValues({ store, hideOnClick }, props));
62824 return props;
62825 }
62826);
62827var MenuItemRadio = memo2(
62828 forwardRef2(function MenuItemRadio2(props) {
62829 const htmlProps = useMenuItemRadio(props);
62830 return LMDWO4NN_createElement(menu_item_radio_TagName, htmlProps);
62831 })
62832);
62833
62834
62835;// ./node_modules/@ariakit/react-core/esm/menu/menu-group.js
62836"use client";
62837
62838
62839
62840
62841
62842
62843
62844
62845// src/menu/menu-group.tsx
62846var menu_group_TagName = "div";
62847var useMenuGroup = createHook(
62848 function useMenuGroup2(props) {
62849 props = useCompositeGroup(props);
62850 return props;
62851 }
62852);
62853var menu_group_MenuGroup = forwardRef2(function MenuGroup2(props) {
62854 const htmlProps = useMenuGroup(props);
62855 return LMDWO4NN_createElement(menu_group_TagName, htmlProps);
62856});
62857
62858
62859;// ./node_modules/@ariakit/react-core/esm/menu/menu-group-label.js
62860"use client";
62861
62862
62863
62864
62865
62866
62867
62868
62869// src/menu/menu-group-label.tsx
62870var menu_group_label_TagName = "div";
62871var useMenuGroupLabel = createHook(
62872 function useMenuGroupLabel2(props) {
62873 props = useCompositeGroupLabel(props);
62874 return props;
62875 }
62876);
62877var MenuGroupLabel = forwardRef2(function MenuGroupLabel2(props) {
62878 const htmlProps = useMenuGroupLabel(props);
62879 return LMDWO4NN_createElement(menu_group_label_TagName, htmlProps);
62880});
62881
62882
62883;// ./node_modules/@ariakit/react-core/esm/__chunks/TP7N7UIH.js
62884"use client";
62885
62886
62887
62888
62889
62890// src/composite/composite-separator.tsx
62891
62892var TP7N7UIH_TagName = "hr";
62893var useCompositeSeparator = createHook(function useCompositeSeparator2(_a) {
62894 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
62895 const context = useCompositeContext();
62896 store = store || context;
62897 invariant(
62898 store,
62899 false && 0
62900 );
62901 const orientation = store.useState(
62902 (state) => state.orientation === "horizontal" ? "vertical" : "horizontal"
62903 );
62904 props = useSeparator(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { orientation }));
62905 return props;
62906});
62907var CompositeSeparator = forwardRef2(function CompositeSeparator2(props) {
62908 const htmlProps = useCompositeSeparator(props);
62909 return LMDWO4NN_createElement(TP7N7UIH_TagName, htmlProps);
62910});
62911
62912
62913
62914;// ./node_modules/@ariakit/react-core/esm/menu/menu-separator.js
62915"use client";
62916
62917
62918
62919
62920
62921
62922
62923
62924
62925
62926
62927
62928
62929
62930
62931// src/menu/menu-separator.tsx
62932var menu_separator_TagName = "hr";
62933var useMenuSeparator = createHook(
62934 function useMenuSeparator2(_a) {
62935 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
62936 const context = useMenuContext();
62937 store = store || context;
62938 props = useCompositeSeparator(_3YLGPPWQ_spreadValues({ store }, props));
62939 return props;
62940 }
62941);
62942var MenuSeparator = forwardRef2(function MenuSeparator2(props) {
62943 const htmlProps = useMenuSeparator(props);
62944 return LMDWO4NN_createElement(menu_separator_TagName, htmlProps);
62945});
62946
62947
62948;// ./node_modules/@wordpress/components/build-module/menu/styles.js
62949
62950function menu_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
62951 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
62952}
62953
62954
62955
62956
62957
62958
62959const styles_ANIMATION_PARAMS = {
62960 SCALE_AMOUNT_OUTER: 0.82,
62961 SCALE_AMOUNT_CONTENT: 0.9,
62962 DURATION: {
62963 IN: "400ms",
62964 OUT: "200ms"
62965 },
62966 EASING: "cubic-bezier(0.33, 0, 0, 1)"
62967};
62968const CONTENT_WRAPPER_PADDING = space(1);
62969const ITEM_PADDING_BLOCK = space(2);
62970const ITEM_PADDING_INLINE = space(3);
62971const DEFAULT_BORDER_COLOR = COLORS.theme.gray[300];
62972const DIVIDER_COLOR = COLORS.theme.gray[200];
62973const LIGHTER_TEXT_COLOR = COLORS.theme.gray[700];
62974const LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[100];
62975const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;
62976const DEFAULT_BOX_SHADOW = `0 0 0 ${config_values_default.borderWidth} ${DEFAULT_BORDER_COLOR}, ${config_values_default.elevationMedium}`;
62977const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${config_values_default.borderWidth} ${TOOLBAR_VARIANT_BORDER_COLOR}`;
62978const GRID_TEMPLATE_COLS = "minmax( 0, max-content ) 1fr";
62979const PopoverOuterWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
62980 target: "e1wg7tti14"
62981} : 0)("position:relative;background-color:", COLORS.ui.background, ";border-radius:", config_values_default.radiusMedium, ";", (props) => /* @__PURE__ */ emotion_react_browser_esm_css("box-shadow:", props.variant === "toolbar" ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";" + ( true ? "" : 0), true ? "" : 0), " overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:", styles_ANIMATION_PARAMS.EASING, ";transition-duration:", styles_ANIMATION_PARAMS.DURATION.IN, ";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:", styles_ANIMATION_PARAMS.DURATION.OUT, ";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}" + ( true ? "" : 0));
62982const PopoverInnerWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
62983 target: "e1wg7tti13"
62984} : 0)("position:relative;z-index:1000000;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:", CONTENT_WRAPPER_PADDING, ";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n calc(\n 1 / ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_OUTER, " *\n ", styles_ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT, "\n )\n );}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}" + ( true ? "" : 0));
62985const baseItem = /* @__PURE__ */ emotion_react_browser_esm_css("all:unset;position:relative;min-height:", space(10), ";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:", font("default.fontSize"), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.theme.foreground, ";border-radius:", config_values_default.radiusSmall, ";padding-block:", ITEM_PADDING_BLOCK, ";padding-inline:", ITEM_PADDING_INLINE, ";scroll-margin:", CONTENT_WRAPPER_PADDING, ";user-select:none;outline:none;&[aria-disabled='true']{color:", COLORS.ui.textDisabled, ";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n [aria-disabled='true']\n ){background-color:", COLORS.theme.accent, ";color:", COLORS.theme.accentInverted, ";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ", COLORS.theme.accent, ";outline:2px solid transparent;}&:active,&[data-active]{}", PopoverInnerWrapper, ':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:', LIGHT_BACKGROUND_COLOR, ";color:", COLORS.theme.foreground, ";}svg{fill:currentColor;}" + ( true ? "" : 0), true ? "" : 0);
62986const styles_Item = /* @__PURE__ */ emotion_styled_base_browser_esm(MVIULMNR_MenuItem, true ? {
62987 target: "e1wg7tti12"
62988} : 0)(baseItem, ";" + ( true ? "" : 0));
62989const CheckboxItem = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuItemCheckbox, true ? {
62990 target: "e1wg7tti11"
62991} : 0)(baseItem, ";" + ( true ? "" : 0));
62992const RadioItem = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuItemRadio, true ? {
62993 target: "e1wg7tti10"
62994} : 0)(baseItem, ";" + ( true ? "" : 0));
62995const ItemPrefixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
62996 target: "e1wg7tti9"
62997} : 0)("grid-column:1;", CheckboxItem, ">&,", RadioItem, ">&{min-width:", space(6), ";}", CheckboxItem, ">&,", RadioItem, ">&,&:not( :empty ){margin-inline-end:", space(2), ";}display:flex;align-items:center;justify-content:center;color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}" + ( true ? "" : 0));
62998const ItemContentWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
62999 target: "e1wg7tti8"
63000} : 0)("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:", space(3), ";pointer-events:none;" + ( true ? "" : 0));
63001const ItemChildrenWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
63002 target: "e1wg7tti7"
63003} : 0)("flex:1;display:inline-flex;flex-direction:column;gap:", space(1), ";" + ( true ? "" : 0));
63004const ItemSuffixWrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
63005 target: "e1wg7tti6"
63006} : 0)("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:", space(3), ";color:", LIGHTER_TEXT_COLOR, ";[data-active-item]:not( [data-focus-visible] ) *:not(", PopoverInnerWrapper, ") &,[aria-disabled='true'] *:not(", PopoverInnerWrapper, ") &{color:inherit;}" + ( true ? "" : 0));
63007const styles_Group = /* @__PURE__ */ emotion_styled_base_browser_esm(menu_group_MenuGroup, true ? {
63008 target: "e1wg7tti5"
63009} : 0)( true ? {
63010 name: "49aokf",
63011 styles: "display:contents"
63012} : 0);
63013const styles_GroupLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuGroupLabel, true ? {
63014 target: "e1wg7tti4"
63015} : 0)("grid-column:1/-1;padding-block-start:", space(3), ";padding-block-end:", space(2), ";padding-inline:", ITEM_PADDING_INLINE, ";" + ( true ? "" : 0));
63016const styles_Separator = /* @__PURE__ */ emotion_styled_base_browser_esm(MenuSeparator, true ? {
63017 target: "e1wg7tti3"
63018} : 0)("grid-column:1/-1;border:none;height:", config_values_default.borderWidth, ";background-color:", (props) => props.variant === "toolbar" ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0));
63019const SubmenuChevronIcon = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
63020 target: "e1wg7tti2"
63021} : 0)("width:", space(1.5), ";", rtl({
63022 transform: `scaleX(1)`
63023}, {
63024 transform: `scaleX(-1)`
63025}), ";" + ( true ? "" : 0));
63026const ItemLabel = /* @__PURE__ */ emotion_styled_base_browser_esm(truncate_component_component_default, true ? {
63027 target: "e1wg7tti1"
63028} : 0)("font-size:", font("default.fontSize"), ";line-height:20px;color:inherit;" + ( true ? "" : 0));
63029const ItemHelpText = /* @__PURE__ */ emotion_styled_base_browser_esm(truncate_component_component_default, true ? {
63030 target: "e1wg7tti0"
63031} : 0)("font-size:", font("helpText.fontSize"), ";line-height:16px;color:", LIGHTER_TEXT_COLOR, ";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ", PopoverInnerWrapper, " ) &,[aria-disabled='true'] *:not( ", PopoverInnerWrapper, " ) &{color:inherit;}" + ( true ? "" : 0));
63032
63033
63034;// ./node_modules/@wordpress/components/build-module/menu/item.js
63035
63036
63037
63038
63039const item_Item = (0,external_wp_element_namespaceObject.forwardRef)(function Item2({
63040 prefix,
63041 suffix,
63042 children,
63043 disabled = false,
63044 hideOnClick = true,
63045 store,
63046 ...props
63047}, ref) {
63048 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63049 if (!menuContext?.store) {
63050 throw new Error("Menu.Item can only be rendered inside a Menu component");
63051 }
63052 const computedStore = store !== null && store !== void 0 ? store : menuContext.store;
63053 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Item, {
63054 ref,
63055 ...props,
63056 accessibleWhenDisabled: true,
63057 disabled,
63058 hideOnClick,
63059 store: computedStore,
63060 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {
63061 children: prefix
63062 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
63063 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
63064 children
63065 }), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
63066 children: suffix
63067 })]
63068 })]
63069 });
63070});
63071
63072
63073;// ./node_modules/@ariakit/react-core/esm/menu/menu-item-check.js
63074"use client";
63075
63076
63077
63078
63079
63080
63081
63082
63083
63084
63085
63086
63087
63088
63089
63090// src/menu/menu-item-check.tsx
63091
63092var menu_item_check_TagName = "span";
63093var useMenuItemCheck = createHook(
63094 function useMenuItemCheck2(_a) {
63095 var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]);
63096 const context = (0,external_React_.useContext)(MenuItemCheckedContext);
63097 checked = checked != null ? checked : context;
63098 props = useCheckboxCheck(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { checked }));
63099 return props;
63100 }
63101);
63102var MenuItemCheck = forwardRef2(function MenuItemCheck2(props) {
63103 const htmlProps = useMenuItemCheck(props);
63104 return LMDWO4NN_createElement(menu_item_check_TagName, htmlProps);
63105});
63106
63107
63108;// ./node_modules/@wordpress/components/build-module/menu/checkbox-item.js
63109
63110
63111
63112
63113
63114
63115const checkbox_item_CheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function CheckboxItem2({
63116 suffix,
63117 children,
63118 disabled = false,
63119 hideOnClick = false,
63120 ...props
63121}, ref) {
63122 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63123 if (!menuContext?.store) {
63124 throw new Error("Menu.CheckboxItem can only be rendered inside a Menu component");
63125 }
63126 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(CheckboxItem, {
63127 ref,
63128 ...props,
63129 accessibleWhenDisabled: true,
63130 disabled,
63131 hideOnClick,
63132 store: menuContext.store,
63133 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
63134 store: menuContext.store,
63135 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}),
63136 style: {
63137 width: "auto",
63138 height: "auto"
63139 },
63140 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
63141 icon: check_default,
63142 size: 24
63143 })
63144 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
63145 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
63146 children
63147 }), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
63148 children: suffix
63149 })]
63150 })]
63151 });
63152});
63153
63154
63155;// ./node_modules/@wordpress/components/build-module/menu/radio-item.js
63156
63157
63158
63159
63160
63161
63162
63163const radioCheck = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
63164 xmlns: "http://www.w3.org/2000/svg",
63165 viewBox: "0 0 24 24",
63166 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, {
63167 cx: 12,
63168 cy: 12,
63169 r: 3
63170 })
63171});
63172const radio_item_RadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function RadioItem2({
63173 suffix,
63174 children,
63175 disabled = false,
63176 hideOnClick = false,
63177 ...props
63178}, ref) {
63179 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63180 if (!menuContext?.store) {
63181 throw new Error("Menu.RadioItem can only be rendered inside a Menu component");
63182 }
63183 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(RadioItem, {
63184 ref,
63185 ...props,
63186 accessibleWhenDisabled: true,
63187 disabled,
63188 hideOnClick,
63189 store: menuContext.store,
63190 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemCheck, {
63191 store: menuContext.store,
63192 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemPrefixWrapper, {}),
63193 style: {
63194 width: "auto",
63195 height: "auto"
63196 },
63197 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon_icon_default, {
63198 icon: radioCheck,
63199 size: 24
63200 })
63201 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemContentWrapper, {
63202 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemChildrenWrapper, {
63203 children
63204 }), suffix && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSuffixWrapper, {
63205 children: suffix
63206 })]
63207 })]
63208 });
63209});
63210
63211
63212;// ./node_modules/@wordpress/components/build-module/menu/group.js
63213
63214
63215
63216
63217const group_Group = (0,external_wp_element_namespaceObject.forwardRef)(function Group2(props, ref) {
63218 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63219 if (!menuContext?.store) {
63220 throw new Error("Menu.Group can only be rendered inside a Menu component");
63221 }
63222 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Group, {
63223 ref,
63224 ...props,
63225 store: menuContext.store
63226 });
63227});
63228
63229
63230;// ./node_modules/@wordpress/components/build-module/menu/group-label.js
63231
63232
63233
63234
63235
63236const group_label_GroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function Group(props, ref) {
63237 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63238 if (!menuContext?.store) {
63239 throw new Error("Menu.GroupLabel can only be rendered inside a Menu component");
63240 }
63241 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_GroupLabel, {
63242 ref,
63243 render: (
63244 // @ts-expect-error The `children` prop is passed
63245 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_component_component_default, {
63246 upperCase: true,
63247 variant: "muted",
63248 size: "11px",
63249 weight: 500,
63250 lineHeight: "16px"
63251 })
63252 ),
63253 ...props,
63254 store: menuContext.store
63255 });
63256});
63257
63258
63259;// ./node_modules/@wordpress/components/build-module/menu/separator.js
63260
63261
63262
63263
63264const separator_Separator = (0,external_wp_element_namespaceObject.forwardRef)(function Separator2(props, ref) {
63265 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63266 if (!menuContext?.store) {
63267 throw new Error("Menu.Separator can only be rendered inside a Menu component");
63268 }
63269 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_Separator, {
63270 ref,
63271 ...props,
63272 store: menuContext.store,
63273 variant: menuContext.variant
63274 });
63275});
63276
63277
63278;// ./node_modules/@wordpress/components/build-module/menu/item-label.js
63279
63280
63281
63282
63283const item_label_ItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function ItemLabel2(props, ref) {
63284 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63285 if (!menuContext?.store) {
63286 throw new Error("Menu.ItemLabel can only be rendered inside a Menu component");
63287 }
63288 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemLabel, {
63289 numberOfLines: 1,
63290 ref,
63291 ...props
63292 });
63293});
63294
63295
63296;// ./node_modules/@wordpress/components/build-module/menu/item-help-text.js
63297
63298
63299
63300
63301const item_help_text_ItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function ItemHelpText2(props, ref) {
63302 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63303 if (!menuContext?.store) {
63304 throw new Error("Menu.ItemHelpText can only be rendered inside a Menu component");
63305 }
63306 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemHelpText, {
63307 numberOfLines: 2,
63308 ref,
63309 ...props
63310 });
63311});
63312
63313
63314;// ./node_modules/@ariakit/react-core/esm/menu/menu-button.js
63315"use client";
63316
63317
63318
63319
63320
63321
63322
63323
63324
63325
63326
63327
63328
63329
63330
63331
63332
63333
63334
63335
63336
63337
63338
63339
63340
63341
63342// src/menu/menu-button.tsx
63343
63344
63345
63346
63347var menu_button_TagName = "button";
63348function getInitialFocus(event, dir) {
63349 const keyMap = {
63350 ArrowDown: dir === "bottom" || dir === "top" ? "first" : false,
63351 ArrowUp: dir === "bottom" || dir === "top" ? "last" : false,
63352 ArrowRight: dir === "right" ? "first" : false,
63353 ArrowLeft: dir === "left" ? "first" : false
63354 };
63355 return keyMap[event.key];
63356}
63357function hasActiveItem(items, excludeElement) {
63358 return !!(items == null ? void 0 : items.some((item) => {
63359 if (!item.element) return false;
63360 if (item.element === excludeElement) return false;
63361 return item.element.getAttribute("aria-expanded") === "true";
63362 }));
63363}
63364var useMenuButton = createHook(
63365 function useMenuButton2(_a) {
63366 var _b = _a, {
63367 store,
63368 focusable,
63369 accessibleWhenDisabled,
63370 showOnHover
63371 } = _b, props = __objRest(_b, [
63372 "store",
63373 "focusable",
63374 "accessibleWhenDisabled",
63375 "showOnHover"
63376 ]);
63377 const context = useMenuProviderContext();
63378 store = store || context;
63379 invariant(
63380 store,
63381 false && 0
63382 );
63383 const ref = (0,external_React_.useRef)(null);
63384 const parentMenu = store.parent;
63385 const parentMenubar = store.menubar;
63386 const hasParentMenu = !!parentMenu;
63387 const parentIsMenubar = !!parentMenubar && !hasParentMenu;
63388 const disabled = disabledFromProps(props);
63389 const showMenu = () => {
63390 const trigger = ref.current;
63391 if (!trigger) return;
63392 store == null ? void 0 : store.setDisclosureElement(trigger);
63393 store == null ? void 0 : store.setAnchorElement(trigger);
63394 store == null ? void 0 : store.show();
63395 };
63396 const onFocusProp = props.onFocus;
63397 const onFocus = useEvent((event) => {
63398 onFocusProp == null ? void 0 : onFocusProp(event);
63399 if (disabled) return;
63400 if (event.defaultPrevented) return;
63401 store == null ? void 0 : store.setAutoFocusOnShow(false);
63402 store == null ? void 0 : store.setActiveId(null);
63403 if (!parentMenubar) return;
63404 if (!parentIsMenubar) return;
63405 const { items } = parentMenubar.getState();
63406 if (hasActiveItem(items, event.currentTarget)) {
63407 showMenu();
63408 }
63409 });
63410 const dir = useStoreState(
63411 store,
63412 (state) => state.placement.split("-")[0]
63413 );
63414 const onKeyDownProp = props.onKeyDown;
63415 const onKeyDown = useEvent((event) => {
63416 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
63417 if (disabled) return;
63418 if (event.defaultPrevented) return;
63419 const initialFocus = getInitialFocus(event, dir);
63420 if (initialFocus) {
63421 event.preventDefault();
63422 showMenu();
63423 store == null ? void 0 : store.setAutoFocusOnShow(true);
63424 store == null ? void 0 : store.setInitialFocus(initialFocus);
63425 }
63426 });
63427 const onClickProp = props.onClick;
63428 const onClick = useEvent((event) => {
63429 onClickProp == null ? void 0 : onClickProp(event);
63430 if (event.defaultPrevented) return;
63431 if (!store) return;
63432 const isKeyboardClick = !event.detail;
63433 const { open } = store.getState();
63434 if (!open || isKeyboardClick) {
63435 if (!hasParentMenu || isKeyboardClick) {
63436 store.setAutoFocusOnShow(true);
63437 }
63438 store.setInitialFocus(isKeyboardClick ? "first" : "container");
63439 }
63440 if (hasParentMenu) {
63441 showMenu();
63442 }
63443 });
63444 props = useWrapElement(
63445 props,
63446 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuContextProvider, { value: store, children: element }),
63447 [store]
63448 );
63449 if (hasParentMenu) {
63450 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
63451 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role.div, { render: props.render })
63452 });
63453 }
63454 const id = useId(props.id);
63455 const parentContentElement = useStoreState(
63456 (parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu,
63457 "contentElement"
63458 );
63459 const role = hasParentMenu || parentIsMenubar ? getPopupItemRole(parentContentElement, "menuitem") : void 0;
63460 const contentElement = store.useState("contentElement");
63461 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
63462 id,
63463 role,
63464 "aria-haspopup": getPopupRole(contentElement, "menu")
63465 }, props), {
63466 ref: useMergeRefs(ref, props.ref),
63467 onFocus,
63468 onKeyDown,
63469 onClick
63470 });
63471 props = useHovercardAnchor(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
63472 store,
63473 focusable,
63474 accessibleWhenDisabled
63475 }, props), {
63476 showOnHover: (event) => {
63477 const getShowOnHover = () => {
63478 if (typeof showOnHover === "function") return showOnHover(event);
63479 if (showOnHover != null) return showOnHover;
63480 if (hasParentMenu) return true;
63481 if (!parentMenubar) return false;
63482 const { items } = parentMenubar.getState();
63483 return parentIsMenubar && hasActiveItem(items);
63484 };
63485 const canShowOnHover = getShowOnHover();
63486 if (!canShowOnHover) return false;
63487 const parent = parentIsMenubar ? parentMenubar : parentMenu;
63488 if (!parent) return true;
63489 parent.setActiveId(event.currentTarget.id);
63490 return true;
63491 }
63492 }));
63493 props = usePopoverDisclosure(_3YLGPPWQ_spreadValues({
63494 store,
63495 toggleOnClick: !hasParentMenu,
63496 focusable,
63497 accessibleWhenDisabled
63498 }, props));
63499 props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({
63500 store,
63501 typeahead: parentIsMenubar
63502 }, props));
63503 return props;
63504 }
63505);
63506var MenuButton = forwardRef2(function MenuButton2(props) {
63507 const htmlProps = useMenuButton(props);
63508 return LMDWO4NN_createElement(menu_button_TagName, htmlProps);
63509});
63510
63511
63512;// ./node_modules/@wordpress/components/build-module/menu/trigger-button.js
63513
63514
63515
63516
63517const TriggerButton = (0,external_wp_element_namespaceObject.forwardRef)(function TriggerButton2({
63518 children,
63519 disabled = false,
63520 ...props
63521}, ref) {
63522 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63523 if (!menuContext?.store) {
63524 throw new Error("Menu.TriggerButton can only be rendered inside a Menu component");
63525 }
63526 if (menuContext.store.parent) {
63527 throw new Error("Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.");
63528 }
63529 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, {
63530 ref,
63531 ...props,
63532 disabled,
63533 store: menuContext.store,
63534 children
63535 });
63536});
63537
63538
63539;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
63540
63541
63542var chevron_right_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) });
63543
63544
63545;// ./node_modules/@wordpress/components/build-module/menu/submenu-trigger-item.js
63546
63547
63548
63549
63550
63551
63552
63553const SubmenuTriggerItem = (0,external_wp_element_namespaceObject.forwardRef)(function SubmenuTriggerItem2({
63554 suffix,
63555 ...otherProps
63556}, ref) {
63557 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63558 if (!menuContext?.store.parent) {
63559 throw new Error("Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component");
63560 }
63561 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuButton, {
63562 ref,
63563 accessibleWhenDisabled: true,
63564 store: menuContext.store,
63565 render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(item_Item, {
63566 ...otherProps,
63567 // The menu item needs to register and be part of the parent menu.
63568 // Without specifying the store explicitly, the `Item` component
63569 // would otherwise read the store via context and pick up the one from
63570 // the sub-menu `Menu` component.
63571 store: menuContext.store.parent,
63572 suffix: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
63573 children: [suffix, /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SubmenuChevronIcon, {
63574 "aria-hidden": "true",
63575 icon: chevron_right_small_default,
63576 size: 24,
63577 preserveAspectRatio: "xMidYMid slice"
63578 })]
63579 })
63580 })
63581 });
63582});
63583
63584
63585;// ./node_modules/@ariakit/react-core/esm/__chunks/ASGALOAX.js
63586"use client";
63587
63588
63589
63590
63591
63592
63593
63594
63595
63596// src/menu/menu-list.tsx
63597
63598
63599
63600var ASGALOAX_TagName = "div";
63601function useAriaLabelledBy(_a) {
63602 var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
63603 const [id, setId] = (0,external_React_.useState)(void 0);
63604 const label = props["aria-label"];
63605 const disclosureElement = useStoreState(store, "disclosureElement");
63606 const contentElement = useStoreState(store, "contentElement");
63607 (0,external_React_.useEffect)(() => {
63608 const disclosure = disclosureElement;
63609 if (!disclosure) return;
63610 const menu = contentElement;
63611 if (!menu) return;
63612 const menuLabel = label || menu.hasAttribute("aria-label");
63613 if (menuLabel) {
63614 setId(void 0);
63615 } else if (disclosure.id) {
63616 setId(disclosure.id);
63617 }
63618 }, [label, disclosureElement, contentElement]);
63619 return id;
63620}
63621var useMenuList = createHook(
63622 function useMenuList2(_a) {
63623 var _b = _a, { store, alwaysVisible, composite } = _b, props = __objRest(_b, ["store", "alwaysVisible", "composite"]);
63624 const context = useMenuProviderContext();
63625 store = store || context;
63626 invariant(
63627 store,
63628 false && 0
63629 );
63630 const parentMenu = store.parent;
63631 const parentMenubar = store.menubar;
63632 const hasParentMenu = !!parentMenu;
63633 const id = useId(props.id);
63634 const onKeyDownProp = props.onKeyDown;
63635 const dir = store.useState(
63636 (state) => state.placement.split("-")[0]
63637 );
63638 const orientation = store.useState(
63639 (state) => state.orientation === "both" ? void 0 : state.orientation
63640 );
63641 const isHorizontal = orientation !== "vertical";
63642 const isMenubarHorizontal = useStoreState(
63643 parentMenubar,
63644 (state) => !!state && state.orientation !== "vertical"
63645 );
63646 const onKeyDown = useEvent((event) => {
63647 onKeyDownProp == null ? void 0 : onKeyDownProp(event);
63648 if (event.defaultPrevented) return;
63649 if (hasParentMenu || parentMenubar && !isHorizontal) {
63650 const hideMap = {
63651 ArrowRight: () => dir === "left" && !isHorizontal,
63652 ArrowLeft: () => dir === "right" && !isHorizontal,
63653 ArrowUp: () => dir === "bottom" && isHorizontal,
63654 ArrowDown: () => dir === "top" && isHorizontal
63655 };
63656 const action = hideMap[event.key];
63657 if (action == null ? void 0 : action()) {
63658 event.stopPropagation();
63659 event.preventDefault();
63660 return store == null ? void 0 : store.hide();
63661 }
63662 }
63663 if (parentMenubar) {
63664 const keyMap = {
63665 ArrowRight: () => {
63666 if (!isMenubarHorizontal) return;
63667 return parentMenubar.next();
63668 },
63669 ArrowLeft: () => {
63670 if (!isMenubarHorizontal) return;
63671 return parentMenubar.previous();
63672 },
63673 ArrowDown: () => {
63674 if (isMenubarHorizontal) return;
63675 return parentMenubar.next();
63676 },
63677 ArrowUp: () => {
63678 if (isMenubarHorizontal) return;
63679 return parentMenubar.previous();
63680 }
63681 };
63682 const action = keyMap[event.key];
63683 const id2 = action == null ? void 0 : action();
63684 if (id2 !== void 0) {
63685 event.stopPropagation();
63686 event.preventDefault();
63687 parentMenubar.move(id2);
63688 }
63689 }
63690 });
63691 props = useWrapElement(
63692 props,
63693 (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuScopedContextProvider, { value: store, children: element }),
63694 [store]
63695 );
63696 const ariaLabelledBy = useAriaLabelledBy(_3YLGPPWQ_spreadValues({ store }, props));
63697 const mounted = store.useState("mounted");
63698 const hidden = isHidden(mounted, props.hidden, alwaysVisible);
63699 const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style;
63700 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
63701 id,
63702 "aria-labelledby": ariaLabelledBy,
63703 hidden
63704 }, props), {
63705 ref: useMergeRefs(id ? store.setContentElement : null, props.ref),
63706 style,
63707 onKeyDown
63708 });
63709 const hasCombobox = !!store.combobox;
63710 composite = composite != null ? composite : !hasCombobox;
63711 if (composite) {
63712 props = _3YLGPPWQ_spreadValues({
63713 role: "menu",
63714 "aria-orientation": orientation
63715 }, props);
63716 }
63717 props = useComposite(_3YLGPPWQ_spreadValues({ store, composite }, props));
63718 props = useCompositeTypeahead(_3YLGPPWQ_spreadValues({ store, typeahead: !hasCombobox }, props));
63719 return props;
63720 }
63721);
63722var MenuList = forwardRef2(function MenuList2(props) {
63723 const htmlProps = useMenuList(props);
63724 return LMDWO4NN_createElement(ASGALOAX_TagName, htmlProps);
63725});
63726
63727
63728
63729;// ./node_modules/@ariakit/react-core/esm/menu/menu.js
63730"use client";
63731
63732
63733
63734
63735
63736
63737
63738
63739
63740
63741
63742
63743
63744
63745
63746
63747
63748
63749
63750
63751
63752
63753
63754
63755
63756
63757
63758
63759
63760
63761
63762
63763
63764
63765
63766
63767
63768
63769
63770
63771
63772
63773
63774
63775
63776
63777
63778
63779
63780
63781// src/menu/menu.tsx
63782
63783
63784
63785
63786var menu_TagName = "div";
63787var useMenu = createHook(function useMenu2(_a) {
63788 var _b = _a, {
63789 store,
63790 modal: modalProp = false,
63791 portal = !!modalProp,
63792 hideOnEscape = true,
63793 autoFocusOnShow = true,
63794 hideOnHoverOutside,
63795 alwaysVisible
63796 } = _b, props = __objRest(_b, [
63797 "store",
63798 "modal",
63799 "portal",
63800 "hideOnEscape",
63801 "autoFocusOnShow",
63802 "hideOnHoverOutside",
63803 "alwaysVisible"
63804 ]);
63805 const context = useMenuProviderContext();
63806 store = store || context;
63807 invariant(
63808 store,
63809 false && 0
63810 );
63811 const ref = (0,external_React_.useRef)(null);
63812 const parentMenu = store.parent;
63813 const parentMenubar = store.menubar;
63814 const hasParentMenu = !!parentMenu;
63815 const parentIsMenubar = !!parentMenubar && !hasParentMenu;
63816 props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), {
63817 ref: useMergeRefs(ref, props.ref)
63818 });
63819 const _a2 = useMenuList(_3YLGPPWQ_spreadValues({
63820 store,
63821 alwaysVisible
63822 }, props)), { "aria-labelledby": ariaLabelledBy } = _a2, menuListProps = __objRest(_a2, ["aria-labelledby"]);
63823 props = menuListProps;
63824 const [initialFocusRef, setInitialFocusRef] = (0,external_React_.useState)();
63825 const autoFocusOnShowState = store.useState("autoFocusOnShow");
63826 const initialFocus = store.useState("initialFocus");
63827 const baseElement = store.useState("baseElement");
63828 const items = store.useState("renderedItems");
63829 (0,external_React_.useEffect)(() => {
63830 let cleaning = false;
63831 setInitialFocusRef((prevInitialFocusRef) => {
63832 var _a3, _b2, _c;
63833 if (cleaning) return;
63834 if (!autoFocusOnShowState) return;
63835 if ((_a3 = prevInitialFocusRef == null ? void 0 : prevInitialFocusRef.current) == null ? void 0 : _a3.isConnected) return prevInitialFocusRef;
63836 const ref2 = (0,external_React_.createRef)();
63837 switch (initialFocus) {
63838 case "first":
63839 ref2.current = ((_b2 = items.find((item) => !item.disabled && item.element)) == null ? void 0 : _b2.element) || null;
63840 break;
63841 case "last":
63842 ref2.current = ((_c = [...items].reverse().find((item) => !item.disabled && item.element)) == null ? void 0 : _c.element) || null;
63843 break;
63844 default:
63845 ref2.current = baseElement;
63846 }
63847 return ref2;
63848 });
63849 return () => {
63850 cleaning = true;
63851 };
63852 }, [store, autoFocusOnShowState, initialFocus, items, baseElement]);
63853 const modal = hasParentMenu ? false : modalProp;
63854 const mayAutoFocusOnShow = !!autoFocusOnShow;
63855 const canAutoFocusOnShow = !!initialFocusRef || !!props.initialFocus || !!modal;
63856 const contentElement = useStoreState(
63857 store.combobox || store,
63858 "contentElement"
63859 );
63860 const parentContentElement = useStoreState(
63861 (parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu,
63862 "contentElement"
63863 );
63864 const preserveTabOrderAnchor = (0,external_React_.useMemo)(() => {
63865 if (!parentContentElement) return;
63866 if (!contentElement) return;
63867 const role = contentElement.getAttribute("role");
63868 const parentRole = parentContentElement.getAttribute("role");
63869 const parentIsMenuOrMenubar = parentRole === "menu" || parentRole === "menubar";
63870 if (parentIsMenuOrMenubar && role === "menu") return;
63871 return parentContentElement;
63872 }, [contentElement, parentContentElement]);
63873 if (preserveTabOrderAnchor !== void 0) {
63874 props = _3YLGPPWQ_spreadValues({
63875 preserveTabOrderAnchor
63876 }, props);
63877 }
63878 props = useHovercard(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({
63879 store,
63880 alwaysVisible,
63881 initialFocus: initialFocusRef,
63882 autoFocusOnShow: mayAutoFocusOnShow ? canAutoFocusOnShow && autoFocusOnShow : autoFocusOnShowState || !!modal
63883 }, props), {
63884 hideOnEscape(event) {
63885 if (isFalsyBooleanCallback(hideOnEscape, event)) return false;
63886 store == null ? void 0 : store.hideAll();
63887 return true;
63888 },
63889 hideOnHoverOutside(event) {
63890 const disclosureElement = store == null ? void 0 : store.getState().disclosureElement;
63891 const getHideOnHoverOutside = () => {
63892 if (typeof hideOnHoverOutside === "function") {
63893 return hideOnHoverOutside(event);
63894 }
63895 if (hideOnHoverOutside != null) return hideOnHoverOutside;
63896 if (hasParentMenu) return true;
63897 if (!parentIsMenubar) return false;
63898 if (!disclosureElement) return true;
63899 if (hasFocusWithin(disclosureElement)) return false;
63900 return true;
63901 };
63902 if (!getHideOnHoverOutside()) return false;
63903 if (event.defaultPrevented) return true;
63904 if (!hasParentMenu) return true;
63905 if (!disclosureElement) return true;
63906 fireEvent(disclosureElement, "mouseout", event);
63907 if (!hasFocusWithin(disclosureElement)) return true;
63908 requestAnimationFrame(() => {
63909 if (hasFocusWithin(disclosureElement)) return;
63910 store == null ? void 0 : store.hide();
63911 });
63912 return false;
63913 },
63914 modal,
63915 portal,
63916 backdrop: hasParentMenu ? false : props.backdrop
63917 }));
63918 props = _3YLGPPWQ_spreadValues({
63919 "aria-labelledby": ariaLabelledBy
63920 }, props);
63921 return props;
63922});
63923var Menu = createDialogComponent(
63924 forwardRef2(function Menu2(props) {
63925 const htmlProps = useMenu(props);
63926 return LMDWO4NN_createElement(menu_TagName, htmlProps);
63927 }),
63928 useMenuProviderContext
63929);
63930
63931
63932;// ./node_modules/@wordpress/components/build-module/menu/popover.js
63933
63934
63935
63936
63937
63938const menu_popover_Popover = (0,external_wp_element_namespaceObject.forwardRef)(function Popover2({
63939 gutter,
63940 children,
63941 shift,
63942 modal = true,
63943 ...otherProps
63944}, ref) {
63945 const menuContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
63946 const appliedPlacementSide = useStoreState(menuContext?.store, "currentPlacement")?.split("-")[0];
63947 const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)((event) => {
63948 event.preventDefault();
63949 return true;
63950 }, []);
63951 const computedDirection = useStoreState(menuContext?.store, "rtl") ? "rtl" : "ltr";
63952 const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
63953 dir: computedDirection,
63954 style: {
63955 direction: computedDirection
63956 }
63957 }), [computedDirection]);
63958 if (!menuContext?.store) {
63959 throw new Error("Menu.Popover can only be rendered inside a Menu component");
63960 }
63961 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu, {
63962 ...otherProps,
63963 ref,
63964 modal,
63965 store: menuContext.store,
63966 gutter: gutter !== null && gutter !== void 0 ? gutter : menuContext.store.parent ? 0 : 8,
63967 shift: shift !== null && shift !== void 0 ? shift : menuContext.store.parent ? -4 : 0,
63968 hideOnHoverOutside: false,
63969 "data-side": appliedPlacementSide,
63970 wrapperProps,
63971 hideOnEscape,
63972 unmountOnHide: true,
63973 render: (renderProps) => (
63974 // Two wrappers are needed for the entry animation, where the menu
63975 // container scales with a different factor than its contents.
63976 // The {...renderProps} are passed to the inner wrapper, so that the
63977 // menu element is the direct parent of the menu item elements.
63978 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverOuterWrapper, {
63979 variant: menuContext.variant,
63980 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverInnerWrapper, {
63981 ...renderProps
63982 })
63983 })
63984 ),
63985 children
63986 });
63987});
63988
63989
63990;// ./node_modules/@wordpress/components/build-module/menu/index.js
63991
63992
63993
63994
63995
63996
63997
63998
63999
64000
64001
64002
64003
64004
64005
64006
64007
64008const UnconnectedMenu = (props) => {
64009 const {
64010 children,
64011 defaultOpen = false,
64012 open,
64013 onOpenChange,
64014 placement,
64015 // From internal components context
64016 variant
64017 } = useContextSystem(props, "Menu");
64018 const parentContext = (0,external_wp_element_namespaceObject.useContext)(context_Context);
64019 const rtl = (0,external_wp_i18n_namespaceObject.isRTL)();
64020 let computedPlacement = placement !== null && placement !== void 0 ? placement : parentContext?.store ? "right-start" : "bottom-start";
64021 if (rtl) {
64022 if (/right/.test(computedPlacement)) {
64023 computedPlacement = computedPlacement.replace("right", "left");
64024 } else if (/left/.test(computedPlacement)) {
64025 computedPlacement = computedPlacement.replace("left", "right");
64026 }
64027 }
64028 const menuStore = useMenuStore({
64029 parent: parentContext?.store,
64030 open,
64031 defaultOpen,
64032 placement: computedPlacement,
64033 focusLoop: true,
64034 setOpen(willBeOpen) {
64035 onOpenChange?.(willBeOpen);
64036 },
64037 rtl
64038 });
64039 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
64040 store: menuStore,
64041 variant
64042 }), [menuStore, variant]);
64043 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context_Context.Provider, {
64044 value: contextValue,
64045 children
64046 });
64047};
64048const menu_Menu = Object.assign(contextConnectWithoutRef(UnconnectedMenu, "Menu"), {
64049 Context: Object.assign(context_Context, {
64050 displayName: "Menu.Context"
64051 }),
64052 /**
64053 * Renders a menu item inside the `Menu.Popover` or `Menu.Group` components.
64054 *
64055 * It can optionally contain one instance of the `Menu.ItemLabel` component
64056 * and one instance of the `Menu.ItemHelpText` component.
64057 */
64058 Item: Object.assign(item_Item, {
64059 displayName: "Menu.Item"
64060 }),
64061 /**
64062 * Renders a radio menu item inside the `Menu.Popover` or `Menu.Group`
64063 * components.
64064 *
64065 * It can optionally contain one instance of the `Menu.ItemLabel` component
64066 * and one instance of the `Menu.ItemHelpText` component.
64067 */
64068 RadioItem: Object.assign(radio_item_RadioItem, {
64069 displayName: "Menu.RadioItem"
64070 }),
64071 /**
64072 * Renders a checkbox menu item inside the `Menu.Popover` or `Menu.Group`
64073 * components.
64074 *
64075 * It can optionally contain one instance of the `Menu.ItemLabel` component
64076 * and one instance of the `Menu.ItemHelpText` component.
64077 */
64078 CheckboxItem: Object.assign(checkbox_item_CheckboxItem, {
64079 displayName: "Menu.CheckboxItem"
64080 }),
64081 /**
64082 * Renders a group for menu items.
64083 *
64084 * It should contain one instance of `Menu.GroupLabel` and one or more
64085 * instances of `Menu.Item`, `Menu.RadioItem`, or `Menu.CheckboxItem`.
64086 */
64087 Group: Object.assign(group_Group, {
64088 displayName: "Menu.Group"
64089 }),
64090 /**
64091 * Renders a label in a menu group.
64092 *
64093 * This component should be wrapped with `Menu.Group` so the
64094 * `aria-labelledby` is correctly set on the group element.
64095 */
64096 GroupLabel: Object.assign(group_label_GroupLabel, {
64097 displayName: "Menu.GroupLabel"
64098 }),
64099 /**
64100 * Renders a divider between menu items or menu groups.
64101 */
64102 Separator: Object.assign(separator_Separator, {
64103 displayName: "Menu.Separator"
64104 }),
64105 /**
64106 * Renders a menu item's label text. It should be wrapped with `Menu.Item`,
64107 * `Menu.RadioItem`, or `Menu.CheckboxItem`.
64108 */
64109 ItemLabel: Object.assign(item_label_ItemLabel, {
64110 displayName: "Menu.ItemLabel"
64111 }),
64112 /**
64113 * Renders a menu item's help text. It should be wrapped with `Menu.Item`,
64114 * `Menu.RadioItem`, or `Menu.CheckboxItem`.
64115 */
64116 ItemHelpText: Object.assign(item_help_text_ItemHelpText, {
64117 displayName: "Menu.ItemHelpText"
64118 }),
64119 /**
64120 * Renders a dropdown menu element that's controlled by a sibling
64121 * `Menu.TriggerButton` component. It renders a popover and automatically
64122 * focuses on items when the menu is shown.
64123 *
64124 * The only valid children of `Menu.Popover` are `Menu.Item`,
64125 * `Menu.RadioItem`, `Menu.CheckboxItem`, `Menu.Group`, `Menu.Separator`,
64126 * and `Menu` (for nested dropdown menus).
64127 */
64128 Popover: Object.assign(menu_popover_Popover, {
64129 displayName: "Menu.Popover"
64130 }),
64131 /**
64132 * Renders a menu button that toggles the visibility of a sibling
64133 * `Menu.Popover` component when clicked or when using arrow keys.
64134 */
64135 TriggerButton: Object.assign(TriggerButton, {
64136 displayName: "Menu.TriggerButton"
64137 }),
64138 /**
64139 * Renders a menu item that toggles the visibility of a sibling
64140 * `Menu.Popover` component when clicked or when using arrow keys.
64141 *
64142 * This component is used to create a nested dropdown menu.
64143 */
64144 SubmenuTriggerItem: Object.assign(SubmenuTriggerItem, {
64145 displayName: "Menu.SubmenuTriggerItem"
64146 })
64147});
64148var build_module_menu_menu_default = (/* unused pure expression or super */ null && (menu_Menu));
64149
64150
64151;// ./node_modules/@wordpress/components/build-module/theme/styles.js
64152
64153function theme_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
64154 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
64155}
64156
64157const colorVariables = ({
64158 colors
64159}) => {
64160 const shades = Object.entries(colors.gray || {}).map(([k, v]) => `--wp-components-color-gray-${k}: ${v};`).join("");
64161 return [/* @__PURE__ */ emotion_react_browser_esm_css("--wp-components-color-accent:", colors.accent, ";--wp-components-color-accent-darker-10:", colors.accentDarker10, ";--wp-components-color-accent-darker-20:", colors.accentDarker20, ";--wp-components-color-accent-inverted:", colors.accentInverted, ";--wp-components-color-background:", colors.background, ";--wp-components-color-foreground:", colors.foreground, ";--wp-components-color-foreground-inverted:", colors.foregroundInverted, ";", shades, ";" + ( true ? "" : 0), true ? "" : 0)];
64162};
64163const theme_styles_Wrapper = /* @__PURE__ */ emotion_styled_base_browser_esm("div", true ? {
64164 target: "e1krjpvb0"
64165} : 0)( true ? {
64166 name: "1a3idx0",
64167 styles: "color:var( --wp-components-color-foreground, currentColor )"
64168} : 0);
64169
64170
64171;// ./node_modules/@wordpress/components/build-module/theme/color-algorithms.js
64172
64173
64174
64175
64176
64177k([names, a11y]);
64178function generateThemeVariables(inputs) {
64179 validateInputs(inputs);
64180 const generatedColors = {
64181 ...generateAccentDependentColors(inputs.accent),
64182 ...generateBackgroundDependentColors(inputs.background)
64183 };
64184 warnContrastIssues(checkContrasts(inputs, generatedColors));
64185 return {
64186 colors: generatedColors
64187 };
64188}
64189function validateInputs(inputs) {
64190 for (const [key, value] of Object.entries(inputs)) {
64191 if (typeof value !== "undefined" && !w(value).isValid()) {
64192 true ? external_wp_warning_default()(`wp.components.Theme: "${value}" is not a valid color value for the '${key}' prop.`) : 0;
64193 }
64194 }
64195}
64196function checkContrasts(inputs, outputs) {
64197 const background = inputs.background || COLORS.white;
64198 const accent = inputs.accent || "#3858e9";
64199 const foreground = outputs.foreground || COLORS.gray[900];
64200 const gray = outputs.gray || COLORS.gray;
64201 return {
64202 accent: w(background).isReadable(accent) ? void 0 : `The background color ("${background}") does not have sufficient contrast against the accent color ("${accent}").`,
64203 foreground: w(background).isReadable(foreground) ? void 0 : `The background color provided ("${background}") does not have sufficient contrast against the standard foreground colors.`,
64204 grays: w(background).contrast(gray[600]) >= 3 && w(background).contrast(gray[700]) >= 4.5 ? void 0 : `The background color provided ("${background}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`
64205 };
64206}
64207function warnContrastIssues(issues) {
64208 for (const error of Object.values(issues)) {
64209 if (error) {
64210 true ? external_wp_warning_default()("wp.components.Theme: " + error) : 0;
64211 }
64212 }
64213}
64214function generateAccentDependentColors(accent) {
64215 if (!accent) {
64216 return {};
64217 }
64218 return {
64219 accent,
64220 accentDarker10: w(accent).darken(0.1).toHex(),
64221 accentDarker20: w(accent).darken(0.2).toHex(),
64222 accentInverted: getForegroundForColor(accent)
64223 };
64224}
64225function generateBackgroundDependentColors(background) {
64226 if (!background) {
64227 return {};
64228 }
64229 const foreground = getForegroundForColor(background);
64230 return {
64231 background,
64232 foreground,
64233 foregroundInverted: getForegroundForColor(foreground),
64234 gray: generateShades(background, foreground)
64235 };
64236}
64237function getForegroundForColor(color) {
64238 return w(color).isDark() ? COLORS.white : COLORS.gray[900];
64239}
64240function generateShades(background, foreground) {
64241 const SHADES = {
64242 100: 0.06,
64243 200: 0.121,
64244 300: 0.132,
64245 400: 0.2,
64246 600: 0.42,
64247 700: 0.543,
64248 800: 0.821
64249 };
64250 const limit = 0.884;
64251 const direction = w(background).isDark() ? "lighten" : "darken";
64252 const range = Math.abs(w(background).toHsl().l - w(foreground).toHsl().l) / 100;
64253 const result = {};
64254 Object.entries(SHADES).forEach(([key, value]) => {
64255 result[parseInt(key)] = w(background)[direction](value / limit * range).toHex();
64256 });
64257 return result;
64258}
64259
64260
64261;// ./node_modules/@wordpress/components/build-module/theme/index.js
64262
64263
64264
64265
64266
64267function Theme({
64268 accent,
64269 background,
64270 className,
64271 ...props
64272}) {
64273 const cx = useCx();
64274 const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(...colorVariables(generateThemeVariables({
64275 accent,
64276 background
64277 })), className), [accent, background, className, cx]);
64278 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(theme_styles_Wrapper, {
64279 className: classes,
64280 ...props
64281 });
64282}
64283var theme_default = Theme;
64284
64285
64286;// ./node_modules/@wordpress/components/build-module/tabs/context.js
64287
64288const TabsContext = (0,external_wp_element_namespaceObject.createContext)(void 0);
64289TabsContext.displayName = "TabsContext";
64290const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)(TabsContext);
64291
64292
64293;// ./node_modules/@wordpress/components/build-module/tabs/styles.js
64294
64295function tabs_styles_EMOTION_STRINGIFIED_CSS_ERROR_() {
64296 return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
64297}
64298
64299
64300
64301
64302const StyledTabList = /* @__PURE__ */ emotion_styled_base_browser_esm(TabList, true ? {
64303 target: "enfox0g4"
64304} : 0)("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n to var( --direction-end ),\n var( --fade-gradient-base )\n );}&.is-overflowing-last{mask-image:linear-gradient(\n to var( --direction-start ),\n var( --fade-gradient-base )\n );}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n to right,\n var( --fade-gradient-composed )\n ),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n calc(\n var( --selected-start ) * var( --direction-factor ) *\n 1px\n )\n ) scaleX(\n calc(\n var( --selected-width, 0 ) /\n var( --antialiasing-factor )\n )\n );border-bottom:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";}}&[aria-orientation='vertical']{&::before{border-radius:", config_values_default.radiusSmall, "/calc(\n ", config_values_default.radiusSmall, " /\n (\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n calc(\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );background-color:color-mix(\n in srgb,\n ", COLORS.theme.accent, ",\n transparent 96%\n );}&[data-select-on-move='true']:has(\n :is( :focus-visible, [data-focus-visible] )\n )::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-block-width:calc(\n var( --wp-admin-border-width-focus, 1px ) /\n (\n var( --selected-height, 0 ) /\n var( --antialiasing-factor )\n )\n );}}" + ( true ? "" : 0));
64305const styles_Tab = /* @__PURE__ */ emotion_styled_base_browser_esm(Tab, true ? {
64306 target: "enfox0g3"
64307} : 0)("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;font-size:", font("default.fontSize"), ";color:", COLORS.theme.foreground, ";position:relative;&[aria-disabled='true']{cursor:default;color:", COLORS.ui.textDisabled, ";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-radius:", config_values_default.radiusSmall, ";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:", space(4), ";height:", space(12), ";scroll-margin:24px;&::after{content:'';inset:", space(3), ";}}[aria-orientation='vertical'] &{padding:", space(2), " ", space(3), ";min-height:", space(10), ";&[aria-selected='true']{color:", COLORS.theme.accent, ";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}" + ( true ? "" : 0));
64308const TabChildren = /* @__PURE__ */ emotion_styled_base_browser_esm("span", true ? {
64309 target: "enfox0g2"
64310} : 0)( true ? {
64311 name: "9at4z3",
64312 styles: "flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}"
64313} : 0);
64314const TabChevron = /* @__PURE__ */ emotion_styled_base_browser_esm(icon_icon_default, true ? {
64315 target: "enfox0g1"
64316} : 0)("flex-shrink:0;margin-inline-end:", space(-1), ";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}" + ( true ? "" : 0));
64317const styles_TabPanel = /* @__PURE__ */ emotion_styled_base_browser_esm(TabPanel, true ? {
64318 target: "enfox0g0"
64319} : 0)("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0));
64320
64321
64322;// ./node_modules/@wordpress/components/build-module/tabs/tab.js
64323
64324
64325
64326
64327
64328
64329const tab_Tab = (0,external_wp_element_namespaceObject.forwardRef)(function Tab2({
64330 children,
64331 tabId,
64332 disabled,
64333 render,
64334 ...otherProps
64335}, ref) {
64336 var _useTabsContext;
64337 const {
64338 store,
64339 instanceId
64340 } = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
64341 if (!store) {
64342 true ? external_wp_warning_default()("`Tabs.Tab` must be wrapped in a `Tabs` component.") : 0;
64343 return null;
64344 }
64345 const instancedTabId = `${instanceId}-${tabId}`;
64346 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(styles_Tab, {
64347 ref,
64348 store,
64349 id: instancedTabId,
64350 disabled,
64351 render,
64352 ...otherProps,
64353 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChildren, {
64354 children
64355 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabChevron, {
64356 icon: chevron_right_default
64357 })]
64358 });
64359});
64360
64361
64362;// ./node_modules/@wordpress/components/build-module/tabs/use-track-overflow.js
64363
64364
64365function useTrackOverflow(parent, children) {
64366 const [first, setFirst] = (0,external_wp_element_namespaceObject.useState)(false);
64367 const [last, setLast] = (0,external_wp_element_namespaceObject.useState)(false);
64368 const [observer, setObserver] = (0,external_wp_element_namespaceObject.useState)();
64369 const callback = (0,external_wp_compose_namespaceObject.useEvent)((entries) => {
64370 for (const entry of entries) {
64371 if (entry.target === children.first) {
64372 setFirst(!entry.isIntersecting);
64373 }
64374 if (entry.target === children.last) {
64375 setLast(!entry.isIntersecting);
64376 }
64377 }
64378 });
64379 (0,external_wp_element_namespaceObject.useEffect)(() => {
64380 if (!parent || !window.IntersectionObserver) {
64381 return;
64382 }
64383 const newObserver = new IntersectionObserver(callback, {
64384 root: parent,
64385 threshold: 0.9
64386 });
64387 setObserver(newObserver);
64388 return () => newObserver.disconnect();
64389 }, [callback, parent]);
64390 (0,external_wp_element_namespaceObject.useEffect)(() => {
64391 if (!observer) {
64392 return;
64393 }
64394 if (children.first) {
64395 observer.observe(children.first);
64396 }
64397 if (children.last) {
64398 observer.observe(children.last);
64399 }
64400 return () => {
64401 if (children.first) {
64402 observer.unobserve(children.first);
64403 }
64404 if (children.last) {
64405 observer.unobserve(children.last);
64406 }
64407 };
64408 }, [children.first, children.last, observer]);
64409 return {
64410 first,
64411 last
64412 };
64413}
64414
64415
64416;// ./node_modules/@wordpress/components/build-module/tabs/tablist.js
64417
64418
64419
64420
64421
64422
64423
64424
64425
64426
64427
64428const DEFAULT_SCROLL_MARGIN = 24;
64429function useScrollRectIntoView(parent, rect, {
64430 margin = DEFAULT_SCROLL_MARGIN
64431} = {}) {
64432 (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
64433 if (!parent || !rect) {
64434 return;
64435 }
64436 const {
64437 scrollLeft: parentScroll
64438 } = parent;
64439 const parentWidth = parent.getBoundingClientRect().width;
64440 const {
64441 left: childLeft,
64442 width: childWidth
64443 } = rect;
64444 const parentRightEdge = parentScroll + parentWidth;
64445 const childRightEdge = childLeft + childWidth;
64446 const rightOverflow = childRightEdge + margin - parentRightEdge;
64447 const leftOverflow = parentScroll - (childLeft - margin);
64448 let scrollLeft = null;
64449 if (leftOverflow > 0) {
64450 scrollLeft = parentScroll - leftOverflow;
64451 } else if (rightOverflow > 0) {
64452 scrollLeft = parentScroll + rightOverflow;
64453 }
64454 if (scrollLeft !== null) {
64455 parent.scroll?.({
64456 left: scrollLeft
64457 });
64458 }
64459 }, [margin, parent, rect]);
64460}
64461const tablist_TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabList2({
64462 children,
64463 ...otherProps
64464}, ref) {
64465 var _useTabsContext;
64466 const {
64467 store
64468 } = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
64469 const selectedId = useStoreState(store, "selectedId");
64470 const activeId = useStoreState(store, "activeId");
64471 const selectOnMove = useStoreState(store, "selectOnMove");
64472 const items = useStoreState(store, "items");
64473 const [parent, setParent] = (0,external_wp_element_namespaceObject.useState)();
64474 const refs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setParent]);
64475 const selectedItem = store?.item(selectedId);
64476 const renderedItems = useStoreState(store, "renderedItems");
64477 const selectedItemIndex = renderedItems && selectedItem ? renderedItems.indexOf(selectedItem) : -1;
64478 const selectedRect = useTrackElementOffsetRect(selectedItem?.element, [selectedItemIndex]);
64479 const overflow = useTrackOverflow(parent, {
64480 first: items?.at(0)?.element,
64481 last: items?.at(-1)?.element
64482 });
64483 useAnimatedOffsetRect(parent, selectedRect, {
64484 prefix: "selected",
64485 dataAttribute: "indicator-animated",
64486 transitionEndFilter: (event) => event.pseudoElement === "::before",
64487 roundRect: true
64488 });
64489 useScrollRectIntoView(parent, selectedRect);
64490 const onBlur = () => {
64491 if (!selectOnMove) {
64492 return;
64493 }
64494 if (selectedId !== activeId) {
64495 store?.setActiveId(selectedId);
64496 }
64497 };
64498 if (!store) {
64499 true ? external_wp_warning_default()("`Tabs.TabList` must be wrapped in a `Tabs` component.") : 0;
64500 return null;
64501 }
64502 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledTabList, {
64503 ref: refs,
64504 store,
64505 render: (props) => {
64506 var _props$tabIndex;
64507 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
64508 ...props,
64509 // Fallback to -1 to prevent browsers from making the tablist
64510 // tabbable when it is a scrolling container.
64511 tabIndex: (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : -1
64512 });
64513 },
64514 onBlur,
64515 "data-select-on-move": selectOnMove ? "true" : "false",
64516 ...otherProps,
64517 className: dist_clsx(overflow.first && "is-overflowing-first", overflow.last && "is-overflowing-last", otherProps.className),
64518 children
64519 });
64520});
64521
64522
64523;// ./node_modules/@wordpress/components/build-module/tabs/tabpanel.js
64524
64525
64526
64527
64528
64529
64530const tabpanel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(function TabPanel2({
64531 children,
64532 tabId,
64533 focusable = true,
64534 ...otherProps
64535}, ref) {
64536 const context = useTabsContext();
64537 const selectedId = useStoreState(context?.store, "selectedId");
64538 if (!context) {
64539 true ? external_wp_warning_default()("`Tabs.TabPanel` must be wrapped in a `Tabs` component.") : 0;
64540 return null;
64541 }
64542 const {
64543 store,
64544 instanceId
64545 } = context;
64546 const instancedTabId = `${instanceId}-${tabId}`;
64547 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_TabPanel, {
64548 ref,
64549 store,
64550 id: `${instancedTabId}-view`,
64551 tabId: instancedTabId,
64552 focusable,
64553 ...otherProps,
64554 children: selectedId === instancedTabId && children
64555 });
64556});
64557
64558
64559;// ./node_modules/@wordpress/components/build-module/tabs/index.js
64560
64561
64562
64563
64564
64565
64566
64567
64568
64569function externalToInternalTabId(externalId, instanceId) {
64570 return externalId && `${instanceId}-${externalId}`;
64571}
64572function internalToExternalTabId(internalId, instanceId) {
64573 return typeof internalId === "string" ? internalId.replace(`${instanceId}-`, "") : internalId;
64574}
64575const Tabs = Object.assign(function Tabs2({
64576 selectOnMove = true,
64577 defaultTabId,
64578 orientation = "horizontal",
64579 onSelect,
64580 children,
64581 selectedTabId,
64582 activeTabId,
64583 defaultActiveTabId,
64584 onActiveTabIdChange
64585}) {
64586 const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Tabs2, "tabs");
64587 const store = useTabStore({
64588 selectOnMove,
64589 orientation,
64590 defaultSelectedId: externalToInternalTabId(defaultTabId, instanceId),
64591 setSelectedId: (newSelectedId) => {
64592 onSelect?.(internalToExternalTabId(newSelectedId, instanceId));
64593 },
64594 selectedId: externalToInternalTabId(selectedTabId, instanceId),
64595 defaultActiveId: externalToInternalTabId(defaultActiveTabId, instanceId),
64596 setActiveId: (newActiveId) => {
64597 onActiveTabIdChange?.(internalToExternalTabId(newActiveId, instanceId));
64598 },
64599 activeId: externalToInternalTabId(activeTabId, instanceId),
64600 rtl: (0,external_wp_i18n_namespaceObject.isRTL)()
64601 });
64602 const {
64603 items,
64604 activeId
64605 } = useStoreState(store);
64606 const {
64607 setActiveId
64608 } = store;
64609 (0,external_wp_element_namespaceObject.useEffect)(() => {
64610 requestAnimationFrame(() => {
64611 const focusedElement = items?.[0]?.element?.ownerDocument.activeElement;
64612 if (!focusedElement || !items.some((item) => focusedElement === item.element)) {
64613 return;
64614 }
64615 if (activeId !== focusedElement.id) {
64616 setActiveId(focusedElement.id);
64617 }
64618 });
64619 }, [activeId, items, setActiveId]);
64620 const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
64621 store,
64622 instanceId
64623 }), [store, instanceId]);
64624 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TabsContext.Provider, {
64625 value: contextValue,
64626 children
64627 });
64628}, {
64629 /**
64630 * Renders a single tab.
64631 *
64632 * The currently active tab receives default styling that can be
64633 * overridden with CSS targeting `[aria-selected="true"]`.
64634 */
64635 Tab: Object.assign(tab_Tab, {
64636 displayName: "Tabs.Tab"
64637 }),
64638 /**
64639 * A wrapper component for the `Tab` components.
64640 *
64641 * It is responsible for rendering the list of tabs.
64642 */
64643 TabList: Object.assign(tablist_TabList, {
64644 displayName: "Tabs.TabList"
64645 }),
64646 /**
64647 * Renders the content to display for a single tab once that tab is selected.
64648 */
64649 TabPanel: Object.assign(tabpanel_TabPanel, {
64650 displayName: "Tabs.TabPanel"
64651 }),
64652 Context: Object.assign(TabsContext, {
64653 displayName: "Tabs.Context"
64654 })
64655});
64656
64657
64658;// external ["wp","privateApis"]
64659const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
64660;// ./node_modules/@wordpress/components/build-module/lock-unlock.js
64661
64662const {
64663 lock,
64664 unlock
64665} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/components");
64666
64667
64668;// ./node_modules/@wordpress/icons/build-module/library/info.js
64669
64670
64671var info_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
64672 external_wp_primitives_namespaceObject.Path,
64673 {
64674 fillRule: "evenodd",
64675 clipRule: "evenodd",
64676 d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"
64677 }
64678) });
64679
64680
64681;// ./node_modules/@wordpress/icons/build-module/library/published.js
64682
64683
64684var published_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
64685 external_wp_primitives_namespaceObject.Path,
64686 {
64687 fillRule: "evenodd",
64688 clipRule: "evenodd",
64689 d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"
64690 }
64691) });
64692
64693
64694;// ./node_modules/@wordpress/icons/build-module/library/caution.js
64695
64696
64697var caution_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
64698 external_wp_primitives_namespaceObject.Path,
64699 {
64700 fillRule: "evenodd",
64701 clipRule: "evenodd",
64702 d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"
64703 }
64704) });
64705
64706
64707;// ./node_modules/@wordpress/icons/build-module/library/error.js
64708
64709
64710var error_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
64711 external_wp_primitives_namespaceObject.Path,
64712 {
64713 fillRule: "evenodd",
64714 clipRule: "evenodd",
64715 d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"
64716 }
64717) });
64718
64719
64720;// ./node_modules/@wordpress/components/build-module/badge/index.js
64721
64722
64723
64724
64725function contextBasedIcon(intent = "default") {
64726 switch (intent) {
64727 case "info":
64728 return info_default;
64729 case "success":
64730 return published_default;
64731 case "warning":
64732 return caution_default;
64733 case "error":
64734 return error_default;
64735 default:
64736 return null;
64737 }
64738}
64739function Badge({
64740 className,
64741 intent = "default",
64742 children,
64743 ...props
64744}) {
64745 const icon = contextBasedIcon(intent);
64746 const hasIcon = !!icon;
64747 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
64748 className: dist_clsx("components-badge", className, {
64749 [`is-${intent}`]: intent,
64750 "has-icon": hasIcon
64751 }),
64752 ...props,
64753 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
64754 className: "components-badge__flex-wrapper",
64755 children: [hasIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
64756 icon,
64757 size: 16,
64758 fill: "currentColor",
64759 className: "components-badge__icon"
64760 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
64761 className: "components-badge__content",
64762 children
64763 })]
64764 })
64765 });
64766}
64767var badge_default = Badge;
64768
64769
64770;// ./node_modules/@date-fns/tz/constants/index.js
64771/**
64772 * The symbol to access the `TZDate`'s function to construct a new instance from
64773 * the provided value. It helps date-fns to inherit the time zone.
64774 */
64775const constructFromSymbol = Symbol.for("constructDateFrom");
64776;// ./node_modules/@date-fns/tz/tzName/index.js
64777/**
64778 * Time zone name format.
64779 */
64780
64781/**
64782 * The function returns the time zone name for the given date in the specified
64783 * time zone.
64784 *
64785 * It uses the `Intl.DateTimeFormat` API and by default outputs the time zone
64786 * name in a long format, e.g. "Pacific Standard Time" or
64787 * "Singapore Standard Time".
64788 *
64789 * It is possible to specify the format as the third argument using one of the following options
64790 *
64791 * - "short": e.g. "EDT" or "GMT+8".
64792 * - "long": e.g. "Eastern Daylight Time".
64793 * - "shortGeneric": e.g. "ET" or "Singapore Time".
64794 * - "longGeneric": e.g. "Eastern Time" or "Singapore Standard Time".
64795 *
64796 * These options correspond to TR35 tokens `z..zzz`, `zzzz`, `v`, and `vvvv` respectively: https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
64797 *
64798 * @param timeZone - Time zone name (IANA or UTC offset)
64799 * @param date - Date object to get the time zone name for
64800 * @param format - Optional format of the time zone name. Defaults to "long". Can be "short", "long", "shortGeneric", or "longGeneric".
64801 *
64802 * @returns Time zone name (e.g. "Singapore Standard Time")
64803 */
64804function tzName(timeZone, date, format = "long") {
64805 return new Intl.DateTimeFormat("en-US", {
64806 // Enforces engine to render the time. Without the option JavaScriptCore omits it.
64807 hour: "numeric",
64808 timeZone: timeZone,
64809 timeZoneName: format
64810 }).format(date).split(/\s/g) // Format.JS uses non-breaking spaces
64811 .slice(2) // Skip the hour and AM/PM parts
64812 .join(" ");
64813}
64814;// ./node_modules/@date-fns/tz/tzOffset/index.js
64815const offsetFormatCache = {};
64816const offsetCache = {};
64817
64818/**
64819 * The function extracts UTC offset in minutes from the given date in specified
64820 * time zone.
64821 *
64822 * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
64823 * mirrored to the sign of the offset in the time zone. For Asia/Singapore
64824 * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.
64825 *
64826 * @param timeZone - Time zone name (IANA or UTC offset)
64827 * @param date - Date to check the offset for
64828 *
64829 * @returns UTC offset in minutes
64830 */
64831function tzOffset_tzOffset(timeZone, date) {
64832 try {
64833 const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
64834 timeZone,
64835 timeZoneName: "longOffset"
64836 }).format;
64837 const offsetStr = format(date).split("GMT")[1];
64838 if (offsetStr in offsetCache) return offsetCache[offsetStr];
64839 return calcOffset(offsetStr, offsetStr.split(":"));
64840 } catch {
64841 // Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH
64842 // See: https://github.com/nodejs/node/issues/53419
64843 if (timeZone in offsetCache) return offsetCache[timeZone];
64844 const captures = timeZone?.match(offsetRe);
64845 if (captures) return calcOffset(timeZone, captures.slice(1));
64846 return NaN;
64847 }
64848}
64849const offsetRe = /([+-]\d\d):?(\d\d)?/;
64850function calcOffset(cacheStr, values) {
64851 const hours = +(values[0] || 0);
64852 const minutes = +(values[1] || 0);
64853 // Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
64854 const seconds = +(values[2] || 0) / 60;
64855 return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
64856}
64857;// ./node_modules/@date-fns/tz/date/mini.js
64858
64859class TZDateMini extends Date {
64860 //#region static
64861
64862 constructor(...args) {
64863 super();
64864 if (args.length > 1 && typeof args[args.length - 1] === "string") {
64865 this.timeZone = args.pop();
64866 }
64867 this.internal = new Date();
64868 if (isNaN(tzOffset_tzOffset(this.timeZone, this))) {
64869 this.setTime(NaN);
64870 } else {
64871 if (!args.length) {
64872 this.setTime(Date.now());
64873 } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
64874 this.setTime(args[0]);
64875 } else if (typeof args[0] === "string") {
64876 this.setTime(+new Date(args[0]));
64877 } else if (args[0] instanceof Date) {
64878 this.setTime(+args[0]);
64879 } else {
64880 this.setTime(+new Date(...args));
64881 adjustToSystemTZ(this, NaN);
64882 syncToInternal(this);
64883 }
64884 }
64885 }
64886 static tz(tz, ...args) {
64887 return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);
64888 }
64889
64890 //#endregion
64891
64892 //#region time zone
64893
64894 withTimeZone(timeZone) {
64895 return new TZDateMini(+this, timeZone);
64896 }
64897 getTimezoneOffset() {
64898 const offset = -tzOffset_tzOffset(this.timeZone, this);
64899 // Remove the seconds offset
64900 // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
64901 return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
64902 }
64903
64904 //#endregion
64905
64906 //#region time
64907
64908 setTime(time) {
64909 Date.prototype.setTime.apply(this, arguments);
64910 syncToInternal(this);
64911 return +this;
64912 }
64913
64914 //#endregion
64915
64916 //#region date-fns integration
64917
64918 [Symbol.for("constructDateFrom")](date) {
64919 return new TZDateMini(+new Date(date), this.timeZone);
64920 }
64921
64922 //#endregion
64923}
64924
64925// Assign getters and setters
64926const mini_re = /^(get|set)(?!UTC)/;
64927Object.getOwnPropertyNames(Date.prototype).forEach(method => {
64928 if (!mini_re.test(method)) return;
64929 const utcMethod = method.replace(mini_re, "$1UTC");
64930 // Filter out methods without UTC counterparts
64931 if (!TZDateMini.prototype[utcMethod]) return;
64932 if (method.startsWith("get")) {
64933 // Delegate to internal date's UTC method
64934 TZDateMini.prototype[method] = function () {
64935 return this.internal[utcMethod]();
64936 };
64937 } else {
64938 // Assign regular setter
64939 TZDateMini.prototype[method] = function () {
64940 Date.prototype[utcMethod].apply(this.internal, arguments);
64941 syncFromInternal(this);
64942 return +this;
64943 };
64944
64945 // Assign UTC setter
64946 TZDateMini.prototype[utcMethod] = function () {
64947 Date.prototype[utcMethod].apply(this, arguments);
64948 syncToInternal(this);
64949 return +this;
64950 };
64951 }
64952});
64953
64954/**
64955 * Function syncs time to internal date, applying the time zone offset.
64956 *
64957 * @param {Date} date - Date to sync
64958 */
64959function syncToInternal(date) {
64960 date.internal.setTime(+date);
64961 date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset_tzOffset(date.timeZone, date) * 60));
64962}
64963
64964/**
64965 * Function syncs the internal date UTC values to the date. It allows to get
64966 * accurate timestamp value.
64967 *
64968 * @param {Date} date - The date to sync
64969 */
64970function syncFromInternal(date) {
64971 // First we transpose the internal values
64972 Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
64973 Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
64974
64975 // Now we have to adjust the date to the system time zone
64976 adjustToSystemTZ(date);
64977}
64978
64979/**
64980 * Function adjusts the date to the system time zone. It uses the time zone
64981 * differences to calculate the offset and adjust the date.
64982 *
64983 * @param {Date} date - Date to adjust
64984 */
64985function adjustToSystemTZ(date) {
64986 // Save the time zone offset before all the adjustments
64987 const baseOffset = tzOffset_tzOffset(date.timeZone, date);
64988 // Remove the seconds offset
64989 // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
64990 const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
64991 //#region System DST adjustment
64992
64993 // The biggest problem with using the system time zone is that when we create
64994 // a date from internal values stored in UTC, the system time zone might end
64995 // up on the DST hour:
64996 //
64997 // $ TZ=America/New_York node
64998 // > new Date(2020, 2, 8, 1).toString()
64999 // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'
65000 // > new Date(2020, 2, 8, 2).toString()
65001 // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
65002 // > new Date(2020, 2, 8, 3).toString()
65003 // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'
65004 // > new Date(2020, 2, 8, 4).toString()
65005 // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'
65006 //
65007 // Here we get the same hour for both 2 and 3, because the system time zone
65008 // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have
65009 // to adjust the internal date to reflect that.
65010 //
65011 // However we want to adjust only if that's the DST hour the change happenes,
65012 // not the hour where DST moves to.
65013
65014 // We calculate the previous hour to see if the time zone offset has changed
65015 // and we have landed on the DST hour.
65016 const prevHour = new Date(+date);
65017 // We use UTC methods here as we don't want to land on the same hour again
65018 // in case of DST.
65019 prevHour.setUTCHours(prevHour.getUTCHours() - 1);
65020
65021 // Calculate if we are on the system DST hour.
65022 const systemOffset = -new Date(+date).getTimezoneOffset();
65023 const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();
65024 const systemDSTChange = systemOffset - prevHourSystemOffset;
65025 // Detect the DST shift. System DST change will occur both on
65026 const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
65027
65028 // Move the internal date when we are on the system DST hour.
65029 if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
65030
65031 //#endregion
65032
65033 //#region System diff adjustment
65034
65035 // Now we need to adjust the date, since we just applied internal values.
65036 // We need to calculate the difference between the system and date time zones
65037 // and apply it to the date.
65038
65039 const offsetDiff = systemOffset - offset;
65040 if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
65041
65042 //#endregion
65043
65044 //#region Seconds System diff adjustment
65045
65046 const systemDate = new Date(+date);
65047 // Set the UTC seconds to 0 to isolate the timezone offset in seconds.
65048 systemDate.setUTCSeconds(0);
65049 // For negative systemOffset, invert the seconds.
65050 const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
65051
65052 // Calculate the seconds offset based on the timezone offset.
65053 const secondsOffset = Math.round(-(tzOffset_tzOffset(date.timeZone, date) * 60)) % 60;
65054 if (secondsOffset || systemSecondsOffset) {
65055 date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
65056 Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
65057 }
65058
65059 //#endregion
65060
65061 //#region Post-adjustment DST fix
65062
65063 const postBaseOffset = tzOffset_tzOffset(date.timeZone, date);
65064 // Remove the seconds offset
65065 // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
65066 const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
65067 const postSystemOffset = -new Date(+date).getTimezoneOffset();
65068 const postOffsetDiff = postSystemOffset - postOffset;
65069 const offsetChanged = postOffset !== offset;
65070 const postDiff = postOffsetDiff - offsetDiff;
65071 if (offsetChanged && postDiff) {
65072 Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
65073
65074 // Now we need to check if got offset change during the post-adjustment.
65075 // If so, we also need both dates to reflect that.
65076
65077 const newBaseOffset = tzOffset_tzOffset(date.timeZone, date);
65078 // Remove the seconds offset
65079 // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
65080 const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
65081 const offsetChange = postOffset - newOffset;
65082 if (offsetChange) {
65083 date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
65084 Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
65085 }
65086 }
65087
65088 //#endregion
65089}
65090;// ./node_modules/@date-fns/tz/date/index.js
65091
65092
65093class date_TZDate extends TZDateMini {
65094 //#region static
65095
65096 static tz(tz, ...args) {
65097 return args.length ? new date_TZDate(...args, tz) : new date_TZDate(Date.now(), tz);
65098 }
65099
65100 //#endregion
65101
65102 //#region representation
65103
65104 toISOString() {
65105 const [sign, hours, minutes] = this.tzComponents();
65106 const tz = `${sign}${hours}:${minutes}`;
65107 return this.internal.toISOString().slice(0, -1) + tz;
65108 }
65109 toString() {
65110 // "Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)";
65111 return `${this.toDateString()} ${this.toTimeString()}`;
65112 }
65113 toDateString() {
65114 // toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
65115 const [day, date, month, year] = this.internal.toUTCString().split(" ");
65116 // "Tue Aug 13 2024"
65117 return `${day?.slice(0, -1) /* Remove "," */} ${month} ${date} ${year}`;
65118 }
65119 toTimeString() {
65120 // toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
65121 const time = this.internal.toUTCString().split(" ")[4];
65122 const [sign, hours, minutes] = this.tzComponents();
65123 // "07:42:23 GMT+0800 (Singapore Standard Time)"
65124 return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
65125 }
65126 toLocaleString(locales, options) {
65127 return Date.prototype.toLocaleString.call(this, locales, {
65128 ...options,
65129 timeZone: options?.timeZone || this.timeZone
65130 });
65131 }
65132 toLocaleDateString(locales, options) {
65133 return Date.prototype.toLocaleDateString.call(this, locales, {
65134 ...options,
65135 timeZone: options?.timeZone || this.timeZone
65136 });
65137 }
65138 toLocaleTimeString(locales, options) {
65139 return Date.prototype.toLocaleTimeString.call(this, locales, {
65140 ...options,
65141 timeZone: options?.timeZone || this.timeZone
65142 });
65143 }
65144
65145 //#endregion
65146
65147 //#region private
65148
65149 tzComponents() {
65150 const offset = this.getTimezoneOffset();
65151 const sign = offset > 0 ? "-" : "+";
65152 const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
65153 const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
65154 return [sign, hours, minutes];
65155 }
65156
65157 //#endregion
65158
65159 withTimeZone(timeZone) {
65160 return new date_TZDate(+this, timeZone);
65161 }
65162
65163 //#region date-fns integration
65164
65165 [Symbol.for("constructDateFrom")](date) {
65166 return new date_TZDate(+new Date(date), this.timeZone);
65167 }
65168
65169 //#endregion
65170}
65171;// ./node_modules/@date-fns/tz/tz/index.js
65172
65173
65174/**
65175 * The function creates accepts a time zone and returns a function that creates
65176 * a new `TZDate` instance in the time zone from the provided value. Use it to
65177 * provide the context for the date-fns functions, via the `in` option.
65178 *
65179 * @param timeZone - Time zone name (IANA or UTC offset)
65180 *
65181 * @returns Function that creates a new `TZDate` instance in the time zone
65182 */
65183const tz = timeZone => value => TZDate.tz(timeZone, +new Date(value));
65184;// ./node_modules/@date-fns/tz/tzScan/index.js
65185
65186
65187/**
65188 * Time interval.
65189 */
65190
65191/**
65192 * Time zone change record.
65193 */
65194
65195/**
65196 * The function scans the time zone for changes in the given interval.
65197 *
65198 * @param timeZone - Time zone name (IANA or UTC offset)
65199 * @param interval - Time interval to scan for changes
65200 *
65201 * @returns Array of time zone changes
65202 */
65203function tzScan(timeZone, interval) {
65204 const changes = [];
65205 const monthDate = new Date(interval.start);
65206 monthDate.setUTCSeconds(0, 0);
65207 const endDate = new Date(interval.end);
65208 endDate.setUTCSeconds(0, 0);
65209 const endMonthTime = +endDate;
65210 let lastOffset = tzOffset(timeZone, monthDate);
65211 while (+monthDate < endMonthTime) {
65212 // Month forward
65213 monthDate.setUTCMonth(monthDate.getUTCMonth() + 1);
65214
65215 // Find the month where the offset changes
65216 const offset = tzOffset(timeZone, monthDate);
65217 if (offset != lastOffset) {
65218 // Rewind a month back to find the day where the offset changes
65219 const dayDate = new Date(monthDate);
65220 dayDate.setUTCMonth(dayDate.getUTCMonth() - 1);
65221 const endDayTime = +monthDate;
65222 lastOffset = tzOffset(timeZone, dayDate);
65223 while (+dayDate < endDayTime) {
65224 // Day forward
65225 dayDate.setUTCDate(dayDate.getUTCDate() + 1);
65226
65227 // Find the day where the offset changes
65228 const offset = tzOffset(timeZone, dayDate);
65229 if (offset != lastOffset) {
65230 // Rewind a day back to find the time where the offset changes
65231 const hourDate = new Date(dayDate);
65232 hourDate.setUTCDate(hourDate.getUTCDate() - 1);
65233 const endHourTime = +dayDate;
65234 lastOffset = tzOffset(timeZone, hourDate);
65235 while (+hourDate < endHourTime) {
65236 // Hour forward
65237 hourDate.setUTCHours(hourDate.getUTCHours() + 1);
65238
65239 // Find the hour where the offset changes
65240 const hourOffset = tzOffset(timeZone, hourDate);
65241 if (hourOffset !== lastOffset) {
65242 changes.push({
65243 date: new Date(hourDate),
65244 change: hourOffset - lastOffset,
65245 offset: hourOffset
65246 });
65247 }
65248 lastOffset = hourOffset;
65249 }
65250 }
65251 lastOffset = offset;
65252 }
65253 }
65254 lastOffset = offset;
65255 }
65256 return changes;
65257}
65258;// ./node_modules/@date-fns/tz/index.js
65259
65260
65261
65262
65263
65264
65265
65266;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
65267const formatDistance_formatDistanceLocale = {
65268 lessThanXSeconds: {
65269 one: "less than a second",
65270 other: "less than {{count}} seconds",
65271 },
65272
65273 xSeconds: {
65274 one: "1 second",
65275 other: "{{count}} seconds",
65276 },
65277
65278 halfAMinute: "half a minute",
65279
65280 lessThanXMinutes: {
65281 one: "less than a minute",
65282 other: "less than {{count}} minutes",
65283 },
65284
65285 xMinutes: {
65286 one: "1 minute",
65287 other: "{{count}} minutes",
65288 },
65289
65290 aboutXHours: {
65291 one: "about 1 hour",
65292 other: "about {{count}} hours",
65293 },
65294
65295 xHours: {
65296 one: "1 hour",
65297 other: "{{count}} hours",
65298 },
65299
65300 xDays: {
65301 one: "1 day",
65302 other: "{{count}} days",
65303 },
65304
65305 aboutXWeeks: {
65306 one: "about 1 week",
65307 other: "about {{count}} weeks",
65308 },
65309
65310 xWeeks: {
65311 one: "1 week",
65312 other: "{{count}} weeks",
65313 },
65314
65315 aboutXMonths: {
65316 one: "about 1 month",
65317 other: "about {{count}} months",
65318 },
65319
65320 xMonths: {
65321 one: "1 month",
65322 other: "{{count}} months",
65323 },
65324
65325 aboutXYears: {
65326 one: "about 1 year",
65327 other: "about {{count}} years",
65328 },
65329
65330 xYears: {
65331 one: "1 year",
65332 other: "{{count}} years",
65333 },
65334
65335 overXYears: {
65336 one: "over 1 year",
65337 other: "over {{count}} years",
65338 },
65339
65340 almostXYears: {
65341 one: "almost 1 year",
65342 other: "almost {{count}} years",
65343 },
65344};
65345
65346const formatDistance_formatDistance = (token, count, options) => {
65347 let result;
65348
65349 const tokenValue = formatDistance_formatDistanceLocale[token];
65350 if (typeof tokenValue === "string") {
65351 result = tokenValue;
65352 } else if (count === 1) {
65353 result = tokenValue.one;
65354 } else {
65355 result = tokenValue.other.replace("{{count}}", count.toString());
65356 }
65357
65358 if (options?.addSuffix) {
65359 if (options.comparison && options.comparison > 0) {
65360 return "in " + result;
65361 } else {
65362 return result + " ago";
65363 }
65364 }
65365
65366 return result;
65367};
65368
65369;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
65370function buildFormatLongFn_buildFormatLongFn(args) {
65371 return (options = {}) => {
65372 // TODO: Remove String()
65373 const width = options.width ? String(options.width) : args.defaultWidth;
65374 const format = args.formats[width] || args.formats[args.defaultWidth];
65375 return format;
65376 };
65377}
65378
65379;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatLong.js
65380
65381
65382const formatLong_dateFormats = {
65383 full: "EEEE, MMMM do, y",
65384 long: "MMMM do, y",
65385 medium: "MMM d, y",
65386 short: "MM/dd/yyyy",
65387};
65388
65389const formatLong_timeFormats = {
65390 full: "h:mm:ss a zzzz",
65391 long: "h:mm:ss a z",
65392 medium: "h:mm:ss a",
65393 short: "h:mm a",
65394};
65395
65396const formatLong_dateTimeFormats = {
65397 full: "{{date}} 'at' {{time}}",
65398 long: "{{date}} 'at' {{time}}",
65399 medium: "{{date}}, {{time}}",
65400 short: "{{date}}, {{time}}",
65401};
65402
65403const formatLong_formatLong = {
65404 date: buildFormatLongFn_buildFormatLongFn({
65405 formats: formatLong_dateFormats,
65406 defaultWidth: "full",
65407 }),
65408
65409 time: buildFormatLongFn_buildFormatLongFn({
65410 formats: formatLong_timeFormats,
65411 defaultWidth: "full",
65412 }),
65413
65414 dateTime: buildFormatLongFn_buildFormatLongFn({
65415 formats: formatLong_dateTimeFormats,
65416 defaultWidth: "full",
65417 }),
65418};
65419
65420;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
65421const formatRelative_formatRelativeLocale = {
65422 lastWeek: "'last' eeee 'at' p",
65423 yesterday: "'yesterday at' p",
65424 today: "'today at' p",
65425 tomorrow: "'tomorrow at' p",
65426 nextWeek: "eeee 'at' p",
65427 other: "P",
65428};
65429
65430const formatRelative_formatRelative = (token, _date, _baseDate, _options) =>
65431 formatRelative_formatRelativeLocale[token];
65432
65433;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
65434/**
65435 * The localize function argument callback which allows to convert raw value to
65436 * the actual type.
65437 *
65438 * @param value - The value to convert
65439 *
65440 * @returns The converted value
65441 */
65442
65443/**
65444 * The map of localized values for each width.
65445 */
65446
65447/**
65448 * The index type of the locale unit value. It types conversion of units of
65449 * values that don't start at 0 (i.e. quarters).
65450 */
65451
65452/**
65453 * Converts the unit value to the tuple of values.
65454 */
65455
65456/**
65457 * The tuple of localized era values. The first element represents BC,
65458 * the second element represents AD.
65459 */
65460
65461/**
65462 * The tuple of localized quarter values. The first element represents Q1.
65463 */
65464
65465/**
65466 * The tuple of localized day values. The first element represents Sunday.
65467 */
65468
65469/**
65470 * The tuple of localized month values. The first element represents January.
65471 */
65472
65473function buildLocalizeFn_buildLocalizeFn(args) {
65474 return (value, options) => {
65475 const context = options?.context ? String(options.context) : "standalone";
65476
65477 let valuesArray;
65478 if (context === "formatting" && args.formattingValues) {
65479 const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
65480 const width = options?.width ? String(options.width) : defaultWidth;
65481
65482 valuesArray =
65483 args.formattingValues[width] || args.formattingValues[defaultWidth];
65484 } else {
65485 const defaultWidth = args.defaultWidth;
65486 const width = options?.width ? String(options.width) : args.defaultWidth;
65487
65488 valuesArray = args.values[width] || args.values[defaultWidth];
65489 }
65490 const index = args.argumentCallback ? args.argumentCallback(value) : value;
65491
65492 // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
65493 return valuesArray[index];
65494 };
65495}
65496
65497;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/localize.js
65498
65499
65500const localize_eraValues = {
65501 narrow: ["B", "A"],
65502 abbreviated: ["BC", "AD"],
65503 wide: ["Before Christ", "Anno Domini"],
65504};
65505
65506const localize_quarterValues = {
65507 narrow: ["1", "2", "3", "4"],
65508 abbreviated: ["Q1", "Q2", "Q3", "Q4"],
65509 wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
65510};
65511
65512// Note: in English, the names of days of the week and months are capitalized.
65513// If you are making a new locale based on this one, check if the same is true for the language you're working on.
65514// Generally, formatted dates should look like they are in the middle of a sentence,
65515// e.g. in Spanish language the weekdays and months should be in the lowercase.
65516const localize_monthValues = {
65517 narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
65518 abbreviated: [
65519 "Jan",
65520 "Feb",
65521 "Mar",
65522 "Apr",
65523 "May",
65524 "Jun",
65525 "Jul",
65526 "Aug",
65527 "Sep",
65528 "Oct",
65529 "Nov",
65530 "Dec",
65531 ],
65532
65533 wide: [
65534 "January",
65535 "February",
65536 "March",
65537 "April",
65538 "May",
65539 "June",
65540 "July",
65541 "August",
65542 "September",
65543 "October",
65544 "November",
65545 "December",
65546 ],
65547};
65548
65549const localize_dayValues = {
65550 narrow: ["S", "M", "T", "W", "T", "F", "S"],
65551 short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
65552 abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
65553 wide: [
65554 "Sunday",
65555 "Monday",
65556 "Tuesday",
65557 "Wednesday",
65558 "Thursday",
65559 "Friday",
65560 "Saturday",
65561 ],
65562};
65563
65564const localize_dayPeriodValues = {
65565 narrow: {
65566 am: "a",
65567 pm: "p",
65568 midnight: "mi",
65569 noon: "n",
65570 morning: "morning",
65571 afternoon: "afternoon",
65572 evening: "evening",
65573 night: "night",
65574 },
65575 abbreviated: {
65576 am: "AM",
65577 pm: "PM",
65578 midnight: "midnight",
65579 noon: "noon",
65580 morning: "morning",
65581 afternoon: "afternoon",
65582 evening: "evening",
65583 night: "night",
65584 },
65585 wide: {
65586 am: "a.m.",
65587 pm: "p.m.",
65588 midnight: "midnight",
65589 noon: "noon",
65590 morning: "morning",
65591 afternoon: "afternoon",
65592 evening: "evening",
65593 night: "night",
65594 },
65595};
65596
65597const localize_formattingDayPeriodValues = {
65598 narrow: {
65599 am: "a",
65600 pm: "p",
65601 midnight: "mi",
65602 noon: "n",
65603 morning: "in the morning",
65604 afternoon: "in the afternoon",
65605 evening: "in the evening",
65606 night: "at night",
65607 },
65608 abbreviated: {
65609 am: "AM",
65610 pm: "PM",
65611 midnight: "midnight",
65612 noon: "noon",
65613 morning: "in the morning",
65614 afternoon: "in the afternoon",
65615 evening: "in the evening",
65616 night: "at night",
65617 },
65618 wide: {
65619 am: "a.m.",
65620 pm: "p.m.",
65621 midnight: "midnight",
65622 noon: "noon",
65623 morning: "in the morning",
65624 afternoon: "in the afternoon",
65625 evening: "in the evening",
65626 night: "at night",
65627 },
65628};
65629
65630const localize_ordinalNumber = (dirtyNumber, _options) => {
65631 const number = Number(dirtyNumber);
65632
65633 // If ordinal numbers depend on context, for example,
65634 // if they are different for different grammatical genders,
65635 // use `options.unit`.
65636 //
65637 // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
65638 // 'day', 'hour', 'minute', 'second'.
65639
65640 const rem100 = number % 100;
65641 if (rem100 > 20 || rem100 < 10) {
65642 switch (rem100 % 10) {
65643 case 1:
65644 return number + "st";
65645 case 2:
65646 return number + "nd";
65647 case 3:
65648 return number + "rd";
65649 }
65650 }
65651 return number + "th";
65652};
65653
65654const localize_localize = {
65655 ordinalNumber: localize_ordinalNumber,
65656
65657 era: buildLocalizeFn_buildLocalizeFn({
65658 values: localize_eraValues,
65659 defaultWidth: "wide",
65660 }),
65661
65662 quarter: buildLocalizeFn_buildLocalizeFn({
65663 values: localize_quarterValues,
65664 defaultWidth: "wide",
65665 argumentCallback: (quarter) => quarter - 1,
65666 }),
65667
65668 month: buildLocalizeFn_buildLocalizeFn({
65669 values: localize_monthValues,
65670 defaultWidth: "wide",
65671 }),
65672
65673 day: buildLocalizeFn_buildLocalizeFn({
65674 values: localize_dayValues,
65675 defaultWidth: "wide",
65676 }),
65677
65678 dayPeriod: buildLocalizeFn_buildLocalizeFn({
65679 values: localize_dayPeriodValues,
65680 defaultWidth: "wide",
65681 formattingValues: localize_formattingDayPeriodValues,
65682 defaultFormattingWidth: "wide",
65683 }),
65684};
65685
65686;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildMatchFn.js
65687function buildMatchFn_buildMatchFn(args) {
65688 return (string, options = {}) => {
65689 const width = options.width;
65690
65691 const matchPattern =
65692 (width && args.matchPatterns[width]) ||
65693 args.matchPatterns[args.defaultMatchWidth];
65694 const matchResult = string.match(matchPattern);
65695
65696 if (!matchResult) {
65697 return null;
65698 }
65699 const matchedString = matchResult[0];
65700
65701 const parsePatterns =
65702 (width && args.parsePatterns[width]) ||
65703 args.parsePatterns[args.defaultParseWidth];
65704
65705 const key = Array.isArray(parsePatterns)
65706 ? buildMatchFn_findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
65707 : // [TODO] -- I challenge you to fix the type
65708 buildMatchFn_findKey(parsePatterns, (pattern) => pattern.test(matchedString));
65709
65710 let value;
65711
65712 value = args.valueCallback ? args.valueCallback(key) : key;
65713 value = options.valueCallback
65714 ? // [TODO] -- I challenge you to fix the type
65715 options.valueCallback(value)
65716 : value;
65717
65718 const rest = string.slice(matchedString.length);
65719
65720 return { value, rest };
65721 };
65722}
65723
65724function buildMatchFn_findKey(object, predicate) {
65725 for (const key in object) {
65726 if (
65727 Object.prototype.hasOwnProperty.call(object, key) &&
65728 predicate(object[key])
65729 ) {
65730 return key;
65731 }
65732 }
65733 return undefined;
65734}
65735
65736function buildMatchFn_findIndex(array, predicate) {
65737 for (let key = 0; key < array.length; key++) {
65738 if (predicate(array[key])) {
65739 return key;
65740 }
65741 }
65742 return undefined;
65743}
65744
65745;// ./node_modules/react-day-picker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
65746function buildMatchPatternFn_buildMatchPatternFn(args) {
65747 return (string, options = {}) => {
65748 const matchResult = string.match(args.matchPattern);
65749 if (!matchResult) return null;
65750 const matchedString = matchResult[0];
65751
65752 const parseResult = string.match(args.parsePattern);
65753 if (!parseResult) return null;
65754 let value = args.valueCallback
65755 ? args.valueCallback(parseResult[0])
65756 : parseResult[0];
65757
65758 // [TODO] I challenge you to fix the type
65759 value = options.valueCallback ? options.valueCallback(value) : value;
65760
65761 const rest = string.slice(matchedString.length);
65762
65763 return { value, rest };
65764 };
65765}
65766
65767;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US/_lib/match.js
65768
65769
65770
65771const match_matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
65772const match_parseOrdinalNumberPattern = /\d+/i;
65773
65774const match_matchEraPatterns = {
65775 narrow: /^(b|a)/i,
65776 abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
65777 wide: /^(before christ|before common era|anno domini|common era)/i,
65778};
65779const match_parseEraPatterns = {
65780 any: [/^b/i, /^(a|c)/i],
65781};
65782
65783const match_matchQuarterPatterns = {
65784 narrow: /^[1234]/i,
65785 abbreviated: /^q[1234]/i,
65786 wide: /^[1234](th|st|nd|rd)? quarter/i,
65787};
65788const match_parseQuarterPatterns = {
65789 any: [/1/i, /2/i, /3/i, /4/i],
65790};
65791
65792const match_matchMonthPatterns = {
65793 narrow: /^[jfmasond]/i,
65794 abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
65795 wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
65796};
65797const match_parseMonthPatterns = {
65798 narrow: [
65799 /^j/i,
65800 /^f/i,
65801 /^m/i,
65802 /^a/i,
65803 /^m/i,
65804 /^j/i,
65805 /^j/i,
65806 /^a/i,
65807 /^s/i,
65808 /^o/i,
65809 /^n/i,
65810 /^d/i,
65811 ],
65812
65813 any: [
65814 /^ja/i,
65815 /^f/i,
65816 /^mar/i,
65817 /^ap/i,
65818 /^may/i,
65819 /^jun/i,
65820 /^jul/i,
65821 /^au/i,
65822 /^s/i,
65823 /^o/i,
65824 /^n/i,
65825 /^d/i,
65826 ],
65827};
65828
65829const match_matchDayPatterns = {
65830 narrow: /^[smtwf]/i,
65831 short: /^(su|mo|tu|we|th|fr|sa)/i,
65832 abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
65833 wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
65834};
65835const match_parseDayPatterns = {
65836 narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
65837 any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
65838};
65839
65840const match_matchDayPeriodPatterns = {
65841 narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
65842 any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
65843};
65844const match_parseDayPeriodPatterns = {
65845 any: {
65846 am: /^a/i,
65847 pm: /^p/i,
65848 midnight: /^mi/i,
65849 noon: /^no/i,
65850 morning: /morning/i,
65851 afternoon: /afternoon/i,
65852 evening: /evening/i,
65853 night: /night/i,
65854 },
65855};
65856
65857const _lib_match_match = {
65858 ordinalNumber: buildMatchPatternFn_buildMatchPatternFn({
65859 matchPattern: match_matchOrdinalNumberPattern,
65860 parsePattern: match_parseOrdinalNumberPattern,
65861 valueCallback: (value) => parseInt(value, 10),
65862 }),
65863
65864 era: buildMatchFn_buildMatchFn({
65865 matchPatterns: match_matchEraPatterns,
65866 defaultMatchWidth: "wide",
65867 parsePatterns: match_parseEraPatterns,
65868 defaultParseWidth: "any",
65869 }),
65870
65871 quarter: buildMatchFn_buildMatchFn({
65872 matchPatterns: match_matchQuarterPatterns,
65873 defaultMatchWidth: "wide",
65874 parsePatterns: match_parseQuarterPatterns,
65875 defaultParseWidth: "any",
65876 valueCallback: (index) => index + 1,
65877 }),
65878
65879 month: buildMatchFn_buildMatchFn({
65880 matchPatterns: match_matchMonthPatterns,
65881 defaultMatchWidth: "wide",
65882 parsePatterns: match_parseMonthPatterns,
65883 defaultParseWidth: "any",
65884 }),
65885
65886 day: buildMatchFn_buildMatchFn({
65887 matchPatterns: match_matchDayPatterns,
65888 defaultMatchWidth: "wide",
65889 parsePatterns: match_parseDayPatterns,
65890 defaultParseWidth: "any",
65891 }),
65892
65893 dayPeriod: buildMatchFn_buildMatchFn({
65894 matchPatterns: match_matchDayPeriodPatterns,
65895 defaultMatchWidth: "any",
65896 parsePatterns: match_parseDayPeriodPatterns,
65897 defaultParseWidth: "any",
65898 }),
65899};
65900
65901;// ./node_modules/react-day-picker/node_modules/date-fns/locale/en-US.js
65902
65903
65904
65905
65906
65907
65908/**
65909 * @category Locales
65910 * @summary English locale (United States).
65911 * @language English
65912 * @iso-639-2 eng
65913 * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
65914 * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
65915 */
65916const en_US_enUS = {
65917 code: "en-US",
65918 formatDistance: formatDistance_formatDistance,
65919 formatLong: formatLong_formatLong,
65920 formatRelative: formatRelative_formatRelative,
65921 localize: localize_localize,
65922 match: _lib_match_match,
65923 options: {
65924 weekStartsOn: 0 /* Sunday */,
65925 firstWeekContainsDate: 1,
65926 },
65927};
65928
65929// Fallback for modularized imports:
65930/* harmony default export */ const locale_en_US = ((/* unused pure expression or super */ null && (en_US_enUS)));
65931
65932;// ./node_modules/react-day-picker/node_modules/date-fns/constants.js
65933/**
65934 * @module constants
65935 * @summary Useful constants
65936 * @description
65937 * Collection of useful date constants.
65938 *
65939 * The constants could be imported from `date-fns/constants`:
65940 *
65941 * ```ts
65942 * import { maxTime, minTime } from "./constants/date-fns/constants";
65943 *
65944 * function isAllowedTime(time) {
65945 * return time <= maxTime && time >= minTime;
65946 * }
65947 * ```
65948 */
65949
65950/**
65951 * @constant
65952 * @name daysInWeek
65953 * @summary Days in 1 week.
65954 */
65955const constants_daysInWeek = 7;
65956
65957/**
65958 * @constant
65959 * @name daysInYear
65960 * @summary Days in 1 year.
65961 *
65962 * @description
65963 * How many days in a year.
65964 *
65965 * One years equals 365.2425 days according to the formula:
65966 *
65967 * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
65968 * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
65969 */
65970const constants_daysInYear = 365.2425;
65971
65972/**
65973 * @constant
65974 * @name maxTime
65975 * @summary Maximum allowed time.
65976 *
65977 * @example
65978 * import { maxTime } from "./constants/date-fns/constants";
65979 *
65980 * const isValid = 8640000000000001 <= maxTime;
65981 * //=> false
65982 *
65983 * new Date(8640000000000001);
65984 * //=> Invalid Date
65985 */
65986const constants_maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
65987
65988/**
65989 * @constant
65990 * @name minTime
65991 * @summary Minimum allowed time.
65992 *
65993 * @example
65994 * import { minTime } from "./constants/date-fns/constants";
65995 *
65996 * const isValid = -8640000000000001 >= minTime;
65997 * //=> false
65998 *
65999 * new Date(-8640000000000001)
66000 * //=> Invalid Date
66001 */
66002const constants_minTime = -constants_maxTime;
66003
66004/**
66005 * @constant
66006 * @name millisecondsInWeek
66007 * @summary Milliseconds in 1 week.
66008 */
66009const constants_millisecondsInWeek = 604800000;
66010
66011/**
66012 * @constant
66013 * @name millisecondsInDay
66014 * @summary Milliseconds in 1 day.
66015 */
66016const constants_millisecondsInDay = 86400000;
66017
66018/**
66019 * @constant
66020 * @name millisecondsInMinute
66021 * @summary Milliseconds in 1 minute
66022 */
66023const constants_millisecondsInMinute = 60000;
66024
66025/**
66026 * @constant
66027 * @name millisecondsInHour
66028 * @summary Milliseconds in 1 hour
66029 */
66030const constants_millisecondsInHour = 3600000;
66031
66032/**
66033 * @constant
66034 * @name millisecondsInSecond
66035 * @summary Milliseconds in 1 second
66036 */
66037const constants_millisecondsInSecond = 1000;
66038
66039/**
66040 * @constant
66041 * @name minutesInYear
66042 * @summary Minutes in 1 year.
66043 */
66044const constants_minutesInYear = 525600;
66045
66046/**
66047 * @constant
66048 * @name minutesInMonth
66049 * @summary Minutes in 1 month.
66050 */
66051const constants_minutesInMonth = 43200;
66052
66053/**
66054 * @constant
66055 * @name minutesInDay
66056 * @summary Minutes in 1 day.
66057 */
66058const constants_minutesInDay = 1440;
66059
66060/**
66061 * @constant
66062 * @name minutesInHour
66063 * @summary Minutes in 1 hour.
66064 */
66065const constants_minutesInHour = 60;
66066
66067/**
66068 * @constant
66069 * @name monthsInQuarter
66070 * @summary Months in 1 quarter.
66071 */
66072const constants_monthsInQuarter = 3;
66073
66074/**
66075 * @constant
66076 * @name monthsInYear
66077 * @summary Months in 1 year.
66078 */
66079const constants_monthsInYear = 12;
66080
66081/**
66082 * @constant
66083 * @name quartersInYear
66084 * @summary Quarters in 1 year
66085 */
66086const constants_quartersInYear = 4;
66087
66088/**
66089 * @constant
66090 * @name secondsInHour
66091 * @summary Seconds in 1 hour.
66092 */
66093const constants_secondsInHour = 3600;
66094
66095/**
66096 * @constant
66097 * @name secondsInMinute
66098 * @summary Seconds in 1 minute.
66099 */
66100const constants_secondsInMinute = 60;
66101
66102/**
66103 * @constant
66104 * @name secondsInDay
66105 * @summary Seconds in 1 day.
66106 */
66107const constants_secondsInDay = constants_secondsInHour * 24;
66108
66109/**
66110 * @constant
66111 * @name secondsInWeek
66112 * @summary Seconds in 1 week.
66113 */
66114const constants_secondsInWeek = constants_secondsInDay * 7;
66115
66116/**
66117 * @constant
66118 * @name secondsInYear
66119 * @summary Seconds in 1 year.
66120 */
66121const constants_secondsInYear = constants_secondsInDay * constants_daysInYear;
66122
66123/**
66124 * @constant
66125 * @name secondsInMonth
66126 * @summary Seconds in 1 month
66127 */
66128const constants_secondsInMonth = constants_secondsInYear / 12;
66129
66130/**
66131 * @constant
66132 * @name secondsInQuarter
66133 * @summary Seconds in 1 quarter.
66134 */
66135const constants_secondsInQuarter = constants_secondsInMonth * 3;
66136
66137/**
66138 * @constant
66139 * @name constructFromSymbol
66140 * @summary Symbol enabling Date extensions to inherit properties from the reference date.
66141 *
66142 * The symbol is used to enable the `constructFrom` function to construct a date
66143 * using a reference date and a value. It allows to transfer extra properties
66144 * from the reference date to the new date. It's useful for extensions like
66145 * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
66146 * a constructor argument.
66147 */
66148const constants_constructFromSymbol = Symbol.for("constructDateFrom");
66149
66150;// ./node_modules/react-day-picker/node_modules/date-fns/constructFrom.js
66151
66152
66153/**
66154 * @name constructFrom
66155 * @category Generic Helpers
66156 * @summary Constructs a date using the reference date and the value
66157 *
66158 * @description
66159 * The function constructs a new date using the constructor from the reference
66160 * date and the given value. It helps to build generic functions that accept
66161 * date extensions.
66162 *
66163 * It defaults to `Date` if the passed reference date is a number or a string.
66164 *
66165 * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
66166 * enabling to transfer extra properties from the reference date to the new date.
66167 * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
66168 * that accept a time zone as a constructor argument.
66169 *
66170 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66171 *
66172 * @param date - The reference date to take constructor from
66173 * @param value - The value to create the date
66174 *
66175 * @returns Date initialized using the given date and value
66176 *
66177 * @example
66178 * import { constructFrom } from "./constructFrom/date-fns";
66179 *
66180 * // A function that clones a date preserving the original type
66181 * function cloneDate<DateType extends Date>(date: DateType): DateType {
66182 * return constructFrom(
66183 * date, // Use constructor from the given date
66184 * date.getTime() // Use the date value to create a new date
66185 * );
66186 * }
66187 */
66188function constructFrom_constructFrom(date, value) {
66189 if (typeof date === "function") return date(value);
66190
66191 if (date && typeof date === "object" && constants_constructFromSymbol in date)
66192 return date[constants_constructFromSymbol](value);
66193
66194 if (date instanceof Date) return new date.constructor(value);
66195
66196 return new Date(value);
66197}
66198
66199// Fallback for modularized imports:
66200/* harmony default export */ const node_modules_date_fns_constructFrom = ((/* unused pure expression or super */ null && (constructFrom_constructFrom)));
66201
66202;// ./node_modules/react-day-picker/node_modules/date-fns/toDate.js
66203
66204
66205/**
66206 * @name toDate
66207 * @category Common Helpers
66208 * @summary Convert the given argument to an instance of Date.
66209 *
66210 * @description
66211 * Convert the given argument to an instance of Date.
66212 *
66213 * If the argument is an instance of Date, the function returns its clone.
66214 *
66215 * If the argument is a number, it is treated as a timestamp.
66216 *
66217 * If the argument is none of the above, the function returns Invalid Date.
66218 *
66219 * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
66220 * enabling to transfer extra properties from the reference date to the new date.
66221 * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
66222 * that accept a time zone as a constructor argument.
66223 *
66224 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
66225 *
66226 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66227 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66228 *
66229 * @param argument - The value to convert
66230 *
66231 * @returns The parsed date in the local time zone
66232 *
66233 * @example
66234 * // Clone the date:
66235 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
66236 * //=> Tue Feb 11 2014 11:30:30
66237 *
66238 * @example
66239 * // Convert the timestamp to date:
66240 * const result = toDate(1392098430000)
66241 * //=> Tue Feb 11 2014 11:30:30
66242 */
66243function toDate_toDate(argument, context) {
66244 // [TODO] Get rid of `toDate` or `constructFrom`?
66245 return constructFrom_constructFrom(context || argument, argument);
66246}
66247
66248// Fallback for modularized imports:
66249/* harmony default export */ const node_modules_date_fns_toDate = ((/* unused pure expression or super */ null && (toDate_toDate)));
66250
66251;// ./node_modules/react-day-picker/node_modules/date-fns/addDays.js
66252
66253
66254
66255/**
66256 * The {@link addDays} function options.
66257 */
66258
66259/**
66260 * @name addDays
66261 * @category Day Helpers
66262 * @summary Add the specified number of days to the given date.
66263 *
66264 * @description
66265 * Add the specified number of days to the given date.
66266 *
66267 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66268 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66269 *
66270 * @param date - The date to be changed
66271 * @param amount - The amount of days to be added.
66272 * @param options - An object with options
66273 *
66274 * @returns The new date with the days added
66275 *
66276 * @example
66277 * // Add 10 days to 1 September 2014:
66278 * const result = addDays(new Date(2014, 8, 1), 10)
66279 * //=> Thu Sep 11 2014 00:00:00
66280 */
66281function addDays_addDays(date, amount, options) {
66282 const _date = toDate_toDate(date, options?.in);
66283 if (isNaN(amount)) return constructFrom_constructFrom(options?.in || date, NaN);
66284
66285 // If 0 days, no-op to avoid changing times in the hour before end of DST
66286 if (!amount) return _date;
66287
66288 _date.setDate(_date.getDate() + amount);
66289 return _date;
66290}
66291
66292// Fallback for modularized imports:
66293/* harmony default export */ const node_modules_date_fns_addDays = ((/* unused pure expression or super */ null && (addDays_addDays)));
66294
66295;// ./node_modules/react-day-picker/node_modules/date-fns/addMonths.js
66296
66297
66298
66299/**
66300 * The {@link addMonths} function options.
66301 */
66302
66303/**
66304 * @name addMonths
66305 * @category Month Helpers
66306 * @summary Add the specified number of months to the given date.
66307 *
66308 * @description
66309 * Add the specified number of months to the given date.
66310 *
66311 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66312 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66313 *
66314 * @param date - The date to be changed
66315 * @param amount - The amount of months to be added.
66316 * @param options - The options object
66317 *
66318 * @returns The new date with the months added
66319 *
66320 * @example
66321 * // Add 5 months to 1 September 2014:
66322 * const result = addMonths(new Date(2014, 8, 1), 5)
66323 * //=> Sun Feb 01 2015 00:00:00
66324 *
66325 * // Add one month to 30 January 2023:
66326 * const result = addMonths(new Date(2023, 0, 30), 1)
66327 * //=> Tue Feb 28 2023 00:00:00
66328 */
66329function addMonths_addMonths(date, amount, options) {
66330 const _date = toDate_toDate(date, options?.in);
66331 if (isNaN(amount)) return constructFrom_constructFrom(options?.in || date, NaN);
66332 if (!amount) {
66333 // If 0 months, no-op to avoid changing times in the hour before end of DST
66334 return _date;
66335 }
66336 const dayOfMonth = _date.getDate();
66337
66338 // The JS Date object supports date math by accepting out-of-bounds values for
66339 // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
66340 // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
66341 // want except that dates will wrap around the end of a month, meaning that
66342 // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
66343 // we'll default to the end of the desired month by adding 1 to the desired
66344 // month and using a date of 0 to back up one day to the end of the desired
66345 // month.
66346 const endOfDesiredMonth = constructFrom_constructFrom(options?.in || date, _date.getTime());
66347 endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
66348 const daysInMonth = endOfDesiredMonth.getDate();
66349 if (dayOfMonth >= daysInMonth) {
66350 // If we're already at the end of the month, then this is the correct date
66351 // and we're done.
66352 return endOfDesiredMonth;
66353 } else {
66354 // Otherwise, we now know that setting the original day-of-month value won't
66355 // cause an overflow, so set the desired day-of-month. Note that we can't
66356 // just set the date of `endOfDesiredMonth` because that object may have had
66357 // its time changed in the unusual case where where a DST transition was on
66358 // the last day of the month and its local time was in the hour skipped or
66359 // repeated next to a DST transition. So we use `date` instead which is
66360 // guaranteed to still have the original time.
66361 _date.setFullYear(
66362 endOfDesiredMonth.getFullYear(),
66363 endOfDesiredMonth.getMonth(),
66364 dayOfMonth,
66365 );
66366 return _date;
66367 }
66368}
66369
66370// Fallback for modularized imports:
66371/* harmony default export */ const node_modules_date_fns_addMonths = ((/* unused pure expression or super */ null && (addMonths_addMonths)));
66372
66373;// ./node_modules/react-day-picker/node_modules/date-fns/addWeeks.js
66374
66375
66376/**
66377 * The {@link addWeeks} function options.
66378 */
66379
66380/**
66381 * @name addWeeks
66382 * @category Week Helpers
66383 * @summary Add the specified number of weeks to the given date.
66384 *
66385 * @description
66386 * Add the specified number of weeks to the given date.
66387 *
66388 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66389 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66390 *
66391 * @param date - The date to be changed
66392 * @param amount - The amount of weeks to be added.
66393 * @param options - An object with options
66394 *
66395 * @returns The new date with the weeks added
66396 *
66397 * @example
66398 * // Add 4 weeks to 1 September 2014:
66399 * const result = addWeeks(new Date(2014, 8, 1), 4)
66400 * //=> Mon Sep 29 2014 00:00:00
66401 */
66402function addWeeks_addWeeks(date, amount, options) {
66403 return addDays_addDays(date, amount * 7, options);
66404}
66405
66406// Fallback for modularized imports:
66407/* harmony default export */ const node_modules_date_fns_addWeeks = ((/* unused pure expression or super */ null && (addWeeks_addWeeks)));
66408
66409;// ./node_modules/react-day-picker/node_modules/date-fns/addYears.js
66410
66411
66412/**
66413 * The {@link addYears} function options.
66414 */
66415
66416/**
66417 * @name addYears
66418 * @category Year Helpers
66419 * @summary Add the specified number of years to the given date.
66420 *
66421 * @description
66422 * Add the specified number of years to the given date.
66423 *
66424 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66425 * @typeParam ResultDate - The result `Date` type.
66426 *
66427 * @param date - The date to be changed
66428 * @param amount - The amount of years to be added.
66429 * @param options - The options
66430 *
66431 * @returns The new date with the years added
66432 *
66433 * @example
66434 * // Add 5 years to 1 September 2014:
66435 * const result = addYears(new Date(2014, 8, 1), 5)
66436 * //=> Sun Sep 01 2019 00:00:00
66437 */
66438function addYears_addYears(date, amount, options) {
66439 return addMonths_addMonths(date, amount * 12, options);
66440}
66441
66442// Fallback for modularized imports:
66443/* harmony default export */ const node_modules_date_fns_addYears = ((/* unused pure expression or super */ null && (addYears_addYears)));
66444
66445;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
66446
66447
66448/**
66449 * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
66450 * They usually appear for dates that denote time before the timezones were introduced
66451 * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
66452 * and GMT+01:00:00 after that date)
66453 *
66454 * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
66455 * which would lead to incorrect calculations.
66456 *
66457 * This function returns the timezone offset in milliseconds that takes seconds in account.
66458 */
66459function getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(date) {
66460 const _date = toDate_toDate(date);
66461 const utcDate = new Date(
66462 Date.UTC(
66463 _date.getFullYear(),
66464 _date.getMonth(),
66465 _date.getDate(),
66466 _date.getHours(),
66467 _date.getMinutes(),
66468 _date.getSeconds(),
66469 _date.getMilliseconds(),
66470 ),
66471 );
66472 utcDate.setUTCFullYear(_date.getFullYear());
66473 return +date - +utcDate;
66474}
66475
66476;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/normalizeDates.js
66477
66478
66479function normalizeDates(context, ...dates) {
66480 const normalize = constructFrom_constructFrom.bind(
66481 null,
66482 context || dates.find((date) => typeof date === "object"),
66483 );
66484 return dates.map(normalize);
66485}
66486
66487;// ./node_modules/react-day-picker/node_modules/date-fns/startOfDay.js
66488
66489
66490/**
66491 * The {@link startOfDay} function options.
66492 */
66493
66494/**
66495 * @name startOfDay
66496 * @category Day Helpers
66497 * @summary Return the start of a day for the given date.
66498 *
66499 * @description
66500 * Return the start of a day for the given date.
66501 * The result will be in the local timezone.
66502 *
66503 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66504 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66505 *
66506 * @param date - The original date
66507 * @param options - The options
66508 *
66509 * @returns The start of a day
66510 *
66511 * @example
66512 * // The start of a day for 2 September 2014 11:55:00:
66513 * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
66514 * //=> Tue Sep 02 2014 00:00:00
66515 */
66516function startOfDay_startOfDay(date, options) {
66517 const _date = toDate_toDate(date, options?.in);
66518 _date.setHours(0, 0, 0, 0);
66519 return _date;
66520}
66521
66522// Fallback for modularized imports:
66523/* harmony default export */ const node_modules_date_fns_startOfDay = ((/* unused pure expression or super */ null && (startOfDay_startOfDay)));
66524
66525;// ./node_modules/react-day-picker/node_modules/date-fns/differenceInCalendarDays.js
66526
66527
66528
66529
66530
66531/**
66532 * The {@link differenceInCalendarDays} function options.
66533 */
66534
66535/**
66536 * @name differenceInCalendarDays
66537 * @category Day Helpers
66538 * @summary Get the number of calendar days between the given dates.
66539 *
66540 * @description
66541 * Get the number of calendar days between the given dates. This means that the times are removed
66542 * from the dates and then the difference in days is calculated.
66543 *
66544 * @param laterDate - The later date
66545 * @param earlierDate - The earlier date
66546 * @param options - The options object
66547 *
66548 * @returns The number of calendar days
66549 *
66550 * @example
66551 * // How many calendar days are between
66552 * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
66553 * const result = differenceInCalendarDays(
66554 * new Date(2012, 6, 2, 0, 0),
66555 * new Date(2011, 6, 2, 23, 0)
66556 * )
66557 * //=> 366
66558 * // How many calendar days are between
66559 * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
66560 * const result = differenceInCalendarDays(
66561 * new Date(2011, 6, 3, 0, 1),
66562 * new Date(2011, 6, 2, 23, 59)
66563 * )
66564 * //=> 1
66565 */
66566function differenceInCalendarDays_differenceInCalendarDays(laterDate, earlierDate, options) {
66567 const [laterDate_, earlierDate_] = normalizeDates(
66568 options?.in,
66569 laterDate,
66570 earlierDate,
66571 );
66572
66573 const laterStartOfDay = startOfDay_startOfDay(laterDate_);
66574 const earlierStartOfDay = startOfDay_startOfDay(earlierDate_);
66575
66576 const laterTimestamp =
66577 +laterStartOfDay - getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(laterStartOfDay);
66578 const earlierTimestamp =
66579 +earlierStartOfDay - getTimezoneOffsetInMilliseconds_getTimezoneOffsetInMilliseconds(earlierStartOfDay);
66580
66581 // Round the number of days to the nearest integer because the number of
66582 // milliseconds in a day is not constant (e.g. it's different in the week of
66583 // the daylight saving time clock shift).
66584 return Math.round((laterTimestamp - earlierTimestamp) / constants_millisecondsInDay);
66585}
66586
66587// Fallback for modularized imports:
66588/* harmony default export */ const node_modules_date_fns_differenceInCalendarDays = ((/* unused pure expression or super */ null && (differenceInCalendarDays_differenceInCalendarDays)));
66589
66590;// ./node_modules/react-day-picker/node_modules/date-fns/differenceInCalendarMonths.js
66591
66592
66593/**
66594 * The {@link differenceInCalendarMonths} function options.
66595 */
66596
66597/**
66598 * @name differenceInCalendarMonths
66599 * @category Month Helpers
66600 * @summary Get the number of calendar months between the given dates.
66601 *
66602 * @description
66603 * Get the number of calendar months between the given dates.
66604 *
66605 * @param laterDate - The later date
66606 * @param earlierDate - The earlier date
66607 * @param options - An object with options
66608 *
66609 * @returns The number of calendar months
66610 *
66611 * @example
66612 * // How many calendar months are between 31 January 2014 and 1 September 2014?
66613 * const result = differenceInCalendarMonths(
66614 * new Date(2014, 8, 1),
66615 * new Date(2014, 0, 31)
66616 * )
66617 * //=> 8
66618 */
66619function differenceInCalendarMonths(laterDate, earlierDate, options) {
66620 const [laterDate_, earlierDate_] = normalizeDates(
66621 options?.in,
66622 laterDate,
66623 earlierDate,
66624 );
66625
66626 const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
66627 const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
66628
66629 return yearsDiff * 12 + monthsDiff;
66630}
66631
66632// Fallback for modularized imports:
66633/* harmony default export */ const date_fns_differenceInCalendarMonths = ((/* unused pure expression or super */ null && (differenceInCalendarMonths)));
66634
66635;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/normalizeInterval.js
66636
66637
66638function normalizeInterval(context, interval) {
66639 const [start, end] = normalizeDates(context, interval.start, interval.end);
66640 return { start, end };
66641}
66642
66643;// ./node_modules/react-day-picker/node_modules/date-fns/eachMonthOfInterval.js
66644
66645
66646
66647/**
66648 * The {@link eachMonthOfInterval} function options.
66649 */
66650
66651/**
66652 * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.
66653 */
66654
66655/**
66656 * @name eachMonthOfInterval
66657 * @category Interval Helpers
66658 * @summary Return the array of months within the specified time interval.
66659 *
66660 * @description
66661 * Return the array of months within the specified time interval.
66662 *
66663 * @typeParam IntervalType - Interval type.
66664 * @typeParam Options - Options type.
66665 *
66666 * @param interval - The interval.
66667 * @param options - An object with options.
66668 *
66669 * @returns The array with starts of months from the month of the interval start to the month of the interval end
66670 *
66671 * @example
66672 * // Each month between 6 February 2014 and 10 August 2014:
66673 * const result = eachMonthOfInterval({
66674 * start: new Date(2014, 1, 6),
66675 * end: new Date(2014, 7, 10)
66676 * })
66677 * //=> [
66678 * // Sat Feb 01 2014 00:00:00,
66679 * // Sat Mar 01 2014 00:00:00,
66680 * // Tue Apr 01 2014 00:00:00,
66681 * // Thu May 01 2014 00:00:00,
66682 * // Sun Jun 01 2014 00:00:00,
66683 * // Tue Jul 01 2014 00:00:00,
66684 * // Fri Aug 01 2014 00:00:00
66685 * // ]
66686 */
66687function eachMonthOfInterval_eachMonthOfInterval(interval, options) {
66688 const { start, end } = normalizeInterval(options?.in, interval);
66689
66690 let reversed = +start > +end;
66691 const endTime = reversed ? +start : +end;
66692 const date = reversed ? end : start;
66693 date.setHours(0, 0, 0, 0);
66694 date.setDate(1);
66695
66696 let step = options?.step ?? 1;
66697 if (!step) return [];
66698 if (step < 0) {
66699 step = -step;
66700 reversed = !reversed;
66701 }
66702
66703 const dates = [];
66704
66705 while (+date <= endTime) {
66706 dates.push(constructFrom_constructFrom(start, date));
66707 date.setMonth(date.getMonth() + step);
66708 }
66709
66710 return reversed ? dates.reverse() : dates;
66711}
66712
66713// Fallback for modularized imports:
66714/* harmony default export */ const node_modules_date_fns_eachMonthOfInterval = ((/* unused pure expression or super */ null && (eachMonthOfInterval_eachMonthOfInterval)));
66715
66716;// ./node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js
66717
66718
66719
66720/**
66721 * The {@link eachYearOfInterval} function options.
66722 */
66723
66724/**
66725 * The {@link eachYearOfInterval} function result type. It resolves the proper data type.
66726 * It uses the first argument date object type, starting from the date argument,
66727 * then the start interval date, and finally the end interval date. If
66728 * a context function is passed, it uses the context function return type.
66729 */
66730
66731/**
66732 * @name eachYearOfInterval
66733 * @category Interval Helpers
66734 * @summary Return the array of yearly timestamps within the specified time interval.
66735 *
66736 * @description
66737 * Return the array of yearly timestamps within the specified time interval.
66738 *
66739 * @typeParam IntervalType - Interval type.
66740 * @typeParam Options - Options type.
66741 *
66742 * @param interval - The interval.
66743 * @param options - An object with options.
66744 *
66745 * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
66746 *
66747 * @example
66748 * // Each year between 6 February 2014 and 10 August 2017:
66749 * const result = eachYearOfInterval({
66750 * start: new Date(2014, 1, 6),
66751 * end: new Date(2017, 7, 10)
66752 * })
66753 * //=> [
66754 * // Wed Jan 01 2014 00:00:00,
66755 * // Thu Jan 01 2015 00:00:00,
66756 * // Fri Jan 01 2016 00:00:00,
66757 * // Sun Jan 01 2017 00:00:00
66758 * // ]
66759 */
66760function eachYearOfInterval(interval, options) {
66761 const { start, end } = normalizeInterval(options?.in, interval);
66762
66763 let reversed = +start > +end;
66764 const endTime = reversed ? +start : +end;
66765 const date = reversed ? end : start;
66766 date.setHours(0, 0, 0, 0);
66767 date.setMonth(0, 1);
66768
66769 let step = options?.step ?? 1;
66770 if (!step) return [];
66771 if (step < 0) {
66772 step = -step;
66773 reversed = !reversed;
66774 }
66775
66776 const dates = [];
66777
66778 while (+date <= endTime) {
66779 dates.push(constructFrom_constructFrom(start, date));
66780 date.setFullYear(date.getFullYear() + step);
66781 }
66782
66783 return reversed ? dates.reverse() : dates;
66784}
66785
66786// Fallback for modularized imports:
66787/* harmony default export */ const date_fns_eachYearOfInterval = ((/* unused pure expression or super */ null && (eachYearOfInterval)));
66788
66789;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/defaultOptions.js
66790let _lib_defaultOptions_defaultOptions = {};
66791
66792function defaultOptions_getDefaultOptions() {
66793 return _lib_defaultOptions_defaultOptions;
66794}
66795
66796function defaultOptions_setDefaultOptions(newOptions) {
66797 _lib_defaultOptions_defaultOptions = newOptions;
66798}
66799
66800;// ./node_modules/react-day-picker/node_modules/date-fns/endOfWeek.js
66801
66802
66803
66804/**
66805 * The {@link endOfWeek} function options.
66806 */
66807
66808/**
66809 * @name endOfWeek
66810 * @category Week Helpers
66811 * @summary Return the end of a week for the given date.
66812 *
66813 * @description
66814 * Return the end of a week for the given date.
66815 * The result will be in the local timezone.
66816 *
66817 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66818 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66819 *
66820 * @param date - The original date
66821 * @param options - An object with options
66822 *
66823 * @returns The end of a week
66824 *
66825 * @example
66826 * // The end of a week for 2 September 2014 11:55:00:
66827 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
66828 * //=> Sat Sep 06 2014 23:59:59.999
66829 *
66830 * @example
66831 * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
66832 * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
66833 * //=> Sun Sep 07 2014 23:59:59.999
66834 */
66835function endOfWeek_endOfWeek(date, options) {
66836 const defaultOptions = defaultOptions_getDefaultOptions();
66837 const weekStartsOn =
66838 options?.weekStartsOn ??
66839 options?.locale?.options?.weekStartsOn ??
66840 defaultOptions.weekStartsOn ??
66841 defaultOptions.locale?.options?.weekStartsOn ??
66842 0;
66843
66844 const _date = toDate_toDate(date, options?.in);
66845 const day = _date.getDay();
66846 const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
66847
66848 _date.setDate(_date.getDate() + diff);
66849 _date.setHours(23, 59, 59, 999);
66850 return _date;
66851}
66852
66853// Fallback for modularized imports:
66854/* harmony default export */ const node_modules_date_fns_endOfWeek = ((/* unused pure expression or super */ null && (endOfWeek_endOfWeek)));
66855
66856;// ./node_modules/react-day-picker/node_modules/date-fns/endOfISOWeek.js
66857
66858
66859/**
66860 * The {@link endOfISOWeek} function options.
66861 */
66862
66863/**
66864 * @name endOfISOWeek
66865 * @category ISO Week Helpers
66866 * @summary Return the end of an ISO week for the given date.
66867 *
66868 * @description
66869 * Return the end of an ISO week for the given date.
66870 * The result will be in the local timezone.
66871 *
66872 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
66873 *
66874 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66875 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66876 *
66877 * @param date - The original date
66878 * @param options - An object with options
66879 *
66880 * @returns The end of an ISO week
66881 *
66882 * @example
66883 * // The end of an ISO week for 2 September 2014 11:55:00:
66884 * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
66885 * //=> Sun Sep 07 2014 23:59:59.999
66886 */
66887function endOfISOWeek(date, options) {
66888 return endOfWeek_endOfWeek(date, { ...options, weekStartsOn: 1 });
66889}
66890
66891// Fallback for modularized imports:
66892/* harmony default export */ const date_fns_endOfISOWeek = ((/* unused pure expression or super */ null && (endOfISOWeek)));
66893
66894;// ./node_modules/react-day-picker/node_modules/date-fns/endOfMonth.js
66895
66896
66897/**
66898 * The {@link endOfMonth} function options.
66899 */
66900
66901/**
66902 * @name endOfMonth
66903 * @category Month Helpers
66904 * @summary Return the end of a month for the given date.
66905 *
66906 * @description
66907 * Return the end of a month for the given date.
66908 * The result will be in the local timezone.
66909 *
66910 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66911 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66912 *
66913 * @param date - The original date
66914 * @param options - An object with options
66915 *
66916 * @returns The end of a month
66917 *
66918 * @example
66919 * // The end of a month for 2 September 2014 11:55:00:
66920 * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
66921 * //=> Tue Sep 30 2014 23:59:59.999
66922 */
66923function endOfMonth_endOfMonth(date, options) {
66924 const _date = toDate_toDate(date, options?.in);
66925 const month = _date.getMonth();
66926 _date.setFullYear(_date.getFullYear(), month + 1, 0);
66927 _date.setHours(23, 59, 59, 999);
66928 return _date;
66929}
66930
66931// Fallback for modularized imports:
66932/* harmony default export */ const node_modules_date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth_endOfMonth)));
66933
66934;// ./node_modules/react-day-picker/node_modules/date-fns/endOfYear.js
66935
66936
66937/**
66938 * The {@link endOfYear} function options.
66939 */
66940
66941/**
66942 * @name endOfYear
66943 * @category Year Helpers
66944 * @summary Return the end of a year for the given date.
66945 *
66946 * @description
66947 * Return the end of a year for the given date.
66948 * The result will be in the local timezone.
66949 *
66950 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66951 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66952 *
66953 * @param date - The original date
66954 * @param options - The options
66955 *
66956 * @returns The end of a year
66957 *
66958 * @example
66959 * // The end of a year for 2 September 2014 11:55:00:
66960 * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))
66961 * //=> Wed Dec 31 2014 23:59:59.999
66962 */
66963function endOfYear(date, options) {
66964 const _date = toDate_toDate(date, options?.in);
66965 const year = _date.getFullYear();
66966 _date.setFullYear(year + 1, 0, 0);
66967 _date.setHours(23, 59, 59, 999);
66968 return _date;
66969}
66970
66971// Fallback for modularized imports:
66972/* harmony default export */ const date_fns_endOfYear = ((/* unused pure expression or super */ null && (endOfYear)));
66973
66974;// ./node_modules/react-day-picker/node_modules/date-fns/startOfYear.js
66975
66976
66977/**
66978 * The {@link startOfYear} function options.
66979 */
66980
66981/**
66982 * @name startOfYear
66983 * @category Year Helpers
66984 * @summary Return the start of a year for the given date.
66985 *
66986 * @description
66987 * Return the start of a year for the given date.
66988 * The result will be in the local timezone.
66989 *
66990 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
66991 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
66992 *
66993 * @param date - The original date
66994 * @param options - The options
66995 *
66996 * @returns The start of a year
66997 *
66998 * @example
66999 * // The start of a year for 2 September 2014 11:55:00:
67000 * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
67001 * //=> Wed Jan 01 2014 00:00:00
67002 */
67003function startOfYear_startOfYear(date, options) {
67004 const date_ = toDate_toDate(date, options?.in);
67005 date_.setFullYear(date_.getFullYear(), 0, 1);
67006 date_.setHours(0, 0, 0, 0);
67007 return date_;
67008}
67009
67010// Fallback for modularized imports:
67011/* harmony default export */ const node_modules_date_fns_startOfYear = ((/* unused pure expression or super */ null && (startOfYear_startOfYear)));
67012
67013;// ./node_modules/react-day-picker/node_modules/date-fns/getDayOfYear.js
67014
67015
67016
67017
67018/**
67019 * The {@link getDayOfYear} function options.
67020 */
67021
67022/**
67023 * @name getDayOfYear
67024 * @category Day Helpers
67025 * @summary Get the day of the year of the given date.
67026 *
67027 * @description
67028 * Get the day of the year of the given date.
67029 *
67030 * @param date - The given date
67031 * @param options - The options
67032 *
67033 * @returns The day of year
67034 *
67035 * @example
67036 * // Which day of the year is 2 July 2014?
67037 * const result = getDayOfYear(new Date(2014, 6, 2))
67038 * //=> 183
67039 */
67040function getDayOfYear_getDayOfYear(date, options) {
67041 const _date = toDate_toDate(date, options?.in);
67042 const diff = differenceInCalendarDays_differenceInCalendarDays(_date, startOfYear_startOfYear(_date));
67043 const dayOfYear = diff + 1;
67044 return dayOfYear;
67045}
67046
67047// Fallback for modularized imports:
67048/* harmony default export */ const node_modules_date_fns_getDayOfYear = ((/* unused pure expression or super */ null && (getDayOfYear_getDayOfYear)));
67049
67050;// ./node_modules/react-day-picker/node_modules/date-fns/startOfWeek.js
67051
67052
67053
67054/**
67055 * The {@link startOfWeek} function options.
67056 */
67057
67058/**
67059 * @name startOfWeek
67060 * @category Week Helpers
67061 * @summary Return the start of a week for the given date.
67062 *
67063 * @description
67064 * Return the start of a week for the given date.
67065 * The result will be in the local timezone.
67066 *
67067 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
67068 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
67069 *
67070 * @param date - The original date
67071 * @param options - An object with options
67072 *
67073 * @returns The start of a week
67074 *
67075 * @example
67076 * // The start of a week for 2 September 2014 11:55:00:
67077 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
67078 * //=> Sun Aug 31 2014 00:00:00
67079 *
67080 * @example
67081 * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
67082 * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
67083 * //=> Mon Sep 01 2014 00:00:00
67084 */
67085function startOfWeek_startOfWeek(date, options) {
67086 const defaultOptions = defaultOptions_getDefaultOptions();
67087 const weekStartsOn =
67088 options?.weekStartsOn ??
67089 options?.locale?.options?.weekStartsOn ??
67090 defaultOptions.weekStartsOn ??
67091 defaultOptions.locale?.options?.weekStartsOn ??
67092 0;
67093
67094 const _date = toDate_toDate(date, options?.in);
67095 const day = _date.getDay();
67096 const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
67097
67098 _date.setDate(_date.getDate() - diff);
67099 _date.setHours(0, 0, 0, 0);
67100 return _date;
67101}
67102
67103// Fallback for modularized imports:
67104/* harmony default export */ const node_modules_date_fns_startOfWeek = ((/* unused pure expression or super */ null && (startOfWeek_startOfWeek)));
67105
67106;// ./node_modules/react-day-picker/node_modules/date-fns/startOfISOWeek.js
67107
67108
67109/**
67110 * The {@link startOfISOWeek} function options.
67111 */
67112
67113/**
67114 * @name startOfISOWeek
67115 * @category ISO Week Helpers
67116 * @summary Return the start of an ISO week for the given date.
67117 *
67118 * @description
67119 * Return the start of an ISO week for the given date.
67120 * The result will be in the local timezone.
67121 *
67122 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
67123 *
67124 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
67125 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
67126 *
67127 * @param date - The original date
67128 * @param options - An object with options
67129 *
67130 * @returns The start of an ISO week
67131 *
67132 * @example
67133 * // The start of an ISO week for 2 September 2014 11:55:00:
67134 * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
67135 * //=> Mon Sep 01 2014 00:00:00
67136 */
67137function startOfISOWeek_startOfISOWeek(date, options) {
67138 return startOfWeek_startOfWeek(date, { ...options, weekStartsOn: 1 });
67139}
67140
67141// Fallback for modularized imports:
67142/* harmony default export */ const node_modules_date_fns_startOfISOWeek = ((/* unused pure expression or super */ null && (startOfISOWeek_startOfISOWeek)));
67143
67144;// ./node_modules/react-day-picker/node_modules/date-fns/getISOWeekYear.js
67145
67146
67147
67148
67149/**
67150 * The {@link getISOWeekYear} function options.
67151 */
67152
67153/**
67154 * @name getISOWeekYear
67155 * @category ISO Week-Numbering Year Helpers
67156 * @summary Get the ISO week-numbering year of the given date.
67157 *
67158 * @description
67159 * Get the ISO week-numbering year of the given date,
67160 * which always starts 3 days before the year's first Thursday.
67161 *
67162 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
67163 *
67164 * @param date - The given date
67165 *
67166 * @returns The ISO week-numbering year
67167 *
67168 * @example
67169 * // Which ISO-week numbering year is 2 January 2005?
67170 * const result = getISOWeekYear(new Date(2005, 0, 2))
67171 * //=> 2004
67172 */
67173function getISOWeekYear_getISOWeekYear(date, options) {
67174 const _date = toDate_toDate(date, options?.in);
67175 const year = _date.getFullYear();
67176
67177 const fourthOfJanuaryOfNextYear = constructFrom_constructFrom(_date, 0);
67178 fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
67179 fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
67180 const startOfNextYear = startOfISOWeek_startOfISOWeek(fourthOfJanuaryOfNextYear);
67181
67182 const fourthOfJanuaryOfThisYear = constructFrom_constructFrom(_date, 0);
67183 fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
67184 fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
67185 const startOfThisYear = startOfISOWeek_startOfISOWeek(fourthOfJanuaryOfThisYear);
67186
67187 if (_date.getTime() >= startOfNextYear.getTime()) {
67188 return year + 1;
67189 } else if (_date.getTime() >= startOfThisYear.getTime()) {
67190 return year;
67191 } else {
67192 return year - 1;
67193 }
67194}
67195
67196// Fallback for modularized imports:
67197/* harmony default export */ const node_modules_date_fns_getISOWeekYear = ((/* unused pure expression or super */ null && (getISOWeekYear_getISOWeekYear)));
67198
67199;// ./node_modules/react-day-picker/node_modules/date-fns/startOfISOWeekYear.js
67200
67201
67202
67203
67204/**
67205 * The {@link startOfISOWeekYear} function options.
67206 */
67207
67208/**
67209 * @name startOfISOWeekYear
67210 * @category ISO Week-Numbering Year Helpers
67211 * @summary Return the start of an ISO week-numbering year for the given date.
67212 *
67213 * @description
67214 * Return the start of an ISO week-numbering year,
67215 * which always starts 3 days before the year's first Thursday.
67216 * The result will be in the local timezone.
67217 *
67218 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
67219 *
67220 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
67221 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
67222 *
67223 * @param date - The original date
67224 * @param options - An object with options
67225 *
67226 * @returns The start of an ISO week-numbering year
67227 *
67228 * @example
67229 * // The start of an ISO week-numbering year for 2 July 2005:
67230 * const result = startOfISOWeekYear(new Date(2005, 6, 2))
67231 * //=> Mon Jan 03 2005 00:00:00
67232 */
67233function startOfISOWeekYear_startOfISOWeekYear(date, options) {
67234 const year = getISOWeekYear_getISOWeekYear(date, options);
67235 const fourthOfJanuary = constructFrom_constructFrom(options?.in || date, 0);
67236 fourthOfJanuary.setFullYear(year, 0, 4);
67237 fourthOfJanuary.setHours(0, 0, 0, 0);
67238 return startOfISOWeek_startOfISOWeek(fourthOfJanuary);
67239}
67240
67241// Fallback for modularized imports:
67242/* harmony default export */ const node_modules_date_fns_startOfISOWeekYear = ((/* unused pure expression or super */ null && (startOfISOWeekYear_startOfISOWeekYear)));
67243
67244;// ./node_modules/react-day-picker/node_modules/date-fns/getISOWeek.js
67245
67246
67247
67248
67249
67250/**
67251 * The {@link getISOWeek} function options.
67252 */
67253
67254/**
67255 * @name getISOWeek
67256 * @category ISO Week Helpers
67257 * @summary Get the ISO week of the given date.
67258 *
67259 * @description
67260 * Get the ISO week of the given date.
67261 *
67262 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
67263 *
67264 * @param date - The given date
67265 * @param options - The options
67266 *
67267 * @returns The ISO week
67268 *
67269 * @example
67270 * // Which week of the ISO-week numbering year is 2 January 2005?
67271 * const result = getISOWeek(new Date(2005, 0, 2))
67272 * //=> 53
67273 */
67274function getISOWeek_getISOWeek(date, options) {
67275 const _date = toDate_toDate(date, options?.in);
67276 const diff = +startOfISOWeek_startOfISOWeek(_date) - +startOfISOWeekYear_startOfISOWeekYear(_date);
67277
67278 // Round the number of weeks to the nearest integer because the number of
67279 // milliseconds in a week is not constant (e.g. it's different in the week of
67280 // the daylight saving time clock shift).
67281 return Math.round(diff / constants_millisecondsInWeek) + 1;
67282}
67283
67284// Fallback for modularized imports:
67285/* harmony default export */ const node_modules_date_fns_getISOWeek = ((/* unused pure expression or super */ null && (getISOWeek_getISOWeek)));
67286
67287;// ./node_modules/react-day-picker/node_modules/date-fns/getWeekYear.js
67288
67289
67290
67291
67292
67293/**
67294 * The {@link getWeekYear} function options.
67295 */
67296
67297/**
67298 * @name getWeekYear
67299 * @category Week-Numbering Year Helpers
67300 * @summary Get the local week-numbering year of the given date.
67301 *
67302 * @description
67303 * Get the local week-numbering year of the given date.
67304 * The exact calculation depends on the values of
67305 * `options.weekStartsOn` (which is the index of the first day of the week)
67306 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
67307 * the first week of the week-numbering year)
67308 *
67309 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
67310 *
67311 * @param date - The given date
67312 * @param options - An object with options.
67313 *
67314 * @returns The local week-numbering year
67315 *
67316 * @example
67317 * // Which week numbering year is 26 December 2004 with the default settings?
67318 * const result = getWeekYear(new Date(2004, 11, 26))
67319 * //=> 2005
67320 *
67321 * @example
67322 * // Which week numbering year is 26 December 2004 if week starts on Saturday?
67323 * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
67324 * //=> 2004
67325 *
67326 * @example
67327 * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
67328 * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
67329 * //=> 2004
67330 */
67331function getWeekYear_getWeekYear(date, options) {
67332 const _date = toDate_toDate(date, options?.in);
67333 const year = _date.getFullYear();
67334
67335 const defaultOptions = defaultOptions_getDefaultOptions();
67336 const firstWeekContainsDate =
67337 options?.firstWeekContainsDate ??
67338 options?.locale?.options?.firstWeekContainsDate ??
67339 defaultOptions.firstWeekContainsDate ??
67340 defaultOptions.locale?.options?.firstWeekContainsDate ??
67341 1;
67342
67343 const firstWeekOfNextYear = constructFrom_constructFrom(options?.in || date, 0);
67344 firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
67345 firstWeekOfNextYear.setHours(0, 0, 0, 0);
67346 const startOfNextYear = startOfWeek_startOfWeek(firstWeekOfNextYear, options);
67347
67348 const firstWeekOfThisYear = constructFrom_constructFrom(options?.in || date, 0);
67349 firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
67350 firstWeekOfThisYear.setHours(0, 0, 0, 0);
67351 const startOfThisYear = startOfWeek_startOfWeek(firstWeekOfThisYear, options);
67352
67353 if (+_date >= +startOfNextYear) {
67354 return year + 1;
67355 } else if (+_date >= +startOfThisYear) {
67356 return year;
67357 } else {
67358 return year - 1;
67359 }
67360}
67361
67362// Fallback for modularized imports:
67363/* harmony default export */ const node_modules_date_fns_getWeekYear = ((/* unused pure expression or super */ null && (getWeekYear_getWeekYear)));
67364
67365;// ./node_modules/react-day-picker/node_modules/date-fns/startOfWeekYear.js
67366
67367
67368
67369
67370
67371/**
67372 * The {@link startOfWeekYear} function options.
67373 */
67374
67375/**
67376 * @name startOfWeekYear
67377 * @category Week-Numbering Year Helpers
67378 * @summary Return the start of a local week-numbering year for the given date.
67379 *
67380 * @description
67381 * Return the start of a local week-numbering year.
67382 * The exact calculation depends on the values of
67383 * `options.weekStartsOn` (which is the index of the first day of the week)
67384 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
67385 * the first week of the week-numbering year)
67386 *
67387 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
67388 *
67389 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
67390 * @typeParam ResultDate - The result `Date` type.
67391 *
67392 * @param date - The original date
67393 * @param options - An object with options
67394 *
67395 * @returns The start of a week-numbering year
67396 *
67397 * @example
67398 * // The start of an a week-numbering year for 2 July 2005 with default settings:
67399 * const result = startOfWeekYear(new Date(2005, 6, 2))
67400 * //=> Sun Dec 26 2004 00:00:00
67401 *
67402 * @example
67403 * // The start of a week-numbering year for 2 July 2005
67404 * // if Monday is the first day of week
67405 * // and 4 January is always in the first week of the year:
67406 * const result = startOfWeekYear(new Date(2005, 6, 2), {
67407 * weekStartsOn: 1,
67408 * firstWeekContainsDate: 4
67409 * })
67410 * //=> Mon Jan 03 2005 00:00:00
67411 */
67412function startOfWeekYear_startOfWeekYear(date, options) {
67413 const defaultOptions = defaultOptions_getDefaultOptions();
67414 const firstWeekContainsDate =
67415 options?.firstWeekContainsDate ??
67416 options?.locale?.options?.firstWeekContainsDate ??
67417 defaultOptions.firstWeekContainsDate ??
67418 defaultOptions.locale?.options?.firstWeekContainsDate ??
67419 1;
67420
67421 const year = getWeekYear_getWeekYear(date, options);
67422 const firstWeek = constructFrom_constructFrom(options?.in || date, 0);
67423 firstWeek.setFullYear(year, 0, firstWeekContainsDate);
67424 firstWeek.setHours(0, 0, 0, 0);
67425 const _date = startOfWeek_startOfWeek(firstWeek, options);
67426 return _date;
67427}
67428
67429// Fallback for modularized imports:
67430/* harmony default export */ const node_modules_date_fns_startOfWeekYear = ((/* unused pure expression or super */ null && (startOfWeekYear_startOfWeekYear)));
67431
67432;// ./node_modules/react-day-picker/node_modules/date-fns/getWeek.js
67433
67434
67435
67436
67437
67438/**
67439 * The {@link getWeek} function options.
67440 */
67441
67442/**
67443 * @name getWeek
67444 * @category Week Helpers
67445 * @summary Get the local week index of the given date.
67446 *
67447 * @description
67448 * Get the local week index of the given date.
67449 * The exact calculation depends on the values of
67450 * `options.weekStartsOn` (which is the index of the first day of the week)
67451 * and `options.firstWeekContainsDate` (which is the day of January, which is always in
67452 * the first week of the week-numbering year)
67453 *
67454 * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
67455 *
67456 * @param date - The given date
67457 * @param options - An object with options
67458 *
67459 * @returns The week
67460 *
67461 * @example
67462 * // Which week of the local week numbering year is 2 January 2005 with default options?
67463 * const result = getWeek(new Date(2005, 0, 2))
67464 * //=> 2
67465 *
67466 * @example
67467 * // Which week of the local week numbering year is 2 January 2005,
67468 * // if Monday is the first day of the week,
67469 * // and the first week of the year always contains 4 January?
67470 * const result = getWeek(new Date(2005, 0, 2), {
67471 * weekStartsOn: 1,
67472 * firstWeekContainsDate: 4
67473 * })
67474 * //=> 53
67475 */
67476function getWeek_getWeek(date, options) {
67477 const _date = toDate_toDate(date, options?.in);
67478 const diff = +startOfWeek_startOfWeek(_date, options) - +startOfWeekYear_startOfWeekYear(_date, options);
67479
67480 // Round the number of weeks to the nearest integer because the number of
67481 // milliseconds in a week is not constant (e.g. it's different in the week of
67482 // the daylight saving time clock shift).
67483 return Math.round(diff / constants_millisecondsInWeek) + 1;
67484}
67485
67486// Fallback for modularized imports:
67487/* harmony default export */ const node_modules_date_fns_getWeek = ((/* unused pure expression or super */ null && (getWeek_getWeek)));
67488
67489;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/addLeadingZeros.js
67490function addLeadingZeros_addLeadingZeros(number, targetLength) {
67491 const sign = number < 0 ? "-" : "";
67492 const output = Math.abs(number).toString().padStart(targetLength, "0");
67493 return sign + output;
67494}
67495
67496;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/lightFormatters.js
67497
67498
67499/*
67500 * | | Unit | | Unit |
67501 * |-----|--------------------------------|-----|--------------------------------|
67502 * | a | AM, PM | A* | |
67503 * | d | Day of month | D | |
67504 * | h | Hour [1-12] | H | Hour [0-23] |
67505 * | m | Minute | M | Month |
67506 * | s | Second | S | Fraction of second |
67507 * | y | Year (abs) | Y | |
67508 *
67509 * Letters marked by * are not implemented but reserved by Unicode standard.
67510 */
67511
67512const lightFormatters_lightFormatters = {
67513 // Year
67514 y(date, token) {
67515 // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
67516 // | Year | y | yy | yyy | yyyy | yyyyy |
67517 // |----------|-------|----|-------|-------|-------|
67518 // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
67519 // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
67520 // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
67521 // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
67522 // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
67523
67524 const signedYear = date.getFullYear();
67525 // Returns 1 for 1 BC (which is year 0 in JavaScript)
67526 const year = signedYear > 0 ? signedYear : 1 - signedYear;
67527 return addLeadingZeros_addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
67528 },
67529
67530 // Month
67531 M(date, token) {
67532 const month = date.getMonth();
67533 return token === "M" ? String(month + 1) : addLeadingZeros_addLeadingZeros(month + 1, 2);
67534 },
67535
67536 // Day of the month
67537 d(date, token) {
67538 return addLeadingZeros_addLeadingZeros(date.getDate(), token.length);
67539 },
67540
67541 // AM or PM
67542 a(date, token) {
67543 const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
67544
67545 switch (token) {
67546 case "a":
67547 case "aa":
67548 return dayPeriodEnumValue.toUpperCase();
67549 case "aaa":
67550 return dayPeriodEnumValue;
67551 case "aaaaa":
67552 return dayPeriodEnumValue[0];
67553 case "aaaa":
67554 default:
67555 return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
67556 }
67557 },
67558
67559 // Hour [1-12]
67560 h(date, token) {
67561 return addLeadingZeros_addLeadingZeros(date.getHours() % 12 || 12, token.length);
67562 },
67563
67564 // Hour [0-23]
67565 H(date, token) {
67566 return addLeadingZeros_addLeadingZeros(date.getHours(), token.length);
67567 },
67568
67569 // Minute
67570 m(date, token) {
67571 return addLeadingZeros_addLeadingZeros(date.getMinutes(), token.length);
67572 },
67573
67574 // Second
67575 s(date, token) {
67576 return addLeadingZeros_addLeadingZeros(date.getSeconds(), token.length);
67577 },
67578
67579 // Fraction of second
67580 S(date, token) {
67581 const numberOfDigits = token.length;
67582 const milliseconds = date.getMilliseconds();
67583 const fractionalSeconds = Math.trunc(
67584 milliseconds * Math.pow(10, numberOfDigits - 3),
67585 );
67586 return addLeadingZeros_addLeadingZeros(fractionalSeconds, token.length);
67587 },
67588};
67589
67590;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/formatters.js
67591
67592
67593
67594
67595
67596
67597
67598
67599
67600const formatters_dayPeriodEnum = {
67601 am: "am",
67602 pm: "pm",
67603 midnight: "midnight",
67604 noon: "noon",
67605 morning: "morning",
67606 afternoon: "afternoon",
67607 evening: "evening",
67608 night: "night",
67609};
67610
67611/*
67612 * | | Unit | | Unit |
67613 * |-----|--------------------------------|-----|--------------------------------|
67614 * | a | AM, PM | A* | Milliseconds in day |
67615 * | b | AM, PM, noon, midnight | B | Flexible day period |
67616 * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
67617 * | d | Day of month | D | Day of year |
67618 * | e | Local day of week | E | Day of week |
67619 * | f | | F* | Day of week in month |
67620 * | g* | Modified Julian day | G | Era |
67621 * | h | Hour [1-12] | H | Hour [0-23] |
67622 * | i! | ISO day of week | I! | ISO week of year |
67623 * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
67624 * | k | Hour [1-24] | K | Hour [0-11] |
67625 * | l* | (deprecated) | L | Stand-alone month |
67626 * | m | Minute | M | Month |
67627 * | n | | N | |
67628 * | o! | Ordinal number modifier | O | Timezone (GMT) |
67629 * | p! | Long localized time | P! | Long localized date |
67630 * | q | Stand-alone quarter | Q | Quarter |
67631 * | r* | Related Gregorian year | R! | ISO week-numbering year |
67632 * | s | Second | S | Fraction of second |
67633 * | t! | Seconds timestamp | T! | Milliseconds timestamp |
67634 * | u | Extended year | U* | Cyclic year |
67635 * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
67636 * | w | Local week of year | W* | Week of month |
67637 * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
67638 * | y | Year (abs) | Y | Local week-numbering year |
67639 * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
67640 *
67641 * Letters marked by * are not implemented but reserved by Unicode standard.
67642 *
67643 * Letters marked by ! are non-standard, but implemented by date-fns:
67644 * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
67645 * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
67646 * i.e. 7 for Sunday, 1 for Monday, etc.
67647 * - `I` is ISO week of year, as opposed to `w` which is local week of year.
67648 * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
67649 * `R` is supposed to be used in conjunction with `I` and `i`
67650 * for universal ISO week-numbering date, whereas
67651 * `Y` is supposed to be used in conjunction with `w` and `e`
67652 * for week-numbering date specific to the locale.
67653 * - `P` is long localized date format
67654 * - `p` is long localized time format
67655 */
67656
67657const formatters_formatters = {
67658 // Era
67659 G: function (date, token, localize) {
67660 const era = date.getFullYear() > 0 ? 1 : 0;
67661 switch (token) {
67662 // AD, BC
67663 case "G":
67664 case "GG":
67665 case "GGG":
67666 return localize.era(era, { width: "abbreviated" });
67667 // A, B
67668 case "GGGGG":
67669 return localize.era(era, { width: "narrow" });
67670 // Anno Domini, Before Christ
67671 case "GGGG":
67672 default:
67673 return localize.era(era, { width: "wide" });
67674 }
67675 },
67676
67677 // Year
67678 y: function (date, token, localize) {
67679 // Ordinal number
67680 if (token === "yo") {
67681 const signedYear = date.getFullYear();
67682 // Returns 1 for 1 BC (which is year 0 in JavaScript)
67683 const year = signedYear > 0 ? signedYear : 1 - signedYear;
67684 return localize.ordinalNumber(year, { unit: "year" });
67685 }
67686
67687 return lightFormatters_lightFormatters.y(date, token);
67688 },
67689
67690 // Local week-numbering year
67691 Y: function (date, token, localize, options) {
67692 const signedWeekYear = getWeekYear_getWeekYear(date, options);
67693 // Returns 1 for 1 BC (which is year 0 in JavaScript)
67694 const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
67695
67696 // Two digit year
67697 if (token === "YY") {
67698 const twoDigitYear = weekYear % 100;
67699 return addLeadingZeros_addLeadingZeros(twoDigitYear, 2);
67700 }
67701
67702 // Ordinal number
67703 if (token === "Yo") {
67704 return localize.ordinalNumber(weekYear, { unit: "year" });
67705 }
67706
67707 // Padding
67708 return addLeadingZeros_addLeadingZeros(weekYear, token.length);
67709 },
67710
67711 // ISO week-numbering year
67712 R: function (date, token) {
67713 const isoWeekYear = getISOWeekYear_getISOWeekYear(date);
67714
67715 // Padding
67716 return addLeadingZeros_addLeadingZeros(isoWeekYear, token.length);
67717 },
67718
67719 // Extended year. This is a single number designating the year of this calendar system.
67720 // The main difference between `y` and `u` localizers are B.C. years:
67721 // | Year | `y` | `u` |
67722 // |------|-----|-----|
67723 // | AC 1 | 1 | 1 |
67724 // | BC 1 | 1 | 0 |
67725 // | BC 2 | 2 | -1 |
67726 // Also `yy` always returns the last two digits of a year,
67727 // while `uu` pads single digit years to 2 characters and returns other years unchanged.
67728 u: function (date, token) {
67729 const year = date.getFullYear();
67730 return addLeadingZeros_addLeadingZeros(year, token.length);
67731 },
67732
67733 // Quarter
67734 Q: function (date, token, localize) {
67735 const quarter = Math.ceil((date.getMonth() + 1) / 3);
67736 switch (token) {
67737 // 1, 2, 3, 4
67738 case "Q":
67739 return String(quarter);
67740 // 01, 02, 03, 04
67741 case "QQ":
67742 return addLeadingZeros_addLeadingZeros(quarter, 2);
67743 // 1st, 2nd, 3rd, 4th
67744 case "Qo":
67745 return localize.ordinalNumber(quarter, { unit: "quarter" });
67746 // Q1, Q2, Q3, Q4
67747 case "QQQ":
67748 return localize.quarter(quarter, {
67749 width: "abbreviated",
67750 context: "formatting",
67751 });
67752 // 1, 2, 3, 4 (narrow quarter; could be not numerical)
67753 case "QQQQQ":
67754 return localize.quarter(quarter, {
67755 width: "narrow",
67756 context: "formatting",
67757 });
67758 // 1st quarter, 2nd quarter, ...
67759 case "QQQQ":
67760 default:
67761 return localize.quarter(quarter, {
67762 width: "wide",
67763 context: "formatting",
67764 });
67765 }
67766 },
67767
67768 // Stand-alone quarter
67769 q: function (date, token, localize) {
67770 const quarter = Math.ceil((date.getMonth() + 1) / 3);
67771 switch (token) {
67772 // 1, 2, 3, 4
67773 case "q":
67774 return String(quarter);
67775 // 01, 02, 03, 04
67776 case "qq":
67777 return addLeadingZeros_addLeadingZeros(quarter, 2);
67778 // 1st, 2nd, 3rd, 4th
67779 case "qo":
67780 return localize.ordinalNumber(quarter, { unit: "quarter" });
67781 // Q1, Q2, Q3, Q4
67782 case "qqq":
67783 return localize.quarter(quarter, {
67784 width: "abbreviated",
67785 context: "standalone",
67786 });
67787 // 1, 2, 3, 4 (narrow quarter; could be not numerical)
67788 case "qqqqq":
67789 return localize.quarter(quarter, {
67790 width: "narrow",
67791 context: "standalone",
67792 });
67793 // 1st quarter, 2nd quarter, ...
67794 case "qqqq":
67795 default:
67796 return localize.quarter(quarter, {
67797 width: "wide",
67798 context: "standalone",
67799 });
67800 }
67801 },
67802
67803 // Month
67804 M: function (date, token, localize) {
67805 const month = date.getMonth();
67806 switch (token) {
67807 case "M":
67808 case "MM":
67809 return lightFormatters_lightFormatters.M(date, token);
67810 // 1st, 2nd, ..., 12th
67811 case "Mo":
67812 return localize.ordinalNumber(month + 1, { unit: "month" });
67813 // Jan, Feb, ..., Dec
67814 case "MMM":
67815 return localize.month(month, {
67816 width: "abbreviated",
67817 context: "formatting",
67818 });
67819 // J, F, ..., D
67820 case "MMMMM":
67821 return localize.month(month, {
67822 width: "narrow",
67823 context: "formatting",
67824 });
67825 // January, February, ..., December
67826 case "MMMM":
67827 default:
67828 return localize.month(month, { width: "wide", context: "formatting" });
67829 }
67830 },
67831
67832 // Stand-alone month
67833 L: function (date, token, localize) {
67834 const month = date.getMonth();
67835 switch (token) {
67836 // 1, 2, ..., 12
67837 case "L":
67838 return String(month + 1);
67839 // 01, 02, ..., 12
67840 case "LL":
67841 return addLeadingZeros_addLeadingZeros(month + 1, 2);
67842 // 1st, 2nd, ..., 12th
67843 case "Lo":
67844 return localize.ordinalNumber(month + 1, { unit: "month" });
67845 // Jan, Feb, ..., Dec
67846 case "LLL":
67847 return localize.month(month, {
67848 width: "abbreviated",
67849 context: "standalone",
67850 });
67851 // J, F, ..., D
67852 case "LLLLL":
67853 return localize.month(month, {
67854 width: "narrow",
67855 context: "standalone",
67856 });
67857 // January, February, ..., December
67858 case "LLLL":
67859 default:
67860 return localize.month(month, { width: "wide", context: "standalone" });
67861 }
67862 },
67863
67864 // Local week of year
67865 w: function (date, token, localize, options) {
67866 const week = getWeek_getWeek(date, options);
67867
67868 if (token === "wo") {
67869 return localize.ordinalNumber(week, { unit: "week" });
67870 }
67871
67872 return addLeadingZeros_addLeadingZeros(week, token.length);
67873 },
67874
67875 // ISO week of year
67876 I: function (date, token, localize) {
67877 const isoWeek = getISOWeek_getISOWeek(date);
67878
67879 if (token === "Io") {
67880 return localize.ordinalNumber(isoWeek, { unit: "week" });
67881 }
67882
67883 return addLeadingZeros_addLeadingZeros(isoWeek, token.length);
67884 },
67885
67886 // Day of the month
67887 d: function (date, token, localize) {
67888 if (token === "do") {
67889 return localize.ordinalNumber(date.getDate(), { unit: "date" });
67890 }
67891
67892 return lightFormatters_lightFormatters.d(date, token);
67893 },
67894
67895 // Day of year
67896 D: function (date, token, localize) {
67897 const dayOfYear = getDayOfYear_getDayOfYear(date);
67898
67899 if (token === "Do") {
67900 return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
67901 }
67902
67903 return addLeadingZeros_addLeadingZeros(dayOfYear, token.length);
67904 },
67905
67906 // Day of week
67907 E: function (date, token, localize) {
67908 const dayOfWeek = date.getDay();
67909 switch (token) {
67910 // Tue
67911 case "E":
67912 case "EE":
67913 case "EEE":
67914 return localize.day(dayOfWeek, {
67915 width: "abbreviated",
67916 context: "formatting",
67917 });
67918 // T
67919 case "EEEEE":
67920 return localize.day(dayOfWeek, {
67921 width: "narrow",
67922 context: "formatting",
67923 });
67924 // Tu
67925 case "EEEEEE":
67926 return localize.day(dayOfWeek, {
67927 width: "short",
67928 context: "formatting",
67929 });
67930 // Tuesday
67931 case "EEEE":
67932 default:
67933 return localize.day(dayOfWeek, {
67934 width: "wide",
67935 context: "formatting",
67936 });
67937 }
67938 },
67939
67940 // Local day of week
67941 e: function (date, token, localize, options) {
67942 const dayOfWeek = date.getDay();
67943 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
67944 switch (token) {
67945 // Numerical value (Nth day of week with current locale or weekStartsOn)
67946 case "e":
67947 return String(localDayOfWeek);
67948 // Padded numerical value
67949 case "ee":
67950 return addLeadingZeros_addLeadingZeros(localDayOfWeek, 2);
67951 // 1st, 2nd, ..., 7th
67952 case "eo":
67953 return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
67954 case "eee":
67955 return localize.day(dayOfWeek, {
67956 width: "abbreviated",
67957 context: "formatting",
67958 });
67959 // T
67960 case "eeeee":
67961 return localize.day(dayOfWeek, {
67962 width: "narrow",
67963 context: "formatting",
67964 });
67965 // Tu
67966 case "eeeeee":
67967 return localize.day(dayOfWeek, {
67968 width: "short",
67969 context: "formatting",
67970 });
67971 // Tuesday
67972 case "eeee":
67973 default:
67974 return localize.day(dayOfWeek, {
67975 width: "wide",
67976 context: "formatting",
67977 });
67978 }
67979 },
67980
67981 // Stand-alone local day of week
67982 c: function (date, token, localize, options) {
67983 const dayOfWeek = date.getDay();
67984 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
67985 switch (token) {
67986 // Numerical value (same as in `e`)
67987 case "c":
67988 return String(localDayOfWeek);
67989 // Padded numerical value
67990 case "cc":
67991 return addLeadingZeros_addLeadingZeros(localDayOfWeek, token.length);
67992 // 1st, 2nd, ..., 7th
67993 case "co":
67994 return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
67995 case "ccc":
67996 return localize.day(dayOfWeek, {
67997 width: "abbreviated",
67998 context: "standalone",
67999 });
68000 // T
68001 case "ccccc":
68002 return localize.day(dayOfWeek, {
68003 width: "narrow",
68004 context: "standalone",
68005 });
68006 // Tu
68007 case "cccccc":
68008 return localize.day(dayOfWeek, {
68009 width: "short",
68010 context: "standalone",
68011 });
68012 // Tuesday
68013 case "cccc":
68014 default:
68015 return localize.day(dayOfWeek, {
68016 width: "wide",
68017 context: "standalone",
68018 });
68019 }
68020 },
68021
68022 // ISO day of week
68023 i: function (date, token, localize) {
68024 const dayOfWeek = date.getDay();
68025 const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
68026 switch (token) {
68027 // 2
68028 case "i":
68029 return String(isoDayOfWeek);
68030 // 02
68031 case "ii":
68032 return addLeadingZeros_addLeadingZeros(isoDayOfWeek, token.length);
68033 // 2nd
68034 case "io":
68035 return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
68036 // Tue
68037 case "iii":
68038 return localize.day(dayOfWeek, {
68039 width: "abbreviated",
68040 context: "formatting",
68041 });
68042 // T
68043 case "iiiii":
68044 return localize.day(dayOfWeek, {
68045 width: "narrow",
68046 context: "formatting",
68047 });
68048 // Tu
68049 case "iiiiii":
68050 return localize.day(dayOfWeek, {
68051 width: "short",
68052 context: "formatting",
68053 });
68054 // Tuesday
68055 case "iiii":
68056 default:
68057 return localize.day(dayOfWeek, {
68058 width: "wide",
68059 context: "formatting",
68060 });
68061 }
68062 },
68063
68064 // AM or PM
68065 a: function (date, token, localize) {
68066 const hours = date.getHours();
68067 const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
68068
68069 switch (token) {
68070 case "a":
68071 case "aa":
68072 return localize.dayPeriod(dayPeriodEnumValue, {
68073 width: "abbreviated",
68074 context: "formatting",
68075 });
68076 case "aaa":
68077 return localize
68078 .dayPeriod(dayPeriodEnumValue, {
68079 width: "abbreviated",
68080 context: "formatting",
68081 })
68082 .toLowerCase();
68083 case "aaaaa":
68084 return localize.dayPeriod(dayPeriodEnumValue, {
68085 width: "narrow",
68086 context: "formatting",
68087 });
68088 case "aaaa":
68089 default:
68090 return localize.dayPeriod(dayPeriodEnumValue, {
68091 width: "wide",
68092 context: "formatting",
68093 });
68094 }
68095 },
68096
68097 // AM, PM, midnight, noon
68098 b: function (date, token, localize) {
68099 const hours = date.getHours();
68100 let dayPeriodEnumValue;
68101 if (hours === 12) {
68102 dayPeriodEnumValue = formatters_dayPeriodEnum.noon;
68103 } else if (hours === 0) {
68104 dayPeriodEnumValue = formatters_dayPeriodEnum.midnight;
68105 } else {
68106 dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
68107 }
68108
68109 switch (token) {
68110 case "b":
68111 case "bb":
68112 return localize.dayPeriod(dayPeriodEnumValue, {
68113 width: "abbreviated",
68114 context: "formatting",
68115 });
68116 case "bbb":
68117 return localize
68118 .dayPeriod(dayPeriodEnumValue, {
68119 width: "abbreviated",
68120 context: "formatting",
68121 })
68122 .toLowerCase();
68123 case "bbbbb":
68124 return localize.dayPeriod(dayPeriodEnumValue, {
68125 width: "narrow",
68126 context: "formatting",
68127 });
68128 case "bbbb":
68129 default:
68130 return localize.dayPeriod(dayPeriodEnumValue, {
68131 width: "wide",
68132 context: "formatting",
68133 });
68134 }
68135 },
68136
68137 // in the morning, in the afternoon, in the evening, at night
68138 B: function (date, token, localize) {
68139 const hours = date.getHours();
68140 let dayPeriodEnumValue;
68141 if (hours >= 17) {
68142 dayPeriodEnumValue = formatters_dayPeriodEnum.evening;
68143 } else if (hours >= 12) {
68144 dayPeriodEnumValue = formatters_dayPeriodEnum.afternoon;
68145 } else if (hours >= 4) {
68146 dayPeriodEnumValue = formatters_dayPeriodEnum.morning;
68147 } else {
68148 dayPeriodEnumValue = formatters_dayPeriodEnum.night;
68149 }
68150
68151 switch (token) {
68152 case "B":
68153 case "BB":
68154 case "BBB":
68155 return localize.dayPeriod(dayPeriodEnumValue, {
68156 width: "abbreviated",
68157 context: "formatting",
68158 });
68159 case "BBBBB":
68160 return localize.dayPeriod(dayPeriodEnumValue, {
68161 width: "narrow",
68162 context: "formatting",
68163 });
68164 case "BBBB":
68165 default:
68166 return localize.dayPeriod(dayPeriodEnumValue, {
68167 width: "wide",
68168 context: "formatting",
68169 });
68170 }
68171 },
68172
68173 // Hour [1-12]
68174 h: function (date, token, localize) {
68175 if (token === "ho") {
68176 let hours = date.getHours() % 12;
68177 if (hours === 0) hours = 12;
68178 return localize.ordinalNumber(hours, { unit: "hour" });
68179 }
68180
68181 return lightFormatters_lightFormatters.h(date, token);
68182 },
68183
68184 // Hour [0-23]
68185 H: function (date, token, localize) {
68186 if (token === "Ho") {
68187 return localize.ordinalNumber(date.getHours(), { unit: "hour" });
68188 }
68189
68190 return lightFormatters_lightFormatters.H(date, token);
68191 },
68192
68193 // Hour [0-11]
68194 K: function (date, token, localize) {
68195 const hours = date.getHours() % 12;
68196
68197 if (token === "Ko") {
68198 return localize.ordinalNumber(hours, { unit: "hour" });
68199 }
68200
68201 return addLeadingZeros_addLeadingZeros(hours, token.length);
68202 },
68203
68204 // Hour [1-24]
68205 k: function (date, token, localize) {
68206 let hours = date.getHours();
68207 if (hours === 0) hours = 24;
68208
68209 if (token === "ko") {
68210 return localize.ordinalNumber(hours, { unit: "hour" });
68211 }
68212
68213 return addLeadingZeros_addLeadingZeros(hours, token.length);
68214 },
68215
68216 // Minute
68217 m: function (date, token, localize) {
68218 if (token === "mo") {
68219 return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
68220 }
68221
68222 return lightFormatters_lightFormatters.m(date, token);
68223 },
68224
68225 // Second
68226 s: function (date, token, localize) {
68227 if (token === "so") {
68228 return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
68229 }
68230
68231 return lightFormatters_lightFormatters.s(date, token);
68232 },
68233
68234 // Fraction of second
68235 S: function (date, token) {
68236 return lightFormatters_lightFormatters.S(date, token);
68237 },
68238
68239 // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
68240 X: function (date, token, _localize) {
68241 const timezoneOffset = date.getTimezoneOffset();
68242
68243 if (timezoneOffset === 0) {
68244 return "Z";
68245 }
68246
68247 switch (token) {
68248 // Hours and optional minutes
68249 case "X":
68250 return formatters_formatTimezoneWithOptionalMinutes(timezoneOffset);
68251
68252 // Hours, minutes and optional seconds without `:` delimiter
68253 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
68254 // so this token always has the same output as `XX`
68255 case "XXXX":
68256 case "XX": // Hours and minutes without `:` delimiter
68257 return formatters_formatTimezone(timezoneOffset);
68258
68259 // Hours, minutes and optional seconds with `:` delimiter
68260 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
68261 // so this token always has the same output as `XXX`
68262 case "XXXXX":
68263 case "XXX": // Hours and minutes with `:` delimiter
68264 default:
68265 return formatters_formatTimezone(timezoneOffset, ":");
68266 }
68267 },
68268
68269 // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
68270 x: function (date, token, _localize) {
68271 const timezoneOffset = date.getTimezoneOffset();
68272
68273 switch (token) {
68274 // Hours and optional minutes
68275 case "x":
68276 return formatters_formatTimezoneWithOptionalMinutes(timezoneOffset);
68277
68278 // Hours, minutes and optional seconds without `:` delimiter
68279 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
68280 // so this token always has the same output as `xx`
68281 case "xxxx":
68282 case "xx": // Hours and minutes without `:` delimiter
68283 return formatters_formatTimezone(timezoneOffset);
68284
68285 // Hours, minutes and optional seconds with `:` delimiter
68286 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
68287 // so this token always has the same output as `xxx`
68288 case "xxxxx":
68289 case "xxx": // Hours and minutes with `:` delimiter
68290 default:
68291 return formatters_formatTimezone(timezoneOffset, ":");
68292 }
68293 },
68294
68295 // Timezone (GMT)
68296 O: function (date, token, _localize) {
68297 const timezoneOffset = date.getTimezoneOffset();
68298
68299 switch (token) {
68300 // Short
68301 case "O":
68302 case "OO":
68303 case "OOO":
68304 return "GMT" + formatters_formatTimezoneShort(timezoneOffset, ":");
68305 // Long
68306 case "OOOO":
68307 default:
68308 return "GMT" + formatters_formatTimezone(timezoneOffset, ":");
68309 }
68310 },
68311
68312 // Timezone (specific non-location)
68313 z: function (date, token, _localize) {
68314 const timezoneOffset = date.getTimezoneOffset();
68315
68316 switch (token) {
68317 // Short
68318 case "z":
68319 case "zz":
68320 case "zzz":
68321 return "GMT" + formatters_formatTimezoneShort(timezoneOffset, ":");
68322 // Long
68323 case "zzzz":
68324 default:
68325 return "GMT" + formatters_formatTimezone(timezoneOffset, ":");
68326 }
68327 },
68328
68329 // Seconds timestamp
68330 t: function (date, token, _localize) {
68331 const timestamp = Math.trunc(+date / 1000);
68332 return addLeadingZeros_addLeadingZeros(timestamp, token.length);
68333 },
68334
68335 // Milliseconds timestamp
68336 T: function (date, token, _localize) {
68337 return addLeadingZeros_addLeadingZeros(+date, token.length);
68338 },
68339};
68340
68341function formatters_formatTimezoneShort(offset, delimiter = "") {
68342 const sign = offset > 0 ? "-" : "+";
68343 const absOffset = Math.abs(offset);
68344 const hours = Math.trunc(absOffset / 60);
68345 const minutes = absOffset % 60;
68346 if (minutes === 0) {
68347 return sign + String(hours);
68348 }
68349 return sign + String(hours) + delimiter + addLeadingZeros_addLeadingZeros(minutes, 2);
68350}
68351
68352function formatters_formatTimezoneWithOptionalMinutes(offset, delimiter) {
68353 if (offset % 60 === 0) {
68354 const sign = offset > 0 ? "-" : "+";
68355 return sign + addLeadingZeros_addLeadingZeros(Math.abs(offset) / 60, 2);
68356 }
68357 return formatters_formatTimezone(offset, delimiter);
68358}
68359
68360function formatters_formatTimezone(offset, delimiter = "") {
68361 const sign = offset > 0 ? "-" : "+";
68362 const absOffset = Math.abs(offset);
68363 const hours = addLeadingZeros_addLeadingZeros(Math.trunc(absOffset / 60), 2);
68364 const minutes = addLeadingZeros_addLeadingZeros(absOffset % 60, 2);
68365 return sign + hours + delimiter + minutes;
68366}
68367
68368;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/format/longFormatters.js
68369const longFormatters_dateLongFormatter = (pattern, formatLong) => {
68370 switch (pattern) {
68371 case "P":
68372 return formatLong.date({ width: "short" });
68373 case "PP":
68374 return formatLong.date({ width: "medium" });
68375 case "PPP":
68376 return formatLong.date({ width: "long" });
68377 case "PPPP":
68378 default:
68379 return formatLong.date({ width: "full" });
68380 }
68381};
68382
68383const longFormatters_timeLongFormatter = (pattern, formatLong) => {
68384 switch (pattern) {
68385 case "p":
68386 return formatLong.time({ width: "short" });
68387 case "pp":
68388 return formatLong.time({ width: "medium" });
68389 case "ppp":
68390 return formatLong.time({ width: "long" });
68391 case "pppp":
68392 default:
68393 return formatLong.time({ width: "full" });
68394 }
68395};
68396
68397const longFormatters_dateTimeLongFormatter = (pattern, formatLong) => {
68398 const matchResult = pattern.match(/(P+)(p+)?/) || [];
68399 const datePattern = matchResult[1];
68400 const timePattern = matchResult[2];
68401
68402 if (!timePattern) {
68403 return longFormatters_dateLongFormatter(pattern, formatLong);
68404 }
68405
68406 let dateTimeFormat;
68407
68408 switch (datePattern) {
68409 case "P":
68410 dateTimeFormat = formatLong.dateTime({ width: "short" });
68411 break;
68412 case "PP":
68413 dateTimeFormat = formatLong.dateTime({ width: "medium" });
68414 break;
68415 case "PPP":
68416 dateTimeFormat = formatLong.dateTime({ width: "long" });
68417 break;
68418 case "PPPP":
68419 default:
68420 dateTimeFormat = formatLong.dateTime({ width: "full" });
68421 break;
68422 }
68423
68424 return dateTimeFormat
68425 .replace("{{date}}", longFormatters_dateLongFormatter(datePattern, formatLong))
68426 .replace("{{time}}", longFormatters_timeLongFormatter(timePattern, formatLong));
68427};
68428
68429const longFormatters_longFormatters = {
68430 p: longFormatters_timeLongFormatter,
68431 P: longFormatters_dateTimeLongFormatter,
68432};
68433
68434;// ./node_modules/react-day-picker/node_modules/date-fns/_lib/protectedTokens.js
68435const protectedTokens_dayOfYearTokenRE = /^D+$/;
68436const protectedTokens_weekYearTokenRE = /^Y+$/;
68437
68438const protectedTokens_throwTokens = ["D", "DD", "YY", "YYYY"];
68439
68440function protectedTokens_isProtectedDayOfYearToken(token) {
68441 return protectedTokens_dayOfYearTokenRE.test(token);
68442}
68443
68444function protectedTokens_isProtectedWeekYearToken(token) {
68445 return protectedTokens_weekYearTokenRE.test(token);
68446}
68447
68448function protectedTokens_warnOrThrowProtectedError(token, format, input) {
68449 const _message = protectedTokens_message(token, format, input);
68450 console.warn(_message);
68451 if (protectedTokens_throwTokens.includes(token)) throw new RangeError(_message);
68452}
68453
68454function protectedTokens_message(token, format, input) {
68455 const subject = token[0] === "Y" ? "years" : "days of the month";
68456 return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
68457}
68458
68459;// ./node_modules/react-day-picker/node_modules/date-fns/isDate.js
68460/**
68461 * @name isDate
68462 * @category Common Helpers
68463 * @summary Is the given value a date?
68464 *
68465 * @description
68466 * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
68467 *
68468 * @param value - The value to check
68469 *
68470 * @returns True if the given value is a date
68471 *
68472 * @example
68473 * // For a valid date:
68474 * const result = isDate(new Date())
68475 * //=> true
68476 *
68477 * @example
68478 * // For an invalid date:
68479 * const result = isDate(new Date(NaN))
68480 * //=> true
68481 *
68482 * @example
68483 * // For some value:
68484 * const result = isDate('2014-02-31')
68485 * //=> false
68486 *
68487 * @example
68488 * // For an object:
68489 * const result = isDate({})
68490 * //=> false
68491 */
68492function isDate_isDate(value) {
68493 return (
68494 value instanceof Date ||
68495 (typeof value === "object" &&
68496 Object.prototype.toString.call(value) === "[object Date]")
68497 );
68498}
68499
68500// Fallback for modularized imports:
68501/* harmony default export */ const node_modules_date_fns_isDate = ((/* unused pure expression or super */ null && (isDate_isDate)));
68502
68503;// ./node_modules/react-day-picker/node_modules/date-fns/isValid.js
68504
68505
68506
68507/**
68508 * @name isValid
68509 * @category Common Helpers
68510 * @summary Is the given date valid?
68511 *
68512 * @description
68513 * Returns false if argument is Invalid Date and true otherwise.
68514 * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
68515 * Invalid Date is a Date, whose time value is NaN.
68516 *
68517 * Time value of Date: http://es5.github.io/#x15.9.1.1
68518 *
68519 * @param date - The date to check
68520 *
68521 * @returns The date is valid
68522 *
68523 * @example
68524 * // For the valid date:
68525 * const result = isValid(new Date(2014, 1, 31))
68526 * //=> true
68527 *
68528 * @example
68529 * // For the value, convertible into a date:
68530 * const result = isValid(1393804800000)
68531 * //=> true
68532 *
68533 * @example
68534 * // For the invalid date:
68535 * const result = isValid(new Date(''))
68536 * //=> false
68537 */
68538function isValid_isValid(date) {
68539 return !((!isDate_isDate(date) && typeof date !== "number") || isNaN(+toDate_toDate(date)));
68540}
68541
68542// Fallback for modularized imports:
68543/* harmony default export */ const node_modules_date_fns_isValid = ((/* unused pure expression or super */ null && (isValid_isValid)));
68544
68545;// ./node_modules/react-day-picker/node_modules/date-fns/format.js
68546
68547
68548
68549
68550
68551
68552
68553
68554// Rexports of internal for libraries to use.
68555// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
68556
68557
68558// This RegExp consists of three parts separated by `|`:
68559// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
68560// (one of the certain letters followed by `o`)
68561// - (\w)\1* matches any sequences of the same letter
68562// - '' matches two quote characters in a row
68563// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
68564// except a single quote symbol, which ends the sequence.
68565// Two quote characters do not end the sequence.
68566// If there is no matching single quote
68567// then the sequence will continue until the end of the string.
68568// - . matches any single character unmatched by previous parts of the RegExps
68569const format_formattingTokensRegExp =
68570 /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
68571
68572// This RegExp catches symbols escaped by quotes, and also
68573// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
68574const format_longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
68575
68576const format_escapedStringRegExp = /^'([^]*?)'?$/;
68577const format_doubleQuoteRegExp = /''/g;
68578const format_unescapedLatinCharacterRegExp = /[a-zA-Z]/;
68579
68580
68581
68582/**
68583 * The {@link format} function options.
68584 */
68585
68586/**
68587 * @name format
68588 * @alias formatDate
68589 * @category Common Helpers
68590 * @summary Format the date.
68591 *
68592 * @description
68593 * Return the formatted date string in the given format. The result may vary by locale.
68594 *
68595 * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
68596 * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68597 *
68598 * The characters wrapped between two single quotes characters (') are escaped.
68599 * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
68600 * (see the last example)
68601 *
68602 * Format of the string is based on Unicode Technical Standard #35:
68603 * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
68604 * with a few additions (see note 7 below the table).
68605 *
68606 * Accepted patterns:
68607 * | Unit | Pattern | Result examples | Notes |
68608 * |---------------------------------|---------|-----------------------------------|-------|
68609 * | Era | G..GGG | AD, BC | |
68610 * | | GGGG | Anno Domini, Before Christ | 2 |
68611 * | | GGGGG | A, B | |
68612 * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
68613 * | | yo | 44th, 1st, 0th, 17th | 5,7 |
68614 * | | yy | 44, 01, 00, 17 | 5 |
68615 * | | yyy | 044, 001, 1900, 2017 | 5 |
68616 * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
68617 * | | yyyyy | ... | 3,5 |
68618 * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
68619 * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
68620 * | | YY | 44, 01, 00, 17 | 5,8 |
68621 * | | YYY | 044, 001, 1900, 2017 | 5 |
68622 * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
68623 * | | YYYYY | ... | 3,5 |
68624 * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
68625 * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
68626 * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
68627 * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
68628 * | | RRRRR | ... | 3,5,7 |
68629 * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
68630 * | | uu | -43, 01, 1900, 2017 | 5 |
68631 * | | uuu | -043, 001, 1900, 2017 | 5 |
68632 * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
68633 * | | uuuuu | ... | 3,5 |
68634 * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
68635 * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
68636 * | | QQ | 01, 02, 03, 04 | |
68637 * | | QQQ | Q1, Q2, Q3, Q4 | |
68638 * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
68639 * | | QQQQQ | 1, 2, 3, 4 | 4 |
68640 * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
68641 * | | qo | 1st, 2nd, 3rd, 4th | 7 |
68642 * | | qq | 01, 02, 03, 04 | |
68643 * | | qqq | Q1, Q2, Q3, Q4 | |
68644 * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
68645 * | | qqqqq | 1, 2, 3, 4 | 4 |
68646 * | Month (formatting) | M | 1, 2, ..., 12 | |
68647 * | | Mo | 1st, 2nd, ..., 12th | 7 |
68648 * | | MM | 01, 02, ..., 12 | |
68649 * | | MMM | Jan, Feb, ..., Dec | |
68650 * | | MMMM | January, February, ..., December | 2 |
68651 * | | MMMMM | J, F, ..., D | |
68652 * | Month (stand-alone) | L | 1, 2, ..., 12 | |
68653 * | | Lo | 1st, 2nd, ..., 12th | 7 |
68654 * | | LL | 01, 02, ..., 12 | |
68655 * | | LLL | Jan, Feb, ..., Dec | |
68656 * | | LLLL | January, February, ..., December | 2 |
68657 * | | LLLLL | J, F, ..., D | |
68658 * | Local week of year | w | 1, 2, ..., 53 | |
68659 * | | wo | 1st, 2nd, ..., 53th | 7 |
68660 * | | ww | 01, 02, ..., 53 | |
68661 * | ISO week of year | I | 1, 2, ..., 53 | 7 |
68662 * | | Io | 1st, 2nd, ..., 53th | 7 |
68663 * | | II | 01, 02, ..., 53 | 7 |
68664 * | Day of month | d | 1, 2, ..., 31 | |
68665 * | | do | 1st, 2nd, ..., 31st | 7 |
68666 * | | dd | 01, 02, ..., 31 | |
68667 * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
68668 * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
68669 * | | DD | 01, 02, ..., 365, 366 | 9 |
68670 * | | DDD | 001, 002, ..., 365, 366 | |
68671 * | | DDDD | ... | 3 |
68672 * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
68673 * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
68674 * | | EEEEE | M, T, W, T, F, S, S | |
68675 * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
68676 * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
68677 * | | io | 1st, 2nd, ..., 7th | 7 |
68678 * | | ii | 01, 02, ..., 07 | 7 |
68679 * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
68680 * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
68681 * | | iiiii | M, T, W, T, F, S, S | 7 |
68682 * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
68683 * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
68684 * | | eo | 2nd, 3rd, ..., 1st | 7 |
68685 * | | ee | 02, 03, ..., 01 | |
68686 * | | eee | Mon, Tue, Wed, ..., Sun | |
68687 * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
68688 * | | eeeee | M, T, W, T, F, S, S | |
68689 * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
68690 * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
68691 * | | co | 2nd, 3rd, ..., 1st | 7 |
68692 * | | cc | 02, 03, ..., 01 | |
68693 * | | ccc | Mon, Tue, Wed, ..., Sun | |
68694 * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
68695 * | | ccccc | M, T, W, T, F, S, S | |
68696 * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
68697 * | AM, PM | a..aa | AM, PM | |
68698 * | | aaa | am, pm | |
68699 * | | aaaa | a.m., p.m. | 2 |
68700 * | | aaaaa | a, p | |
68701 * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
68702 * | | bbb | am, pm, noon, midnight | |
68703 * | | bbbb | a.m., p.m., noon, midnight | 2 |
68704 * | | bbbbb | a, p, n, mi | |
68705 * | Flexible day period | B..BBB | at night, in the morning, ... | |
68706 * | | BBBB | at night, in the morning, ... | 2 |
68707 * | | BBBBB | at night, in the morning, ... | |
68708 * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
68709 * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
68710 * | | hh | 01, 02, ..., 11, 12 | |
68711 * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
68712 * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
68713 * | | HH | 00, 01, 02, ..., 23 | |
68714 * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
68715 * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
68716 * | | KK | 01, 02, ..., 11, 00 | |
68717 * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
68718 * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
68719 * | | kk | 24, 01, 02, ..., 23 | |
68720 * | Minute | m | 0, 1, ..., 59 | |
68721 * | | mo | 0th, 1st, ..., 59th | 7 |
68722 * | | mm | 00, 01, ..., 59 | |
68723 * | Second | s | 0, 1, ..., 59 | |
68724 * | | so | 0th, 1st, ..., 59th | 7 |
68725 * | | ss | 00, 01, ..., 59 | |
68726 * | Fraction of second | S | 0, 1, ..., 9 | |
68727 * | | SS | 00, 01, ..., 99 | |
68728 * | | SSS | 000, 001, ..., 999 | |
68729 * | | SSSS | ... | 3 |
68730 * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
68731 * | | XX | -0800, +0530, Z | |
68732 * | | XXX | -08:00, +05:30, Z | |
68733 * | | XXXX | -0800, +0530, Z, +123456 | 2 |
68734 * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
68735 * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
68736 * | | xx | -0800, +0530, +0000 | |
68737 * | | xxx | -08:00, +05:30, +00:00 | 2 |
68738 * | | xxxx | -0800, +0530, +0000, +123456 | |
68739 * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
68740 * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
68741 * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
68742 * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
68743 * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
68744 * | Seconds timestamp | t | 512969520 | 7 |
68745 * | | tt | ... | 3,7 |
68746 * | Milliseconds timestamp | T | 512969520900 | 7 |
68747 * | | TT | ... | 3,7 |
68748 * | Long localized date | P | 04/29/1453 | 7 |
68749 * | | PP | Apr 29, 1453 | 7 |
68750 * | | PPP | April 29th, 1453 | 7 |
68751 * | | PPPP | Friday, April 29th, 1453 | 2,7 |
68752 * | Long localized time | p | 12:00 AM | 7 |
68753 * | | pp | 12:00:00 AM | 7 |
68754 * | | ppp | 12:00:00 AM GMT+2 | 7 |
68755 * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
68756 * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
68757 * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
68758 * | | PPPppp | April 29th, 1453 at ... | 7 |
68759 * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
68760 * Notes:
68761 * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
68762 * are the same as "stand-alone" units, but are different in some languages.
68763 * "Formatting" units are declined according to the rules of the language
68764 * in the context of a date. "Stand-alone" units are always nominative singular:
68765 *
68766 * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
68767 *
68768 * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
68769 *
68770 * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
68771 * the single quote characters (see below).
68772 * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
68773 * the output will be the same as default pattern for this unit, usually
68774 * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
68775 * are marked with "2" in the last column of the table.
68776 *
68777 * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
68778 *
68779 * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
68780 *
68781 * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
68782 *
68783 * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
68784 *
68785 * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
68786 *
68787 * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
68788 * The output will be padded with zeros to match the length of the pattern.
68789 *
68790 * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
68791 *
68792 * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
68793 * These tokens represent the shortest form of the quarter.
68794 *
68795 * 5. The main difference between `y` and `u` patterns are B.C. years:
68796 *
68797 * | Year | `y` | `u` |
68798 * |------|-----|-----|
68799 * | AC 1 | 1 | 1 |
68800 * | BC 1 | 1 | 0 |
68801 * | BC 2 | 2 | -1 |
68802 *
68803 * Also `yy` always returns the last two digits of a year,
68804 * while `uu` pads single digit years to 2 characters and returns other years unchanged:
68805 *
68806 * | Year | `yy` | `uu` |
68807 * |------|------|------|
68808 * | 1 | 01 | 01 |
68809 * | 14 | 14 | 14 |
68810 * | 376 | 76 | 376 |
68811 * | 1453 | 53 | 1453 |
68812 *
68813 * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
68814 * except local week-numbering years are dependent on `options.weekStartsOn`
68815 * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
68816 * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
68817 *
68818 * 6. Specific non-location timezones are currently unavailable in `date-fns`,
68819 * so right now these tokens fall back to GMT timezones.
68820 *
68821 * 7. These patterns are not in the Unicode Technical Standard #35:
68822 * - `i`: ISO day of week
68823 * - `I`: ISO week of year
68824 * - `R`: ISO week-numbering year
68825 * - `t`: seconds timestamp
68826 * - `T`: milliseconds timestamp
68827 * - `o`: ordinal number modifier
68828 * - `P`: long localized date
68829 * - `p`: long localized time
68830 *
68831 * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
68832 * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68833 *
68834 * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
68835 * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68836 *
68837 * @param date - The original date
68838 * @param format - The string of tokens
68839 * @param options - An object with options
68840 *
68841 * @returns The formatted date string
68842 *
68843 * @throws `date` must not be Invalid Date
68844 * @throws `options.locale` must contain `localize` property
68845 * @throws `options.locale` must contain `formatLong` property
68846 * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68847 * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68848 * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68849 * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
68850 * @throws format string contains an unescaped latin alphabet character
68851 *
68852 * @example
68853 * // Represent 11 February 2014 in middle-endian format:
68854 * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
68855 * //=> '02/11/2014'
68856 *
68857 * @example
68858 * // Represent 2 July 2014 in Esperanto:
68859 * import { eoLocale } from 'date-fns/locale/eo'
68860 * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
68861 * locale: eoLocale
68862 * })
68863 * //=> '2-a de julio 2014'
68864 *
68865 * @example
68866 * // Escape string by single quote characters:
68867 * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
68868 * //=> "3 o'clock"
68869 */
68870function format_format(date, formatStr, options) {
68871 const defaultOptions = defaultOptions_getDefaultOptions();
68872 const locale = options?.locale ?? defaultOptions.locale ?? en_US_enUS;
68873
68874 const firstWeekContainsDate =
68875 options?.firstWeekContainsDate ??
68876 options?.locale?.options?.firstWeekContainsDate ??
68877 defaultOptions.firstWeekContainsDate ??
68878 defaultOptions.locale?.options?.firstWeekContainsDate ??
68879 1;
68880
68881 const weekStartsOn =
68882 options?.weekStartsOn ??
68883 options?.locale?.options?.weekStartsOn ??
68884 defaultOptions.weekStartsOn ??
68885 defaultOptions.locale?.options?.weekStartsOn ??
68886 0;
68887
68888 const originalDate = toDate_toDate(date, options?.in);
68889
68890 if (!isValid_isValid(originalDate)) {
68891 throw new RangeError("Invalid time value");
68892 }
68893
68894 let parts = formatStr
68895 .match(format_longFormattingTokensRegExp)
68896 .map((substring) => {
68897 const firstCharacter = substring[0];
68898 if (firstCharacter === "p" || firstCharacter === "P") {
68899 const longFormatter = longFormatters_longFormatters[firstCharacter];
68900 return longFormatter(substring, locale.formatLong);
68901 }
68902 return substring;
68903 })
68904 .join("")
68905 .match(format_formattingTokensRegExp)
68906 .map((substring) => {
68907 // Replace two single quote characters with one single quote character
68908 if (substring === "''") {
68909 return { isToken: false, value: "'" };
68910 }
68911
68912 const firstCharacter = substring[0];
68913 if (firstCharacter === "'") {
68914 return { isToken: false, value: format_cleanEscapedString(substring) };
68915 }
68916
68917 if (formatters_formatters[firstCharacter]) {
68918 return { isToken: true, value: substring };
68919 }
68920
68921 if (firstCharacter.match(format_unescapedLatinCharacterRegExp)) {
68922 throw new RangeError(
68923 "Format string contains an unescaped latin alphabet character `" +
68924 firstCharacter +
68925 "`",
68926 );
68927 }
68928
68929 return { isToken: false, value: substring };
68930 });
68931
68932 // invoke localize preprocessor (only for french locales at the moment)
68933 if (locale.localize.preprocessor) {
68934 parts = locale.localize.preprocessor(originalDate, parts);
68935 }
68936
68937 const formatterOptions = {
68938 firstWeekContainsDate,
68939 weekStartsOn,
68940 locale,
68941 };
68942
68943 return parts
68944 .map((part) => {
68945 if (!part.isToken) return part.value;
68946
68947 const token = part.value;
68948
68949 if (
68950 (!options?.useAdditionalWeekYearTokens &&
68951 protectedTokens_isProtectedWeekYearToken(token)) ||
68952 (!options?.useAdditionalDayOfYearTokens &&
68953 protectedTokens_isProtectedDayOfYearToken(token))
68954 ) {
68955 protectedTokens_warnOrThrowProtectedError(token, formatStr, String(date));
68956 }
68957
68958 const formatter = formatters_formatters[token[0]];
68959 return formatter(originalDate, token, locale.localize, formatterOptions);
68960 })
68961 .join("");
68962}
68963
68964function format_cleanEscapedString(input) {
68965 const matched = input.match(format_escapedStringRegExp);
68966
68967 if (!matched) {
68968 return input;
68969 }
68970
68971 return matched[1].replace(format_doubleQuoteRegExp, "'");
68972}
68973
68974// Fallback for modularized imports:
68975/* harmony default export */ const node_modules_date_fns_format = ((/* unused pure expression or super */ null && (format_format)));
68976
68977;// ./node_modules/react-day-picker/node_modules/date-fns/getMonth.js
68978
68979
68980/**
68981 * The {@link getMonth} function options.
68982 */
68983
68984/**
68985 * @name getMonth
68986 * @category Month Helpers
68987 * @summary Get the month of the given date.
68988 *
68989 * @description
68990 * Get the month of the given date.
68991 *
68992 * @param date - The given date
68993 * @param options - An object with options
68994 *
68995 * @returns The month index (0-11)
68996 *
68997 * @example
68998 * // Which month is 29 February 2012?
68999 * const result = getMonth(new Date(2012, 1, 29))
69000 * //=> 1
69001 */
69002function getMonth(date, options) {
69003 return toDate_toDate(date, options?.in).getMonth();
69004}
69005
69006// Fallback for modularized imports:
69007/* harmony default export */ const date_fns_getMonth = ((/* unused pure expression or super */ null && (getMonth)));
69008
69009;// ./node_modules/react-day-picker/node_modules/date-fns/getYear.js
69010
69011
69012/**
69013 * The {@link getYear} function options.
69014 */
69015
69016/**
69017 * @name getYear
69018 * @category Year Helpers
69019 * @summary Get the year of the given date.
69020 *
69021 * @description
69022 * Get the year of the given date.
69023 *
69024 * @param date - The given date
69025 * @param options - An object with options
69026 *
69027 * @returns The year
69028 *
69029 * @example
69030 * // Which year is 2 July 2014?
69031 * const result = getYear(new Date(2014, 6, 2))
69032 * //=> 2014
69033 */
69034function getYear(date, options) {
69035 return toDate_toDate(date, options?.in).getFullYear();
69036}
69037
69038// Fallback for modularized imports:
69039/* harmony default export */ const date_fns_getYear = ((/* unused pure expression or super */ null && (getYear)));
69040
69041;// ./node_modules/react-day-picker/node_modules/date-fns/isAfter.js
69042
69043
69044/**
69045 * @name isAfter
69046 * @category Common Helpers
69047 * @summary Is the first date after the second one?
69048 *
69049 * @description
69050 * Is the first date after the second one?
69051 *
69052 * @param date - The date that should be after the other one to return true
69053 * @param dateToCompare - The date to compare with
69054 *
69055 * @returns The first date is after the second date
69056 *
69057 * @example
69058 * // Is 10 July 1989 after 11 February 1987?
69059 * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
69060 * //=> true
69061 */
69062function isAfter_isAfter(date, dateToCompare) {
69063 return +toDate_toDate(date) > +toDate_toDate(dateToCompare);
69064}
69065
69066// Fallback for modularized imports:
69067/* harmony default export */ const node_modules_date_fns_isAfter = ((/* unused pure expression or super */ null && (isAfter_isAfter)));
69068
69069;// ./node_modules/react-day-picker/node_modules/date-fns/isBefore.js
69070
69071
69072/**
69073 * @name isBefore
69074 * @category Common Helpers
69075 * @summary Is the first date before the second one?
69076 *
69077 * @description
69078 * Is the first date before the second one?
69079 *
69080 * @param date - The date that should be before the other one to return true
69081 * @param dateToCompare - The date to compare with
69082 *
69083 * @returns The first date is before the second date
69084 *
69085 * @example
69086 * // Is 10 July 1989 before 11 February 1987?
69087 * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
69088 * //=> false
69089 */
69090function isBefore_isBefore(date, dateToCompare) {
69091 return +toDate_toDate(date) < +toDate_toDate(dateToCompare);
69092}
69093
69094// Fallback for modularized imports:
69095/* harmony default export */ const node_modules_date_fns_isBefore = ((/* unused pure expression or super */ null && (isBefore_isBefore)));
69096
69097;// ./node_modules/react-day-picker/node_modules/date-fns/isSameDay.js
69098
69099
69100
69101/**
69102 * The {@link isSameDay} function options.
69103 */
69104
69105/**
69106 * @name isSameDay
69107 * @category Day Helpers
69108 * @summary Are the given dates in the same day (and year and month)?
69109 *
69110 * @description
69111 * Are the given dates in the same day (and year and month)?
69112 *
69113 * @param laterDate - The first date to check
69114 * @param earlierDate - The second date to check
69115 * @param options - An object with options
69116 *
69117 * @returns The dates are in the same day (and year and month)
69118 *
69119 * @example
69120 * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
69121 * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
69122 * //=> true
69123 *
69124 * @example
69125 * // Are 4 September and 4 October in the same day?
69126 * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
69127 * //=> false
69128 *
69129 * @example
69130 * // Are 4 September, 2014 and 4 September, 2015 in the same day?
69131 * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
69132 * //=> false
69133 */
69134function isSameDay_isSameDay(laterDate, earlierDate, options) {
69135 const [dateLeft_, dateRight_] = normalizeDates(
69136 options?.in,
69137 laterDate,
69138 earlierDate,
69139 );
69140 return +startOfDay_startOfDay(dateLeft_) === +startOfDay_startOfDay(dateRight_);
69141}
69142
69143// Fallback for modularized imports:
69144/* harmony default export */ const node_modules_date_fns_isSameDay = ((/* unused pure expression or super */ null && (isSameDay_isSameDay)));
69145
69146;// ./node_modules/react-day-picker/node_modules/date-fns/isSameMonth.js
69147
69148
69149/**
69150 * The {@link isSameMonth} function options.
69151 */
69152
69153/**
69154 * @name isSameMonth
69155 * @category Month Helpers
69156 * @summary Are the given dates in the same month (and year)?
69157 *
69158 * @description
69159 * Are the given dates in the same month (and year)?
69160 *
69161 * @param laterDate - The first date to check
69162 * @param earlierDate - The second date to check
69163 * @param options - An object with options
69164 *
69165 * @returns The dates are in the same month (and year)
69166 *
69167 * @example
69168 * // Are 2 September 2014 and 25 September 2014 in the same month?
69169 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
69170 * //=> true
69171 *
69172 * @example
69173 * // Are 2 September 2014 and 25 September 2015 in the same month?
69174 * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
69175 * //=> false
69176 */
69177function isSameMonth_isSameMonth(laterDate, earlierDate, options) {
69178 const [laterDate_, earlierDate_] = normalizeDates(
69179 options?.in,
69180 laterDate,
69181 earlierDate,
69182 );
69183 return (
69184 laterDate_.getFullYear() === earlierDate_.getFullYear() &&
69185 laterDate_.getMonth() === earlierDate_.getMonth()
69186 );
69187}
69188
69189// Fallback for modularized imports:
69190/* harmony default export */ const node_modules_date_fns_isSameMonth = ((/* unused pure expression or super */ null && (isSameMonth_isSameMonth)));
69191
69192;// ./node_modules/react-day-picker/node_modules/date-fns/isSameYear.js
69193
69194
69195/**
69196 * The {@link isSameYear} function options.
69197 */
69198
69199/**
69200 * @name isSameYear
69201 * @category Year Helpers
69202 * @summary Are the given dates in the same year?
69203 *
69204 * @description
69205 * Are the given dates in the same year?
69206 *
69207 * @param laterDate - The first date to check
69208 * @param earlierDate - The second date to check
69209 * @param options - An object with options
69210 *
69211 * @returns The dates are in the same year
69212 *
69213 * @example
69214 * // Are 2 September 2014 and 25 September 2014 in the same year?
69215 * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
69216 * //=> true
69217 */
69218function isSameYear(laterDate, earlierDate, options) {
69219 const [laterDate_, earlierDate_] = normalizeDates(
69220 options?.in,
69221 laterDate,
69222 earlierDate,
69223 );
69224 return laterDate_.getFullYear() === earlierDate_.getFullYear();
69225}
69226
69227// Fallback for modularized imports:
69228/* harmony default export */ const date_fns_isSameYear = ((/* unused pure expression or super */ null && (isSameYear)));
69229
69230;// ./node_modules/react-day-picker/node_modules/date-fns/max.js
69231
69232
69233
69234/**
69235 * The {@link max} function options.
69236 */
69237
69238/**
69239 * @name max
69240 * @category Common Helpers
69241 * @summary Return the latest of the given dates.
69242 *
69243 * @description
69244 * Return the latest of the given dates.
69245 *
69246 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
69247 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
69248 *
69249 * @param dates - The dates to compare
69250 *
69251 * @returns The latest of the dates
69252 *
69253 * @example
69254 * // Which of these dates is the latest?
69255 * const result = max([
69256 * new Date(1989, 6, 10),
69257 * new Date(1987, 1, 11),
69258 * new Date(1995, 6, 2),
69259 * new Date(1990, 0, 1)
69260 * ])
69261 * //=> Sun Jul 02 1995 00:00:00
69262 */
69263function max_max(dates, options) {
69264 let result;
69265 let context = options?.in;
69266
69267 dates.forEach((date) => {
69268 // Use the first date object as the context function
69269 if (!context && typeof date === "object")
69270 context = constructFrom_constructFrom.bind(null, date);
69271
69272 const date_ = toDate_toDate(date, context);
69273 if (!result || result < date_ || isNaN(+date_)) result = date_;
69274 });
69275
69276 return constructFrom_constructFrom(context, result || NaN);
69277}
69278
69279// Fallback for modularized imports:
69280/* harmony default export */ const date_fns_max = ((/* unused pure expression or super */ null && (max_max)));
69281
69282;// ./node_modules/react-day-picker/node_modules/date-fns/min.js
69283
69284
69285
69286/**
69287 * The {@link min} function options.
69288 */
69289
69290/**
69291 * @name min
69292 * @category Common Helpers
69293 * @summary Returns the earliest of the given dates.
69294 *
69295 * @description
69296 * Returns the earliest of the given dates.
69297 *
69298 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
69299 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
69300 *
69301 * @param dates - The dates to compare
69302 *
69303 * @returns The earliest of the dates
69304 *
69305 * @example
69306 * // Which of these dates is the earliest?
69307 * const result = min([
69308 * new Date(1989, 6, 10),
69309 * new Date(1987, 1, 11),
69310 * new Date(1995, 6, 2),
69311 * new Date(1990, 0, 1)
69312 * ])
69313 * //=> Wed Feb 11 1987 00:00:00
69314 */
69315function min_min(dates, options) {
69316 let result;
69317 let context = options?.in;
69318
69319 dates.forEach((date) => {
69320 // Use the first date object as the context function
69321 if (!context && typeof date === "object")
69322 context = constructFrom_constructFrom.bind(null, date);
69323
69324 const date_ = toDate_toDate(date, context);
69325 if (!result || result > date_ || isNaN(+date_)) result = date_;
69326 });
69327
69328 return constructFrom_constructFrom(context, result || NaN);
69329}
69330
69331// Fallback for modularized imports:
69332/* harmony default export */ const date_fns_min = ((/* unused pure expression or super */ null && (min_min)));
69333
69334;// ./node_modules/react-day-picker/node_modules/date-fns/getDaysInMonth.js
69335
69336
69337
69338/**
69339 * The {@link getDaysInMonth} function options.
69340 */
69341
69342/**
69343 * @name getDaysInMonth
69344 * @category Month Helpers
69345 * @summary Get the number of days in a month of the given date.
69346 *
69347 * @description
69348 * Get the number of days in a month of the given date, considering the context if provided.
69349 *
69350 * @param date - The given date
69351 * @param options - An object with options
69352 *
69353 * @returns The number of days in a month
69354 *
69355 * @example
69356 * // How many days are in February 2000?
69357 * const result = getDaysInMonth(new Date(2000, 1))
69358 * //=> 29
69359 */
69360function getDaysInMonth_getDaysInMonth(date, options) {
69361 const _date = toDate_toDate(date, options?.in);
69362 const year = _date.getFullYear();
69363 const monthIndex = _date.getMonth();
69364 const lastDayOfMonth = constructFrom_constructFrom(_date, 0);
69365 lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
69366 lastDayOfMonth.setHours(0, 0, 0, 0);
69367 return lastDayOfMonth.getDate();
69368}
69369
69370// Fallback for modularized imports:
69371/* harmony default export */ const node_modules_date_fns_getDaysInMonth = ((/* unused pure expression or super */ null && (getDaysInMonth_getDaysInMonth)));
69372
69373;// ./node_modules/react-day-picker/node_modules/date-fns/setMonth.js
69374
69375
69376
69377
69378/**
69379 * The {@link setMonth} function options.
69380 */
69381
69382/**
69383 * @name setMonth
69384 * @category Month Helpers
69385 * @summary Set the month to the given date.
69386 *
69387 * @description
69388 * Set the month to the given date.
69389 *
69390 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
69391 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
69392 *
69393 * @param date - The date to be changed
69394 * @param month - The month index to set (0-11)
69395 * @param options - The options
69396 *
69397 * @returns The new date with the month set
69398 *
69399 * @example
69400 * // Set February to 1 September 2014:
69401 * const result = setMonth(new Date(2014, 8, 1), 1)
69402 * //=> Sat Feb 01 2014 00:00:00
69403 */
69404function setMonth_setMonth(date, month, options) {
69405 const _date = toDate_toDate(date, options?.in);
69406 const year = _date.getFullYear();
69407 const day = _date.getDate();
69408
69409 const midMonth = constructFrom_constructFrom(options?.in || date, 0);
69410 midMonth.setFullYear(year, month, 15);
69411 midMonth.setHours(0, 0, 0, 0);
69412 const daysInMonth = getDaysInMonth_getDaysInMonth(midMonth);
69413
69414 // Set the earlier date, allows to wrap Jan 31 to Feb 28
69415 _date.setMonth(month, Math.min(day, daysInMonth));
69416 return _date;
69417}
69418
69419// Fallback for modularized imports:
69420/* harmony default export */ const node_modules_date_fns_setMonth = ((/* unused pure expression or super */ null && (setMonth_setMonth)));
69421
69422;// ./node_modules/react-day-picker/node_modules/date-fns/setYear.js
69423
69424
69425
69426/**
69427 * The {@link setYear} function options.
69428 */
69429
69430/**
69431 * @name setYear
69432 * @category Year Helpers
69433 * @summary Set the year to the given date.
69434 *
69435 * @description
69436 * Set the year to the given date.
69437 *
69438 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
69439 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
69440 *
69441 * @param date - The date to be changed
69442 * @param year - The year of the new date
69443 * @param options - An object with options.
69444 *
69445 * @returns The new date with the year set
69446 *
69447 * @example
69448 * // Set year 2013 to 1 September 2014:
69449 * const result = setYear(new Date(2014, 8, 1), 2013)
69450 * //=> Sun Sep 01 2013 00:00:00
69451 */
69452function setYear_setYear(date, year, options) {
69453 const date_ = toDate_toDate(date, options?.in);
69454
69455 // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
69456 if (isNaN(+date_)) return constructFrom_constructFrom(options?.in || date, NaN);
69457
69458 date_.setFullYear(year);
69459 return date_;
69460}
69461
69462// Fallback for modularized imports:
69463/* harmony default export */ const node_modules_date_fns_setYear = ((/* unused pure expression or super */ null && (setYear_setYear)));
69464
69465;// ./node_modules/react-day-picker/node_modules/date-fns/startOfMonth.js
69466
69467
69468/**
69469 * The {@link startOfMonth} function options.
69470 */
69471
69472/**
69473 * @name startOfMonth
69474 * @category Month Helpers
69475 * @summary Return the start of a month for the given date.
69476 *
69477 * @description
69478 * Return the start of a month for the given date. The result will be in the local timezone.
69479 *
69480 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
69481 * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
69482 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
69483 * or inferred from the arguments.
69484 *
69485 * @param date - The original date
69486 * @param options - An object with options
69487 *
69488 * @returns The start of a month
69489 *
69490 * @example
69491 * // The start of a month for 2 September 2014 11:55:00:
69492 * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
69493 * //=> Mon Sep 01 2014 00:00:00
69494 */
69495function startOfMonth_startOfMonth(date, options) {
69496 const _date = toDate_toDate(date, options?.in);
69497 _date.setDate(1);
69498 _date.setHours(0, 0, 0, 0);
69499 return _date;
69500}
69501
69502// Fallback for modularized imports:
69503/* harmony default export */ const node_modules_date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth_startOfMonth)));
69504
69505;// ./node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js
69506const FIVE_WEEKS = 5;
69507const FOUR_WEEKS = 4;
69508/**
69509 * Returns the number of weeks to display in the broadcast calendar for a given
69510 * month.
69511 *
69512 * The broadcast calendar may have either 4 or 5 weeks in a month, depending on
69513 * the start and end dates of the broadcast weeks.
69514 *
69515 * @since 9.4.0
69516 * @param month The month for which to calculate the number of weeks.
69517 * @param dateLib The date library to use for date manipulation.
69518 * @returns The number of weeks in the broadcast calendar (4 or 5).
69519 */
69520function getBroadcastWeeksInMonth(month, dateLib) {
69521 // Get the first day of the month
69522 const firstDayOfMonth = dateLib.startOfMonth(month);
69523 // Get the day of the week for the first day of the month (1-7, where 1 is Monday)
69524 const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
69525 const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
69526 const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
69527 const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek)
69528 ? FIVE_WEEKS
69529 : FOUR_WEEKS;
69530 return numberOfWeeks;
69531}
69532
69533;// ./node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js
69534/**
69535 * Returns the start date of the week in the broadcast calendar.
69536 *
69537 * The broadcast week starts on Monday. If the first day of the month is not a
69538 * Monday, this function calculates the previous Monday as the start of the
69539 * broadcast week.
69540 *
69541 * @since 9.4.0
69542 * @param date The date for which to calculate the start of the broadcast week.
69543 * @param dateLib The date library to use for date manipulation.
69544 * @returns The start date of the broadcast week.
69545 */
69546function startOfBroadcastWeek(date, dateLib) {
69547 const firstOfMonth = dateLib.startOfMonth(date);
69548 const dayOfWeek = firstOfMonth.getDay();
69549 if (dayOfWeek === 1) {
69550 return firstOfMonth;
69551 }
69552 else if (dayOfWeek === 0) {
69553 return dateLib.addDays(firstOfMonth, -1 * 6);
69554 }
69555 else {
69556 return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
69557 }
69558}
69559
69560;// ./node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js
69561
69562
69563/**
69564 * Returns the end date of the week in the broadcast calendar.
69565 *
69566 * The broadcast week ends on the last day of the last broadcast week for the
69567 * given date.
69568 *
69569 * @since 9.4.0
69570 * @param date The date for which to calculate the end of the broadcast week.
69571 * @param dateLib The date library to use for date manipulation.
69572 * @returns The end date of the broadcast week.
69573 */
69574function endOfBroadcastWeek(date, dateLib) {
69575 const startDate = startOfBroadcastWeek(date, dateLib);
69576 const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
69577 const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
69578 return endDate;
69579}
69580
69581;// ./node_modules/react-day-picker/dist/esm/classes/DateLib.js
69582
69583
69584
69585
69586
69587/**
69588 * A wrapper class around [date-fns](http://date-fns.org) that provides utility
69589 * methods for date manipulation and formatting.
69590 *
69591 * @since 9.2.0
69592 * @example
69593 * const dateLib = new DateLib({ locale: es });
69594 * const newDate = dateLib.addDays(new Date(), 5);
69595 */
69596class DateLib {
69597 /**
69598 * Creates an instance of `DateLib`.
69599 *
69600 * @param options Configuration options for the date library.
69601 * @param overrides Custom overrides for the date library functions.
69602 */
69603 constructor(options, overrides) {
69604 /**
69605 * Reference to the built-in Date constructor.
69606 *
69607 * @deprecated Use `newDate()` or `today()`.
69608 */
69609 this.Date = Date;
69610 /**
69611 * Creates a new `Date` object representing today's date.
69612 *
69613 * @since 9.5.0
69614 * @returns A `Date` object for today's date.
69615 */
69616 this.today = () => {
69617 if (this.overrides?.today) {
69618 return this.overrides.today();
69619 }
69620 if (this.options.timeZone) {
69621 return date_TZDate.tz(this.options.timeZone);
69622 }
69623 return new this.Date();
69624 };
69625 /**
69626 * Creates a new `Date` object with the specified year, month, and day.
69627 *
69628 * @since 9.5.0
69629 * @param year The year.
69630 * @param monthIndex The month (0-11).
69631 * @param date The day of the month.
69632 * @returns A new `Date` object.
69633 */
69634 this.newDate = (year, monthIndex, date) => {
69635 if (this.overrides?.newDate) {
69636 return this.overrides.newDate(year, monthIndex, date);
69637 }
69638 if (this.options.timeZone) {
69639 return new date_TZDate(year, monthIndex, date, this.options.timeZone);
69640 }
69641 return new Date(year, monthIndex, date);
69642 };
69643 /**
69644 * Adds the specified number of days to the given date.
69645 *
69646 * @param date The date to add days to.
69647 * @param amount The number of days to add.
69648 * @returns The new date with the days added.
69649 */
69650 this.addDays = (date, amount) => {
69651 return this.overrides?.addDays
69652 ? this.overrides.addDays(date, amount)
69653 : addDays_addDays(date, amount);
69654 };
69655 /**
69656 * Adds the specified number of months to the given date.
69657 *
69658 * @param date The date to add months to.
69659 * @param amount The number of months to add.
69660 * @returns The new date with the months added.
69661 */
69662 this.addMonths = (date, amount) => {
69663 return this.overrides?.addMonths
69664 ? this.overrides.addMonths(date, amount)
69665 : addMonths_addMonths(date, amount);
69666 };
69667 /**
69668 * Adds the specified number of weeks to the given date.
69669 *
69670 * @param date The date to add weeks to.
69671 * @param amount The number of weeks to add.
69672 * @returns The new date with the weeks added.
69673 */
69674 this.addWeeks = (date, amount) => {
69675 return this.overrides?.addWeeks
69676 ? this.overrides.addWeeks(date, amount)
69677 : addWeeks_addWeeks(date, amount);
69678 };
69679 /**
69680 * Adds the specified number of years to the given date.
69681 *
69682 * @param date The date to add years to.
69683 * @param amount The number of years to add.
69684 * @returns The new date with the years added.
69685 */
69686 this.addYears = (date, amount) => {
69687 return this.overrides?.addYears
69688 ? this.overrides.addYears(date, amount)
69689 : addYears_addYears(date, amount);
69690 };
69691 /**
69692 * Returns the number of calendar days between the given dates.
69693 *
69694 * @param dateLeft The later date.
69695 * @param dateRight The earlier date.
69696 * @returns The number of calendar days between the dates.
69697 */
69698 this.differenceInCalendarDays = (dateLeft, dateRight) => {
69699 return this.overrides?.differenceInCalendarDays
69700 ? this.overrides.differenceInCalendarDays(dateLeft, dateRight)
69701 : differenceInCalendarDays_differenceInCalendarDays(dateLeft, dateRight);
69702 };
69703 /**
69704 * Returns the number of calendar months between the given dates.
69705 *
69706 * @param dateLeft The later date.
69707 * @param dateRight The earlier date.
69708 * @returns The number of calendar months between the dates.
69709 */
69710 this.differenceInCalendarMonths = (dateLeft, dateRight) => {
69711 return this.overrides?.differenceInCalendarMonths
69712 ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight)
69713 : differenceInCalendarMonths(dateLeft, dateRight);
69714 };
69715 /**
69716 * Returns the months between the given dates.
69717 *
69718 * @param interval The interval to get the months for.
69719 */
69720 this.eachMonthOfInterval = (interval) => {
69721 return this.overrides?.eachMonthOfInterval
69722 ? this.overrides.eachMonthOfInterval(interval)
69723 : eachMonthOfInterval_eachMonthOfInterval(interval);
69724 };
69725 /**
69726 * Returns the years between the given dates.
69727 *
69728 * @since 9.11.1
69729 * @param interval The interval to get the years for.
69730 * @returns The array of years in the interval.
69731 */
69732 this.eachYearOfInterval = (interval) => {
69733 const years = this.overrides?.eachYearOfInterval
69734 ? this.overrides.eachYearOfInterval(interval)
69735 : eachYearOfInterval(interval);
69736 // Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
69737 // See https://github.com/date-fns/tz/issues/72
69738 const uniqueYears = new Set(years.map((d) => this.getYear(d)));
69739 if (uniqueYears.size === years.length) {
69740 // No duplicates, return as is
69741 return years;
69742 }
69743 // Rebuild the array to ensure one date per year
69744 const yearsArray = [];
69745 uniqueYears.forEach((y) => {
69746 yearsArray.push(new Date(y, 0, 1));
69747 });
69748 return yearsArray;
69749 };
69750 /**
69751 * Returns the end of the broadcast week for the given date.
69752 *
69753 * @param date The original date.
69754 * @returns The end of the broadcast week.
69755 */
69756 this.endOfBroadcastWeek = (date) => {
69757 return this.overrides?.endOfBroadcastWeek
69758 ? this.overrides.endOfBroadcastWeek(date)
69759 : endOfBroadcastWeek(date, this);
69760 };
69761 /**
69762 * Returns the end of the ISO week for the given date.
69763 *
69764 * @param date The original date.
69765 * @returns The end of the ISO week.
69766 */
69767 this.endOfISOWeek = (date) => {
69768 return this.overrides?.endOfISOWeek
69769 ? this.overrides.endOfISOWeek(date)
69770 : endOfISOWeek(date);
69771 };
69772 /**
69773 * Returns the end of the month for the given date.
69774 *
69775 * @param date The original date.
69776 * @returns The end of the month.
69777 */
69778 this.endOfMonth = (date) => {
69779 return this.overrides?.endOfMonth
69780 ? this.overrides.endOfMonth(date)
69781 : endOfMonth_endOfMonth(date);
69782 };
69783 /**
69784 * Returns the end of the week for the given date.
69785 *
69786 * @param date The original date.
69787 * @returns The end of the week.
69788 */
69789 this.endOfWeek = (date, options) => {
69790 return this.overrides?.endOfWeek
69791 ? this.overrides.endOfWeek(date, options)
69792 : endOfWeek_endOfWeek(date, this.options);
69793 };
69794 /**
69795 * Returns the end of the year for the given date.
69796 *
69797 * @param date The original date.
69798 * @returns The end of the year.
69799 */
69800 this.endOfYear = (date) => {
69801 return this.overrides?.endOfYear
69802 ? this.overrides.endOfYear(date)
69803 : endOfYear(date);
69804 };
69805 /**
69806 * Formats the given date using the specified format string.
69807 *
69808 * @param date The date to format.
69809 * @param formatStr The format string.
69810 * @returns The formatted date string.
69811 */
69812 this.format = (date, formatStr, _options) => {
69813 const formatted = this.overrides?.format
69814 ? this.overrides.format(date, formatStr, this.options)
69815 : format_format(date, formatStr, this.options);
69816 if (this.options.numerals && this.options.numerals !== "latn") {
69817 return this.replaceDigits(formatted);
69818 }
69819 return formatted;
69820 };
69821 /**
69822 * Returns the ISO week number for the given date.
69823 *
69824 * @param date The date to get the ISO week number for.
69825 * @returns The ISO week number.
69826 */
69827 this.getISOWeek = (date) => {
69828 return this.overrides?.getISOWeek
69829 ? this.overrides.getISOWeek(date)
69830 : getISOWeek_getISOWeek(date);
69831 };
69832 /**
69833 * Returns the month of the given date.
69834 *
69835 * @param date The date to get the month for.
69836 * @returns The month.
69837 */
69838 this.getMonth = (date, _options) => {
69839 return this.overrides?.getMonth
69840 ? this.overrides.getMonth(date, this.options)
69841 : getMonth(date, this.options);
69842 };
69843 /**
69844 * Returns the year of the given date.
69845 *
69846 * @param date The date to get the year for.
69847 * @returns The year.
69848 */
69849 this.getYear = (date, _options) => {
69850 return this.overrides?.getYear
69851 ? this.overrides.getYear(date, this.options)
69852 : getYear(date, this.options);
69853 };
69854 /**
69855 * Returns the local week number for the given date.
69856 *
69857 * @param date The date to get the week number for.
69858 * @returns The week number.
69859 */
69860 this.getWeek = (date, _options) => {
69861 return this.overrides?.getWeek
69862 ? this.overrides.getWeek(date, this.options)
69863 : getWeek_getWeek(date, this.options);
69864 };
69865 /**
69866 * Checks if the first date is after the second date.
69867 *
69868 * @param date The date to compare.
69869 * @param dateToCompare The date to compare with.
69870 * @returns True if the first date is after the second date.
69871 */
69872 this.isAfter = (date, dateToCompare) => {
69873 return this.overrides?.isAfter
69874 ? this.overrides.isAfter(date, dateToCompare)
69875 : isAfter_isAfter(date, dateToCompare);
69876 };
69877 /**
69878 * Checks if the first date is before the second date.
69879 *
69880 * @param date The date to compare.
69881 * @param dateToCompare The date to compare with.
69882 * @returns True if the first date is before the second date.
69883 */
69884 this.isBefore = (date, dateToCompare) => {
69885 return this.overrides?.isBefore
69886 ? this.overrides.isBefore(date, dateToCompare)
69887 : isBefore_isBefore(date, dateToCompare);
69888 };
69889 /**
69890 * Checks if the given value is a Date object.
69891 *
69892 * @param value The value to check.
69893 * @returns True if the value is a Date object.
69894 */
69895 this.isDate = (value) => {
69896 return this.overrides?.isDate
69897 ? this.overrides.isDate(value)
69898 : isDate_isDate(value);
69899 };
69900 /**
69901 * Checks if the given dates are on the same day.
69902 *
69903 * @param dateLeft The first date to compare.
69904 * @param dateRight The second date to compare.
69905 * @returns True if the dates are on the same day.
69906 */
69907 this.isSameDay = (dateLeft, dateRight) => {
69908 return this.overrides?.isSameDay
69909 ? this.overrides.isSameDay(dateLeft, dateRight)
69910 : isSameDay_isSameDay(dateLeft, dateRight);
69911 };
69912 /**
69913 * Checks if the given dates are in the same month.
69914 *
69915 * @param dateLeft The first date to compare.
69916 * @param dateRight The second date to compare.
69917 * @returns True if the dates are in the same month.
69918 */
69919 this.isSameMonth = (dateLeft, dateRight) => {
69920 return this.overrides?.isSameMonth
69921 ? this.overrides.isSameMonth(dateLeft, dateRight)
69922 : isSameMonth_isSameMonth(dateLeft, dateRight);
69923 };
69924 /**
69925 * Checks if the given dates are in the same year.
69926 *
69927 * @param dateLeft The first date to compare.
69928 * @param dateRight The second date to compare.
69929 * @returns True if the dates are in the same year.
69930 */
69931 this.isSameYear = (dateLeft, dateRight) => {
69932 return this.overrides?.isSameYear
69933 ? this.overrides.isSameYear(dateLeft, dateRight)
69934 : isSameYear(dateLeft, dateRight);
69935 };
69936 /**
69937 * Returns the latest date in the given array of dates.
69938 *
69939 * @param dates The array of dates to compare.
69940 * @returns The latest date.
69941 */
69942 this.max = (dates) => {
69943 return this.overrides?.max ? this.overrides.max(dates) : max_max(dates);
69944 };
69945 /**
69946 * Returns the earliest date in the given array of dates.
69947 *
69948 * @param dates The array of dates to compare.
69949 * @returns The earliest date.
69950 */
69951 this.min = (dates) => {
69952 return this.overrides?.min ? this.overrides.min(dates) : min_min(dates);
69953 };
69954 /**
69955 * Sets the month of the given date.
69956 *
69957 * @param date The date to set the month on.
69958 * @param month The month to set (0-11).
69959 * @returns The new date with the month set.
69960 */
69961 this.setMonth = (date, month) => {
69962 return this.overrides?.setMonth
69963 ? this.overrides.setMonth(date, month)
69964 : setMonth_setMonth(date, month);
69965 };
69966 /**
69967 * Sets the year of the given date.
69968 *
69969 * @param date The date to set the year on.
69970 * @param year The year to set.
69971 * @returns The new date with the year set.
69972 */
69973 this.setYear = (date, year) => {
69974 return this.overrides?.setYear
69975 ? this.overrides.setYear(date, year)
69976 : setYear_setYear(date, year);
69977 };
69978 /**
69979 * Returns the start of the broadcast week for the given date.
69980 *
69981 * @param date The original date.
69982 * @returns The start of the broadcast week.
69983 */
69984 this.startOfBroadcastWeek = (date, _dateLib) => {
69985 return this.overrides?.startOfBroadcastWeek
69986 ? this.overrides.startOfBroadcastWeek(date, this)
69987 : startOfBroadcastWeek(date, this);
69988 };
69989 /**
69990 * Returns the start of the day for the given date.
69991 *
69992 * @param date The original date.
69993 * @returns The start of the day.
69994 */
69995 this.startOfDay = (date) => {
69996 return this.overrides?.startOfDay
69997 ? this.overrides.startOfDay(date)
69998 : startOfDay_startOfDay(date);
69999 };
70000 /**
70001 * Returns the start of the ISO week for the given date.
70002 *
70003 * @param date The original date.
70004 * @returns The start of the ISO week.
70005 */
70006 this.startOfISOWeek = (date) => {
70007 return this.overrides?.startOfISOWeek
70008 ? this.overrides.startOfISOWeek(date)
70009 : startOfISOWeek_startOfISOWeek(date);
70010 };
70011 /**
70012 * Returns the start of the month for the given date.
70013 *
70014 * @param date The original date.
70015 * @returns The start of the month.
70016 */
70017 this.startOfMonth = (date) => {
70018 return this.overrides?.startOfMonth
70019 ? this.overrides.startOfMonth(date)
70020 : startOfMonth_startOfMonth(date);
70021 };
70022 /**
70023 * Returns the start of the week for the given date.
70024 *
70025 * @param date The original date.
70026 * @returns The start of the week.
70027 */
70028 this.startOfWeek = (date, _options) => {
70029 return this.overrides?.startOfWeek
70030 ? this.overrides.startOfWeek(date, this.options)
70031 : startOfWeek_startOfWeek(date, this.options);
70032 };
70033 /**
70034 * Returns the start of the year for the given date.
70035 *
70036 * @param date The original date.
70037 * @returns The start of the year.
70038 */
70039 this.startOfYear = (date) => {
70040 return this.overrides?.startOfYear
70041 ? this.overrides.startOfYear(date)
70042 : startOfYear_startOfYear(date);
70043 };
70044 this.options = { locale: en_US_enUS, ...options };
70045 this.overrides = overrides;
70046 }
70047 /**
70048 * Generates a mapping of Arabic digits (0-9) to the target numbering system
70049 * digits.
70050 *
70051 * @since 9.5.0
70052 * @returns A record mapping Arabic digits to the target numerals.
70053 */
70054 getDigitMap() {
70055 const { numerals = "latn" } = this.options;
70056 // Use Intl.NumberFormat to create a formatter with the specified numbering system
70057 const formatter = new Intl.NumberFormat("en-US", {
70058 numberingSystem: numerals,
70059 });
70060 // Map Arabic digits (0-9) to the target numerals
70061 const digitMap = {};
70062 for (let i = 0; i < 10; i++) {
70063 digitMap[i.toString()] = formatter.format(i);
70064 }
70065 return digitMap;
70066 }
70067 /**
70068 * Replaces Arabic digits in a string with the target numbering system digits.
70069 *
70070 * @since 9.5.0
70071 * @param input The string containing Arabic digits.
70072 * @returns The string with digits replaced.
70073 */
70074 replaceDigits(input) {
70075 const digitMap = this.getDigitMap();
70076 return input.replace(/\d/g, (digit) => digitMap[digit] || digit);
70077 }
70078 /**
70079 * Formats a number using the configured numbering system.
70080 *
70081 * @since 9.5.0
70082 * @param value The number to format.
70083 * @returns The formatted number as a string.
70084 */
70085 formatNumber(value) {
70086 return this.replaceDigits(value.toString());
70087 }
70088 /**
70089 * Returns the preferred ordering for month and year labels for the current
70090 * locale.
70091 */
70092 getMonthYearOrder() {
70093 const code = this.options.locale?.code;
70094 if (!code) {
70095 return "month-first";
70096 }
70097 return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
70098 }
70099 /**
70100 * Formats the month/year pair respecting locale conventions.
70101 *
70102 * @since 9.11.0
70103 */
70104 formatMonthYear(date) {
70105 const { locale, timeZone, numerals } = this.options;
70106 const localeCode = locale?.code;
70107 if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
70108 try {
70109 const intl = new Intl.DateTimeFormat(localeCode, {
70110 month: "long",
70111 year: "numeric",
70112 timeZone,
70113 numberingSystem: numerals,
70114 });
70115 const formatted = intl.format(date);
70116 return formatted;
70117 }
70118 catch {
70119 // Fallback to date-fns formatting below.
70120 }
70121 }
70122 const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
70123 return this.format(date, pattern);
70124 }
70125}
70126DateLib.yearFirstLocales = new Set([
70127 "eu",
70128 "hu",
70129 "ja",
70130 "ja-Hira",
70131 "ja-JP",
70132 "ko",
70133 "ko-KR",
70134 "lt",
70135 "lt-LT",
70136 "lv",
70137 "lv-LV",
70138 "mn",
70139 "mn-MN",
70140 "zh",
70141 "zh-CN",
70142 "zh-HK",
70143 "zh-TW",
70144]);
70145/** The default locale (English). */
70146
70147/**
70148 * The default date library with English locale.
70149 *
70150 * @since 9.2.0
70151 */
70152const DateLib_defaultDateLib = new DateLib();
70153/**
70154 * @ignore
70155 * @deprecated Use `defaultDateLib`.
70156 */
70157const dateLib = (/* unused pure expression or super */ null && (DateLib_defaultDateLib));
70158
70159;// ./node_modules/react-day-picker/dist/esm/UI.js
70160/**
70161 * Enum representing the UI elements composing DayPicker. These elements are
70162 * mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
70163 *
70164 * Some elements are extended by flags and modifiers.
70165 */
70166var UI_UI;
70167(function (UI) {
70168 /** The root component displaying the months and the navigation bar. */
70169 UI["Root"] = "root";
70170 /** The Chevron SVG element used by navigation buttons and dropdowns. */
70171 UI["Chevron"] = "chevron";
70172 /**
70173 * The grid cell with the day's date. Extended by {@link DayFlag} and
70174 * {@link SelectionState}.
70175 */
70176 UI["Day"] = "day";
70177 /** The button containing the formatted day's date, inside the grid cell. */
70178 UI["DayButton"] = "day_button";
70179 /** The caption label of the month (when not showing the dropdown navigation). */
70180 UI["CaptionLabel"] = "caption_label";
70181 /** The container of the dropdown navigation (when enabled). */
70182 UI["Dropdowns"] = "dropdowns";
70183 /** The dropdown element to select for years and months. */
70184 UI["Dropdown"] = "dropdown";
70185 /** The container element of the dropdown. */
70186 UI["DropdownRoot"] = "dropdown_root";
70187 /** The root element of the footer. */
70188 UI["Footer"] = "footer";
70189 /** The month grid. */
70190 UI["MonthGrid"] = "month_grid";
70191 /** Contains the dropdown navigation or the caption label. */
70192 UI["MonthCaption"] = "month_caption";
70193 /** The dropdown with the months. */
70194 UI["MonthsDropdown"] = "months_dropdown";
70195 /** Wrapper of the month grid. */
70196 UI["Month"] = "month";
70197 /** The container of the displayed months. */
70198 UI["Months"] = "months";
70199 /** The navigation bar with the previous and next buttons. */
70200 UI["Nav"] = "nav";
70201 /**
70202 * The next month button in the navigation. *
70203 *
70204 * @since 9.1.0
70205 */
70206 UI["NextMonthButton"] = "button_next";
70207 /**
70208 * The previous month button in the navigation.
70209 *
70210 * @since 9.1.0
70211 */
70212 UI["PreviousMonthButton"] = "button_previous";
70213 /** The row containing the week. */
70214 UI["Week"] = "week";
70215 /** The group of row weeks in a month (`tbody`). */
70216 UI["Weeks"] = "weeks";
70217 /** The column header with the weekday. */
70218 UI["Weekday"] = "weekday";
70219 /** The row grouping the weekdays in the column headers. */
70220 UI["Weekdays"] = "weekdays";
70221 /** The cell containing the week number. */
70222 UI["WeekNumber"] = "week_number";
70223 /** The cell header of the week numbers column. */
70224 UI["WeekNumberHeader"] = "week_number_header";
70225 /** The dropdown with the years. */
70226 UI["YearsDropdown"] = "years_dropdown";
70227})(UI_UI || (UI_UI = {}));
70228/** Enum representing flags for the {@link UI.Day} element. */
70229var DayFlag;
70230(function (DayFlag) {
70231 /** The day is disabled. */
70232 DayFlag["disabled"] = "disabled";
70233 /** The day is hidden. */
70234 DayFlag["hidden"] = "hidden";
70235 /** The day is outside the current month. */
70236 DayFlag["outside"] = "outside";
70237 /** The day is focused. */
70238 DayFlag["focused"] = "focused";
70239 /** The day is today. */
70240 DayFlag["today"] = "today";
70241})(DayFlag || (DayFlag = {}));
70242/**
70243 * Enum representing selection states that can be applied to the {@link UI.Day}
70244 * element in selection mode.
70245 */
70246var SelectionState;
70247(function (SelectionState) {
70248 /** The day is at the end of a selected range. */
70249 SelectionState["range_end"] = "range_end";
70250 /** The day is at the middle of a selected range. */
70251 SelectionState["range_middle"] = "range_middle";
70252 /** The day is at the start of a selected range. */
70253 SelectionState["range_start"] = "range_start";
70254 /** The day is selected. */
70255 SelectionState["selected"] = "selected";
70256})(SelectionState || (SelectionState = {}));
70257/**
70258 * Enum representing different animation states for transitioning between
70259 * months.
70260 */
70261var Animation;
70262(function (Animation) {
70263 /** The entering weeks when they appear before the exiting month. */
70264 Animation["weeks_before_enter"] = "weeks_before_enter";
70265 /** The exiting weeks when they disappear before the entering month. */
70266 Animation["weeks_before_exit"] = "weeks_before_exit";
70267 /** The entering weeks when they appear after the exiting month. */
70268 Animation["weeks_after_enter"] = "weeks_after_enter";
70269 /** The exiting weeks when they disappear after the entering month. */
70270 Animation["weeks_after_exit"] = "weeks_after_exit";
70271 /** The entering caption when it appears after the exiting month. */
70272 Animation["caption_after_enter"] = "caption_after_enter";
70273 /** The exiting caption when it disappears after the entering month. */
70274 Animation["caption_after_exit"] = "caption_after_exit";
70275 /** The entering caption when it appears before the exiting month. */
70276 Animation["caption_before_enter"] = "caption_before_enter";
70277 /** The exiting caption when it disappears before the entering month. */
70278 Animation["caption_before_exit"] = "caption_before_exit";
70279})(Animation || (Animation = {}));
70280
70281;// ./node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
70282
70283/**
70284 * Checks if a given date is within a specified date range.
70285 *
70286 * @since 9.0.0
70287 * @param range - The date range to check against.
70288 * @param date - The date to check.
70289 * @param excludeEnds - If `true`, the range's start and end dates are excluded.
70290 * @param dateLib - The date utility library instance.
70291 * @returns `true` if the date is within the range, otherwise `false`.
70292 * @group Utilities
70293 */
70294function rangeIncludesDate(range, date, excludeEnds = false, dateLib = DateLib_defaultDateLib) {
70295 let { from, to } = range;
70296 const { differenceInCalendarDays, isSameDay } = dateLib;
70297 if (from && to) {
70298 const isRangeInverted = differenceInCalendarDays(to, from) < 0;
70299 if (isRangeInverted) {
70300 [from, to] = [to, from];
70301 }
70302 const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&
70303 differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);
70304 return isInRange;
70305 }
70306 if (!excludeEnds && to) {
70307 return isSameDay(to, date);
70308 }
70309 if (!excludeEnds && from) {
70310 return isSameDay(from, date);
70311 }
70312 return false;
70313}
70314/**
70315 * @private
70316 * @deprecated Use {@link rangeIncludesDate} instead.
70317 */
70318const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, defaultDateLib);
70319
70320;// ./node_modules/react-day-picker/dist/esm/utils/typeguards.js
70321/**
70322 * Checks if the given value is of type {@link DateInterval}.
70323 *
70324 * @param matcher - The value to check.
70325 * @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
70326 * @group Utilities
70327 */
70328function isDateInterval(matcher) {
70329 return Boolean(matcher &&
70330 typeof matcher === "object" &&
70331 "before" in matcher &&
70332 "after" in matcher);
70333}
70334/**
70335 * Checks if the given value is of type {@link DateRange}.
70336 *
70337 * @param value - The value to check.
70338 * @returns `true` if the value is a {@link DateRange}, otherwise `false`.
70339 * @group Utilities
70340 */
70341function isDateRange(value) {
70342 return Boolean(value && typeof value === "object" && "from" in value);
70343}
70344/**
70345 * Checks if the given value is of type {@link DateAfter}.
70346 *
70347 * @param value - The value to check.
70348 * @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
70349 * @group Utilities
70350 */
70351function isDateAfterType(value) {
70352 return Boolean(value && typeof value === "object" && "after" in value);
70353}
70354/**
70355 * Checks if the given value is of type {@link DateBefore}.
70356 *
70357 * @param value - The value to check.
70358 * @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
70359 * @group Utilities
70360 */
70361function isDateBeforeType(value) {
70362 return Boolean(value && typeof value === "object" && "before" in value);
70363}
70364/**
70365 * Checks if the given value is of type {@link DayOfWeek}.
70366 *
70367 * @param value - The value to check.
70368 * @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
70369 * @group Utilities
70370 */
70371function isDayOfWeekType(value) {
70372 return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
70373}
70374/**
70375 * Checks if the given value is an array of valid dates.
70376 *
70377 * @private
70378 * @param value - The value to check.
70379 * @param dateLib - The date utility library instance.
70380 * @returns `true` if the value is an array of valid dates, otherwise `false`.
70381 */
70382function isDatesArray(value, dateLib) {
70383 return Array.isArray(value) && value.every(dateLib.isDate);
70384}
70385
70386;// ./node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js
70387
70388
70389
70390/**
70391 * Checks if a given date matches at least one of the specified {@link Matcher}.
70392 *
70393 * @param date - The date to check.
70394 * @param matchers - The matchers to check against.
70395 * @param dateLib - The date utility library instance.
70396 * @returns `true` if the date matches any of the matchers, otherwise `false`.
70397 * @group Utilities
70398 */
70399function dateMatchModifiers(date, matchers, dateLib = DateLib_defaultDateLib) {
70400 const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
70401 const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;
70402 return matchersArr.some((matcher) => {
70403 if (typeof matcher === "boolean") {
70404 return matcher;
70405 }
70406 if (dateLib.isDate(matcher)) {
70407 return isSameDay(date, matcher);
70408 }
70409 if (isDatesArray(matcher, dateLib)) {
70410 return matcher.includes(date);
70411 }
70412 if (isDateRange(matcher)) {
70413 return rangeIncludesDate(matcher, date, false, dateLib);
70414 }
70415 if (isDayOfWeekType(matcher)) {
70416 if (!Array.isArray(matcher.dayOfWeek)) {
70417 return matcher.dayOfWeek === date.getDay();
70418 }
70419 return matcher.dayOfWeek.includes(date.getDay());
70420 }
70421 if (isDateInterval(matcher)) {
70422 const diffBefore = differenceInCalendarDays(matcher.before, date);
70423 const diffAfter = differenceInCalendarDays(matcher.after, date);
70424 const isDayBefore = diffBefore > 0;
70425 const isDayAfter = diffAfter < 0;
70426 const isClosedInterval = isAfter(matcher.before, matcher.after);
70427 if (isClosedInterval) {
70428 return isDayAfter && isDayBefore;
70429 }
70430 else {
70431 return isDayBefore || isDayAfter;
70432 }
70433 }
70434 if (isDateAfterType(matcher)) {
70435 return differenceInCalendarDays(date, matcher.after) > 0;
70436 }
70437 if (isDateBeforeType(matcher)) {
70438 return differenceInCalendarDays(matcher.before, date) > 0;
70439 }
70440 if (typeof matcher === "function") {
70441 return matcher(date);
70442 }
70443 return false;
70444 });
70445}
70446/**
70447 * @private
70448 * @deprecated Use {@link dateMatchModifiers} instead.
70449 */
70450const isMatch = (/* unused pure expression or super */ null && (dateMatchModifiers));
70451
70452;// ./node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
70453
70454
70455/**
70456 * Creates a function to retrieve the modifiers for a given day.
70457 *
70458 * This function calculates both internal and custom modifiers for each day
70459 * based on the provided calendar days and DayPicker props.
70460 *
70461 * @private
70462 * @param days The array of `CalendarDay` objects to process.
70463 * @param props The DayPicker props, including modifiers and configuration
70464 * options.
70465 * @param dateLib The date library to use for date manipulation.
70466 * @returns A function that retrieves the modifiers for a given `CalendarDay`.
70467 */
70468function createGetModifiers(days, props, navStart, navEnd, dateLib) {
70469 const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
70470 const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
70471 const computedNavStart = navStart && startOfMonth(navStart);
70472 const computedNavEnd = navEnd && endOfMonth(navEnd);
70473 const internalModifiersMap = {
70474 [DayFlag.focused]: [],
70475 [DayFlag.outside]: [],
70476 [DayFlag.disabled]: [],
70477 [DayFlag.hidden]: [],
70478 [DayFlag.today]: [],
70479 };
70480 const customModifiersMap = {};
70481 for (const day of days) {
70482 const { date, displayMonth } = day;
70483 const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
70484 const isBeforeNavStart = Boolean(computedNavStart && isBefore(date, computedNavStart));
70485 const isAfterNavEnd = Boolean(computedNavEnd && isAfter(date, computedNavEnd));
70486 const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
70487 const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||
70488 isBeforeNavStart ||
70489 isAfterNavEnd ||
70490 // Broadcast calendar will show outside days as default
70491 (!broadcastCalendar && !showOutsideDays && isOutside) ||
70492 (broadcastCalendar && showOutsideDays === false && isOutside);
70493 const isToday = isSameDay(date, today ?? dateLib.today());
70494 if (isOutside)
70495 internalModifiersMap.outside.push(day);
70496 if (isDisabled)
70497 internalModifiersMap.disabled.push(day);
70498 if (isHidden)
70499 internalModifiersMap.hidden.push(day);
70500 if (isToday)
70501 internalModifiersMap.today.push(day);
70502 // Add custom modifiers
70503 if (modifiers) {
70504 Object.keys(modifiers).forEach((name) => {
70505 const modifierValue = modifiers?.[name];
70506 const isMatch = modifierValue
70507 ? dateMatchModifiers(date, modifierValue, dateLib)
70508 : false;
70509 if (!isMatch)
70510 return;
70511 if (customModifiersMap[name]) {
70512 customModifiersMap[name].push(day);
70513 }
70514 else {
70515 customModifiersMap[name] = [day];
70516 }
70517 });
70518 }
70519 }
70520 return (day) => {
70521 // Initialize all the modifiers to false
70522 const dayFlags = {
70523 [DayFlag.focused]: false,
70524 [DayFlag.disabled]: false,
70525 [DayFlag.hidden]: false,
70526 [DayFlag.outside]: false,
70527 [DayFlag.today]: false,
70528 };
70529 const customModifiers = {};
70530 // Find the modifiers for the given day
70531 for (const name in internalModifiersMap) {
70532 const days = internalModifiersMap[name];
70533 dayFlags[name] = days.some((d) => d === day);
70534 }
70535 for (const name in customModifiersMap) {
70536 customModifiers[name] = customModifiersMap[name].some((d) => d === day);
70537 }
70538 return {
70539 ...dayFlags,
70540 // custom modifiers should override all the previous ones
70541 ...customModifiers,
70542 };
70543 };
70544}
70545
70546;// ./node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js
70547
70548/**
70549 * Returns the class names for a day based on its modifiers.
70550 *
70551 * This function combines the base class name for the day with any class names
70552 * associated with active modifiers.
70553 *
70554 * @param modifiers The modifiers applied to the day.
70555 * @param classNames The base class names for the calendar elements.
70556 * @param modifiersClassNames The class names associated with specific
70557 * modifiers.
70558 * @returns An array of class names for the day.
70559 */
70560function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
70561 const modifierClassNames = Object.entries(modifiers)
70562 .filter(([, active]) => active === true)
70563 .reduce((previousValue, [key]) => {
70564 if (modifiersClassNames[key]) {
70565 previousValue.push(modifiersClassNames[key]);
70566 }
70567 else if (classNames[DayFlag[key]]) {
70568 previousValue.push(classNames[DayFlag[key]]);
70569 }
70570 else if (classNames[SelectionState[key]]) {
70571 previousValue.push(classNames[SelectionState[key]]);
70572 }
70573 return previousValue;
70574 }, [classNames[UI_UI.Day]]);
70575 return modifierClassNames;
70576}
70577
70578;// ./node_modules/react-day-picker/dist/esm/components/Button.js
70579
70580/**
70581 * Render the button elements in the calendar.
70582 *
70583 * @private
70584 * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.
70585 */
70586function Button_Button(props) {
70587 return external_React_.createElement("button", { ...props });
70588}
70589
70590;// ./node_modules/react-day-picker/dist/esm/components/CaptionLabel.js
70591
70592/**
70593 * Render the label in the month caption.
70594 *
70595 * @group Components
70596 * @see https://daypicker.dev/guides/custom-components
70597 */
70598function CaptionLabel(props) {
70599 return external_React_.createElement("span", { ...props });
70600}
70601
70602;// ./node_modules/react-day-picker/dist/esm/components/Chevron.js
70603
70604/**
70605 * Render the chevron icon used in the navigation buttons and dropdowns.
70606 *
70607 * @group Components
70608 * @see https://daypicker.dev/guides/custom-components
70609 */
70610function Chevron(props) {
70611 const { size = 24, orientation = "left", className } = props;
70612 return (
70613 // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
70614 external_React_.createElement("svg", { className: className, width: size, height: size, viewBox: "0 0 24 24" },
70615 orientation === "up" && (external_React_.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" })),
70616 orientation === "down" && (external_React_.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" })),
70617 orientation === "left" && (external_React_.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" })),
70618 orientation === "right" && (external_React_.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" }))));
70619}
70620
70621;// ./node_modules/react-day-picker/dist/esm/components/Day.js
70622
70623/**
70624 * Render a grid cell for a specific day in the calendar.
70625 *
70626 * Handles interaction and focus for the day. If you only need to change the
70627 * content of the day cell, consider swapping the `DayButton` component
70628 * instead.
70629 *
70630 * @group Components
70631 * @see https://daypicker.dev/guides/custom-components
70632 */
70633function Day_Day(props) {
70634 const { day, modifiers, ...tdProps } = props;
70635 return external_React_.createElement("td", { ...tdProps });
70636}
70637
70638;// ./node_modules/react-day-picker/dist/esm/components/DayButton.js
70639
70640/**
70641 * Render a button for a specific day in the calendar.
70642 *
70643 * @group Components
70644 * @see https://daypicker.dev/guides/custom-components
70645 */
70646function DayButton_DayButton(props) {
70647 const { day, modifiers, ...buttonProps } = props;
70648 const ref = external_React_.useRef(null);
70649 external_React_.useEffect(() => {
70650 if (modifiers.focused)
70651 ref.current?.focus();
70652 }, [modifiers.focused]);
70653 return external_React_.createElement("button", { ref: ref, ...buttonProps });
70654}
70655
70656;// ./node_modules/react-day-picker/dist/esm/components/Dropdown.js
70657
70658
70659/**
70660 * Render a dropdown component for navigation in the calendar.
70661 *
70662 * @group Components
70663 * @see https://daypicker.dev/guides/custom-components
70664 */
70665function Dropdown_Dropdown(props) {
70666 const { options, className, components, classNames, ...selectProps } = props;
70667 const cssClassSelect = [classNames[UI_UI.Dropdown], className].join(" ");
70668 const selectedOption = options?.find(({ value }) => value === selectProps.value);
70669 return (external_React_.createElement("span", { "data-disabled": selectProps.disabled, className: classNames[UI_UI.DropdownRoot] },
70670 external_React_.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => (external_React_.createElement(components.Option, { key: value, value: value, disabled: disabled }, label)))),
70671 external_React_.createElement("span", { className: classNames[UI_UI.CaptionLabel], "aria-hidden": true },
70672 selectedOption?.label,
70673 external_React_.createElement(components.Chevron, { orientation: "down", size: 18, className: classNames[UI_UI.Chevron] }))));
70674}
70675
70676;// ./node_modules/react-day-picker/dist/esm/components/DropdownNav.js
70677
70678/**
70679 * Render the navigation dropdowns for the calendar.
70680 *
70681 * @group Components
70682 * @see https://daypicker.dev/guides/custom-components
70683 */
70684function DropdownNav(props) {
70685 return external_React_.createElement("div", { ...props });
70686}
70687
70688;// ./node_modules/react-day-picker/dist/esm/components/Footer.js
70689
70690/**
70691 * Render the footer of the calendar.
70692 *
70693 * @group Components
70694 * @see https://daypicker.dev/guides/custom-components
70695 */
70696function Footer_Footer(props) {
70697 return external_React_.createElement("div", { ...props });
70698}
70699
70700;// ./node_modules/react-day-picker/dist/esm/components/Month.js
70701
70702/**
70703 * Render the grid with the weekday header row and the weeks for a specific
70704 * month.
70705 *
70706 * @group Components
70707 * @see https://daypicker.dev/guides/custom-components
70708 */
70709function Month_Month(props) {
70710 const { calendarMonth, displayIndex, ...divProps } = props;
70711 return external_React_.createElement("div", { ...divProps }, props.children);
70712}
70713
70714;// ./node_modules/react-day-picker/dist/esm/components/MonthCaption.js
70715
70716/**
70717 * Render the caption for a month in the calendar.
70718 *
70719 * @group Components
70720 * @see https://daypicker.dev/guides/custom-components
70721 */
70722function MonthCaption(props) {
70723 const { calendarMonth, displayIndex, ...divProps } = props;
70724 return external_React_.createElement("div", { ...divProps });
70725}
70726
70727;// ./node_modules/react-day-picker/dist/esm/components/MonthGrid.js
70728
70729/**
70730 * Render the grid of days for a specific month.
70731 *
70732 * @group Components
70733 * @see https://daypicker.dev/guides/custom-components
70734 */
70735function MonthGrid(props) {
70736 return external_React_.createElement("table", { ...props });
70737}
70738
70739;// ./node_modules/react-day-picker/dist/esm/components/Months.js
70740
70741/**
70742 * Render a container wrapping the month grids.
70743 *
70744 * @group Components
70745 * @see https://daypicker.dev/guides/custom-components
70746 */
70747function Months(props) {
70748 return external_React_.createElement("div", { ...props });
70749}
70750
70751;// ./node_modules/react-day-picker/dist/esm/useDayPicker.js
70752
70753/** @ignore */
70754const dayPickerContext = (0,external_React_.createContext)(undefined);
70755/**
70756 * Provides access to the DayPicker context, which includes properties and
70757 * methods to interact with the DayPicker component. This hook must be used
70758 * within a custom component.
70759 *
70760 * @template T - Use this type to refine the returned context type with a
70761 * specific selection mode.
70762 * @returns The context to work with DayPicker.
70763 * @throws {Error} If the hook is used outside of a DayPicker provider.
70764 * @group Hooks
70765 * @see https://daypicker.dev/guides/custom-components
70766 */
70767function useDayPicker() {
70768 const context = (0,external_React_.useContext)(dayPickerContext);
70769 if (context === undefined) {
70770 throw new Error("useDayPicker() must be used within a custom component.");
70771 }
70772 return context;
70773}
70774
70775;// ./node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
70776
70777
70778/**
70779 * Render a dropdown to navigate between months in the calendar.
70780 *
70781 * @group Components
70782 * @see https://daypicker.dev/guides/custom-components
70783 */
70784function MonthsDropdown(props) {
70785 const { components } = useDayPicker();
70786 return external_React_.createElement(components.Dropdown, { ...props });
70787}
70788
70789;// ./node_modules/react-day-picker/dist/esm/components/Nav.js
70790
70791
70792
70793/**
70794 * Render the navigation toolbar with buttons to navigate between months.
70795 *
70796 * @group Components
70797 * @see https://daypicker.dev/guides/custom-components
70798 */
70799function Nav(props) {
70800 const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
70801 const { components, classNames, labels: { labelPrevious, labelNext }, } = useDayPicker();
70802 const handleNextClick = (0,external_React_.useCallback)((e) => {
70803 if (nextMonth) {
70804 onNextClick?.(e);
70805 }
70806 }, [nextMonth, onNextClick]);
70807 const handlePreviousClick = (0,external_React_.useCallback)((e) => {
70808 if (previousMonth) {
70809 onPreviousClick?.(e);
70810 }
70811 }, [previousMonth, onPreviousClick]);
70812 return (external_React_.createElement("nav", { ...navProps },
70813 external_React_.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI_UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick },
70814 external_React_.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: "left" })),
70815 external_React_.createElement(components.NextMonthButton, { type: "button", className: classNames[UI_UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick },
70816 external_React_.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, orientation: "right", className: classNames[UI_UI.Chevron] }))));
70817}
70818
70819;// ./node_modules/react-day-picker/dist/esm/components/NextMonthButton.js
70820
70821
70822/**
70823 * Render the button to navigate to the next month in the calendar.
70824 *
70825 * @group Components
70826 * @see https://daypicker.dev/guides/custom-components
70827 */
70828function NextMonthButton(props) {
70829 const { components } = useDayPicker();
70830 return external_React_.createElement(components.Button, { ...props });
70831}
70832
70833;// ./node_modules/react-day-picker/dist/esm/components/Option.js
70834
70835/**
70836 * Render an `option` element.
70837 *
70838 * @group Components
70839 * @see https://daypicker.dev/guides/custom-components
70840 */
70841function Option_Option(props) {
70842 return external_React_.createElement("option", { ...props });
70843}
70844
70845;// ./node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js
70846
70847
70848/**
70849 * Render the button to navigate to the previous month in the calendar.
70850 *
70851 * @group Components
70852 * @see https://daypicker.dev/guides/custom-components
70853 */
70854function PreviousMonthButton(props) {
70855 const { components } = useDayPicker();
70856 return external_React_.createElement(components.Button, { ...props });
70857}
70858
70859;// ./node_modules/react-day-picker/dist/esm/components/Root.js
70860
70861/**
70862 * Render the root element of the calendar.
70863 *
70864 * @group Components
70865 * @see https://daypicker.dev/guides/custom-components
70866 */
70867function Root_Root(props) {
70868 const { rootRef, ...rest } = props;
70869 return external_React_.createElement("div", { ...rest, ref: rootRef });
70870}
70871
70872;// ./node_modules/react-day-picker/dist/esm/components/Select.js
70873
70874/**
70875 * Render a `select` element.
70876 *
70877 * @group Components
70878 * @see https://daypicker.dev/guides/custom-components
70879 */
70880function Select_Select(props) {
70881 return external_React_.createElement("select", { ...props });
70882}
70883
70884;// ./node_modules/react-day-picker/dist/esm/components/Week.js
70885
70886/**
70887 * Render a table row representing a week in the calendar.
70888 *
70889 * @group Components
70890 * @see https://daypicker.dev/guides/custom-components
70891 */
70892function Week(props) {
70893 const { week, ...trProps } = props;
70894 return external_React_.createElement("tr", { ...trProps });
70895}
70896
70897;// ./node_modules/react-day-picker/dist/esm/components/Weekday.js
70898
70899/**
70900 * Render a table header cell with the name of a weekday (e.g., "Mo", "Tu").
70901 *
70902 * @group Components
70903 * @see https://daypicker.dev/guides/custom-components
70904 */
70905function Weekday(props) {
70906 return external_React_.createElement("th", { ...props });
70907}
70908
70909;// ./node_modules/react-day-picker/dist/esm/components/Weekdays.js
70910
70911/**
70912 * Render the table row containing the weekday names.
70913 *
70914 * @group Components
70915 * @see https://daypicker.dev/guides/custom-components
70916 */
70917function Weekdays(props) {
70918 return (external_React_.createElement("thead", { "aria-hidden": true },
70919 external_React_.createElement("tr", { ...props })));
70920}
70921
70922;// ./node_modules/react-day-picker/dist/esm/components/WeekNumber.js
70923
70924/**
70925 * Render a table cell displaying the number of the week.
70926 *
70927 * @group Components
70928 * @see https://daypicker.dev/guides/custom-components
70929 */
70930function WeekNumber(props) {
70931 const { week, ...thProps } = props;
70932 return external_React_.createElement("th", { ...thProps });
70933}
70934
70935;// ./node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js
70936
70937/**
70938 * Render the header cell for the week numbers column.
70939 *
70940 * @group Components
70941 * @see https://daypicker.dev/guides/custom-components
70942 */
70943function WeekNumberHeader(props) {
70944 return external_React_.createElement("th", { ...props });
70945}
70946
70947;// ./node_modules/react-day-picker/dist/esm/components/Weeks.js
70948
70949/**
70950 * Render the container for the weeks in the month grid.
70951 *
70952 * @group Components
70953 * @see https://daypicker.dev/guides/custom-components
70954 */
70955function Weeks(props) {
70956 return external_React_.createElement("tbody", { ...props });
70957}
70958
70959;// ./node_modules/react-day-picker/dist/esm/components/YearsDropdown.js
70960
70961
70962/**
70963 * Render a dropdown to navigate between years in the calendar.
70964 *
70965 * @group Components
70966 * @see https://daypicker.dev/guides/custom-components
70967 */
70968function YearsDropdown(props) {
70969 const { components } = useDayPicker();
70970 return external_React_.createElement(components.Dropdown, { ...props });
70971}
70972
70973;// ./node_modules/react-day-picker/dist/esm/components/custom-components.js
70974
70975
70976
70977
70978
70979
70980
70981
70982
70983
70984
70985
70986
70987
70988
70989
70990
70991
70992
70993
70994
70995
70996
70997
70998
70999
71000
71001;// ./node_modules/react-day-picker/dist/esm/helpers/getComponents.js
71002
71003/**
71004 * Merges custom components from the props with the default components.
71005 *
71006 * This function ensures that any custom components provided in the props
71007 * override the default components.
71008 *
71009 * @param customComponents The custom components provided in the DayPicker
71010 * props.
71011 * @returns An object containing the merged components.
71012 */
71013function getComponents(customComponents) {
71014 return {
71015 ...custom_components_namespaceObject,
71016 ...customComponents,
71017 };
71018}
71019
71020;// ./node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js
71021/**
71022 * Extracts `data-` attributes from the DayPicker props.
71023 *
71024 * This function collects all `data-` attributes from the props and adds
71025 * additional attributes based on the DayPicker configuration.
71026 *
71027 * @param props The DayPicker props.
71028 * @returns An object containing the `data-` attributes.
71029 */
71030function getDataAttributes(props) {
71031 const dataAttributes = {
71032 "data-mode": props.mode ?? undefined,
71033 "data-required": "required" in props ? props.required : undefined,
71034 "data-multiple-months": (props.numberOfMonths && props.numberOfMonths > 1) || undefined,
71035 "data-week-numbers": props.showWeekNumber || undefined,
71036 "data-broadcast-calendar": props.broadcastCalendar || undefined,
71037 "data-nav-layout": props.navLayout || undefined,
71038 };
71039 Object.entries(props).forEach(([key, val]) => {
71040 if (key.startsWith("data-")) {
71041 dataAttributes[key] = val;
71042 }
71043 });
71044 return dataAttributes;
71045}
71046
71047;// ./node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js
71048
71049/**
71050 * Returns the default class names for the UI elements.
71051 *
71052 * This function generates a mapping of default class names for various UI
71053 * elements, day flags, selection states, and animations.
71054 *
71055 * @returns An object containing the default class names.
71056 * @group Utilities
71057 */
71058function getDefaultClassNames() {
71059 const classNames = {};
71060 for (const key in UI_UI) {
71061 classNames[UI_UI[key]] =
71062 `rdp-${UI_UI[key]}`;
71063 }
71064 for (const key in DayFlag) {
71065 classNames[DayFlag[key]] =
71066 `rdp-${DayFlag[key]}`;
71067 }
71068 for (const key in SelectionState) {
71069 classNames[SelectionState[key]] =
71070 `rdp-${SelectionState[key]}`;
71071 }
71072 for (const key in Animation) {
71073 classNames[Animation[key]] =
71074 `rdp-${Animation[key]}`;
71075 }
71076 return classNames;
71077}
71078
71079;// ./node_modules/react-day-picker/dist/esm/formatters/formatCaption.js
71080
71081/**
71082 * Formats the caption of the month.
71083 *
71084 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
71085 * @param month The date representing the month.
71086 * @param options Configuration options for the date library.
71087 * @param dateLib The date library to use for formatting. If not provided, a new
71088 * instance is created.
71089 * @returns The formatted caption as a string.
71090 * @group Formatters
71091 * @see https://daypicker.dev/docs/translation#custom-formatters
71092 */
71093function formatCaption(month, options, dateLib) {
71094 const lib = dateLib ?? new DateLib(options);
71095 return lib.formatMonthYear(month);
71096}
71097/**
71098 * @private
71099 * @deprecated Use {@link formatCaption} instead.
71100 * @group Formatters
71101 */
71102const formatMonthCaption = formatCaption;
71103
71104;// ./node_modules/react-day-picker/dist/esm/formatters/formatDay.js
71105
71106/**
71107 * Formats the day date shown in the day cell.
71108 *
71109 * @defaultValue `d` (e.g., "1").
71110 * @param date The date to format.
71111 * @param options Configuration options for the date library.
71112 * @param dateLib The date library to use for formatting. If not provided, a new
71113 * instance is created.
71114 * @returns The formatted day as a string.
71115 * @group Formatters
71116 * @see https://daypicker.dev/docs/translation#custom-formatters
71117 */
71118function formatDay(date, options, dateLib) {
71119 return (dateLib ?? new DateLib(options)).format(date, "d");
71120}
71121
71122;// ./node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js
71123
71124/**
71125 * Formats the month for the dropdown option label.
71126 *
71127 * @defaultValue The localized full month name.
71128 * @param month The date representing the month.
71129 * @param dateLib The date library to use for formatting. Defaults to
71130 * `defaultDateLib`.
71131 * @returns The formatted month name as a string.
71132 * @group Formatters
71133 * @see https://daypicker.dev/docs/translation#custom-formatters
71134 */
71135function formatMonthDropdown(month, dateLib = DateLib_defaultDateLib) {
71136 return dateLib.format(month, "LLLL");
71137}
71138
71139;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js
71140
71141/**
71142 * Formats the name of a weekday to be displayed in the weekdays header.
71143 *
71144 * @defaultValue `cccccc` (e.g., "Mo" for Monday).
71145 * @param weekday The date representing the weekday.
71146 * @param options Configuration options for the date library.
71147 * @param dateLib The date library to use for formatting. If not provided, a new
71148 * instance is created.
71149 * @returns The formatted weekday name as a string.
71150 * @group Formatters
71151 * @see https://daypicker.dev/docs/translation#custom-formatters
71152 */
71153function formatWeekdayName(weekday, options, dateLib) {
71154 return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
71155}
71156
71157;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js
71158
71159/**
71160 * Formats the week number.
71161 *
71162 * @defaultValue The week number as a string, with a leading zero for single-digit numbers.
71163 * @param weekNumber The week number to format.
71164 * @param dateLib The date library to use for formatting. Defaults to
71165 * `defaultDateLib`.
71166 * @returns The formatted week number as a string.
71167 * @group Formatters
71168 * @see https://daypicker.dev/docs/translation#custom-formatters
71169 */
71170function formatWeekNumber(weekNumber, dateLib = DateLib_defaultDateLib) {
71171 if (weekNumber < 10) {
71172 return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
71173 }
71174 return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
71175}
71176
71177;// ./node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js
71178/**
71179 * Formats the header for the week number column.
71180 *
71181 * @defaultValue An empty string `""`.
71182 * @returns The formatted week number header as a string.
71183 * @group Formatters
71184 * @see https://daypicker.dev/docs/translation#custom-formatters
71185 */
71186function formatWeekNumberHeader() {
71187 return ``;
71188}
71189
71190;// ./node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js
71191
71192/**
71193 * Formats the year for the dropdown option label.
71194 *
71195 * @param year The year to format.
71196 * @param dateLib The date library to use for formatting. Defaults to
71197 * `defaultDateLib`.
71198 * @returns The formatted year as a string.
71199 * @group Formatters
71200 * @see https://daypicker.dev/docs/translation#custom-formatters
71201 */
71202function formatYearDropdown(year, dateLib = DateLib_defaultDateLib) {
71203 return dateLib.format(year, "yyyy");
71204}
71205/**
71206 * @private
71207 * @deprecated Use `formatYearDropdown` instead.
71208 * @group Formatters
71209 */
71210const formatYearCaption = formatYearDropdown;
71211
71212;// ./node_modules/react-day-picker/dist/esm/formatters/index.js
71213
71214
71215
71216
71217
71218
71219
71220
71221;// ./node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
71222
71223/**
71224 * Merges custom formatters from the props with the default formatters.
71225 *
71226 * @param customFormatters The custom formatters provided in the DayPicker
71227 * props.
71228 * @returns The merged formatters object.
71229 */
71230function getFormatters(customFormatters) {
71231 if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
71232 customFormatters.formatCaption = customFormatters.formatMonthCaption;
71233 }
71234 if (customFormatters?.formatYearCaption &&
71235 !customFormatters.formatYearDropdown) {
71236 customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
71237 }
71238 return {
71239 ...esm_formatters_namespaceObject,
71240 ...customFormatters,
71241 };
71242}
71243
71244;// ./node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
71245/**
71246 * Returns the months to show in the dropdown.
71247 *
71248 * This function generates a list of months for the current year, formatted
71249 * using the provided formatter, and determines whether each month should be
71250 * disabled based on the navigation range.
71251 *
71252 * @param displayMonth The currently displayed month.
71253 * @param navStart The start date for navigation.
71254 * @param navEnd The end date for navigation.
71255 * @param formatters The formatters to use for formatting the month labels.
71256 * @param dateLib The date library to use for date manipulation.
71257 * @returns An array of dropdown options representing the months, or `undefined`
71258 * if no months are available.
71259 */
71260function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
71261 const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
71262 const months = eachMonthOfInterval({
71263 start: startOfYear(displayMonth),
71264 end: endOfYear(displayMonth),
71265 });
71266 const options = months.map((month) => {
71267 const label = formatters.formatMonthDropdown(month, dateLib);
71268 const value = getMonth(month);
71269 const disabled = (navStart && month < startOfMonth(navStart)) ||
71270 (navEnd && month > startOfMonth(navEnd)) ||
71271 false;
71272 return { value, label, disabled };
71273 });
71274 return options;
71275}
71276
71277;// ./node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
71278
71279/**
71280 * Returns the computed style for a day based on its modifiers.
71281 *
71282 * This function merges the base styles for the day with any styles associated
71283 * with active modifiers.
71284 *
71285 * @param dayModifiers The modifiers applied to the day.
71286 * @param styles The base styles for the calendar elements.
71287 * @param modifiersStyles The styles associated with specific modifiers.
71288 * @returns The computed style for the day.
71289 */
71290function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
71291 let style = { ...styles?.[UI_UI.Day] };
71292 Object.entries(dayModifiers)
71293 .filter(([, active]) => active === true)
71294 .forEach(([modifier]) => {
71295 style = {
71296 ...style,
71297 ...modifiersStyles?.[modifier],
71298 };
71299 });
71300 return style;
71301}
71302
71303;// ./node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
71304/**
71305 * Generates a series of 7 days, starting from the beginning of the week, to use
71306 * for formatting weekday names (e.g., Monday, Tuesday, etc.).
71307 *
71308 * @param dateLib The date library to use for date manipulation.
71309 * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
71310 * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
71311 * on Monday, but may include adjustments for broadcast-specific rules).
71312 * @returns An array of 7 dates representing the weekdays.
71313 */
71314function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
71315 const today = dateLib.today();
71316 const start = broadcastCalendar
71317 ? dateLib.startOfBroadcastWeek(today, dateLib)
71318 : ISOWeek
71319 ? dateLib.startOfISOWeek(today)
71320 : dateLib.startOfWeek(today);
71321 const days = [];
71322 for (let i = 0; i < 7; i++) {
71323 const day = dateLib.addDays(start, i);
71324 days.push(day);
71325 }
71326 return days;
71327}
71328
71329;// ./node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
71330/**
71331 * Returns the years to display in the dropdown.
71332 *
71333 * This function generates a list of years between the navigation start and end
71334 * dates, formatted using the provided formatter.
71335 *
71336 * @param navStart The start date for navigation.
71337 * @param navEnd The end date for navigation.
71338 * @param formatters The formatters to use for formatting the year labels.
71339 * @param dateLib The date library to use for date manipulation.
71340 * @param reverse If true, reverses the order of the years (descending).
71341 * @returns An array of dropdown options representing the years, or `undefined`
71342 * if `navStart` or `navEnd` is not provided.
71343 */
71344function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
71345 if (!navStart)
71346 return undefined;
71347 if (!navEnd)
71348 return undefined;
71349 const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
71350 const firstNavYear = startOfYear(navStart);
71351 const lastNavYear = endOfYear(navEnd);
71352 const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
71353 if (reverse)
71354 years.reverse();
71355 return years.map((year) => {
71356 const label = formatters.formatYearDropdown(year, dateLib);
71357 return {
71358 value: getYear(year),
71359 label,
71360 disabled: false,
71361 };
71362 });
71363}
71364
71365;// ./node_modules/react-day-picker/dist/esm/labels/labelDayButton.js
71366
71367/**
71368 * Generates the ARIA label for a day button.
71369 *
71370 * Use the `modifiers` argument to provide additional context for the label,
71371 * such as indicating if the day is "today" or "selected."
71372 *
71373 * @defaultValue The formatted date.
71374 * @param date - The date to format.
71375 * @param modifiers - The modifiers providing context for the day.
71376 * @param options - Optional configuration for the date formatting library.
71377 * @param dateLib - An optional instance of the date formatting library.
71378 * @returns The ARIA label for the day button.
71379 * @group Labels
71380 * @see https://daypicker.dev/docs/translation#aria-labels
71381 */
71382function labelDayButton(date, modifiers, options, dateLib) {
71383 let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
71384 if (modifiers.today)
71385 label = `Today, ${label}`;
71386 if (modifiers.selected)
71387 label = `${label}, selected`;
71388 return label;
71389}
71390/**
71391 * @ignore
71392 * @deprecated Use `labelDayButton` instead.
71393 */
71394const labelDay = labelDayButton;
71395
71396;// ./node_modules/react-day-picker/dist/esm/labels/labelGrid.js
71397
71398/**
71399 * Generates the ARIA label for the month grid, which is announced when entering
71400 * the grid.
71401 *
71402 * @defaultValue Locale-specific month/year order (e.g., "November 2022").
71403 * @param date - The date representing the month.
71404 * @param options - Optional configuration for the date formatting library.
71405 * @param dateLib - An optional instance of the date formatting library.
71406 * @returns The ARIA label for the month grid.
71407 * @group Labels
71408 * @see https://daypicker.dev/docs/translation#aria-labels
71409 */
71410function labelGrid(date, options, dateLib) {
71411 const lib = dateLib ?? new DateLib(options);
71412 return lib.formatMonthYear(date);
71413}
71414/**
71415 * @ignore
71416 * @deprecated Use {@link labelGrid} instead.
71417 */
71418const labelCaption = labelGrid;
71419
71420;// ./node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
71421
71422/**
71423 * Generates the label for a day grid cell when the calendar is not interactive.
71424 *
71425 * @param date - The date to format.
71426 * @param modifiers - Optional modifiers providing context for the day.
71427 * @param options - Optional configuration for the date formatting library.
71428 * @param dateLib - An optional instance of the date formatting library.
71429 * @returns The label for the day grid cell.
71430 * @group Labels
71431 * @see https://daypicker.dev/docs/translation#aria-labels
71432 */
71433function labelGridcell(date, modifiers, options, dateLib) {
71434 let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
71435 if (modifiers?.today) {
71436 label = `Today, ${label}`;
71437 }
71438 return label;
71439}
71440
71441;// ./node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js
71442/**
71443 * Generates the ARIA label for the months dropdown.
71444 *
71445 * @defaultValue `"Choose the Month"`
71446 * @param options - Optional configuration for the date formatting library.
71447 * @returns The ARIA label for the months dropdown.
71448 * @group Labels
71449 * @see https://daypicker.dev/docs/translation#aria-labels
71450 */
71451function labelMonthDropdown(_options) {
71452 return "Choose the Month";
71453}
71454
71455;// ./node_modules/react-day-picker/dist/esm/labels/labelNav.js
71456/**
71457 * Generates the ARIA label for the navigation toolbar.
71458 *
71459 * @defaultValue `""`
71460 * @returns The ARIA label for the navigation toolbar.
71461 * @group Labels
71462 * @see https://daypicker.dev/docs/translation#aria-labels
71463 */
71464function labelNav() {
71465 return "";
71466}
71467
71468;// ./node_modules/react-day-picker/dist/esm/labels/labelNext.js
71469/**
71470 * Generates the ARIA label for the "next month" button.
71471 *
71472 * @defaultValue `"Go to the Next Month"`
71473 * @param month - The date representing the next month, or `undefined` if there
71474 * is no next month.
71475 * @returns The ARIA label for the "next month" button.
71476 * @group Labels
71477 * @see https://daypicker.dev/docs/translation#aria-labels
71478 */
71479function labelNext(_month) {
71480 return "Go to the Next Month";
71481}
71482
71483;// ./node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
71484/**
71485 * Generates the ARIA label for the "previous month" button.
71486 *
71487 * @defaultValue `"Go to the Previous Month"`
71488 * @param month - The date representing the previous month, or `undefined` if
71489 * there is no previous month.
71490 * @returns The ARIA label for the "previous month" button.
71491 * @group Labels
71492 * @see https://daypicker.dev/docs/translation#aria-labels
71493 */
71494function labelPrevious(_month) {
71495 return "Go to the Previous Month";
71496}
71497
71498;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekday.js
71499
71500/**
71501 * Generates the ARIA label for a weekday column header.
71502 *
71503 * @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
71504 * @param date - The date representing the weekday.
71505 * @param options - Optional configuration for the date formatting library.
71506 * @param dateLib - An optional instance of the date formatting library.
71507 * @returns The ARIA label for the weekday column header.
71508 * @group Labels
71509 * @see https://daypicker.dev/docs/translation#aria-labels
71510 */
71511function labelWeekday(date, options, dateLib) {
71512 return (dateLib ?? new DateLib(options)).format(date, "cccc");
71513}
71514
71515;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js
71516/**
71517 * Generates the ARIA label for the week number cell (the first cell in a row).
71518 *
71519 * @defaultValue `Week ${weekNumber}`
71520 * @param weekNumber - The number of the week.
71521 * @param options - Optional configuration for the date formatting library.
71522 * @returns The ARIA label for the week number cell.
71523 * @group Labels
71524 * @see https://daypicker.dev/docs/translation#aria-labels
71525 */
71526function labelWeekNumber(weekNumber, _options) {
71527 return `Week ${weekNumber}`;
71528}
71529
71530;// ./node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js
71531/**
71532 * Generates the ARIA label for the week number header element.
71533 *
71534 * @defaultValue `"Week Number"`
71535 * @param options - Optional configuration for the date formatting library.
71536 * @returns The ARIA label for the week number header.
71537 * @group Labels
71538 * @see https://daypicker.dev/docs/translation#aria-labels
71539 */
71540function labelWeekNumberHeader(_options) {
71541 return "Week Number";
71542}
71543
71544;// ./node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js
71545/**
71546 * Generates the ARIA label for the years dropdown.
71547 *
71548 * @defaultValue `"Choose the Year"`
71549 * @param options - Optional configuration for the date formatting library.
71550 * @returns The ARIA label for the years dropdown.
71551 * @group Labels
71552 * @see https://daypicker.dev/docs/translation#aria-labels
71553 */
71554function labelYearDropdown(_options) {
71555 return "Choose the Year";
71556}
71557
71558;// ./node_modules/react-day-picker/dist/esm/labels/index.js
71559
71560
71561
71562
71563
71564
71565
71566
71567
71568
71569
71570
71571
71572;// ./node_modules/react-day-picker/dist/esm/useAnimation.js
71573
71574
71575const asHtmlElement = (element) => {
71576 if (element instanceof HTMLElement)
71577 return element;
71578 return null;
71579};
71580const queryMonthEls = (element) => [
71581 ...(element.querySelectorAll("[data-animated-month]") ?? []),
71582];
71583const queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
71584const queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
71585const queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-animated-weeks]"));
71586const queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
71587const queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
71588/**
71589 * Handles animations for transitioning between months in the DayPicker
71590 * component.
71591 *
71592 * @private
71593 * @param rootElRef - A reference to the root element of the DayPicker
71594 * component.
71595 * @param enabled - Whether animations are enabled.
71596 * @param options - Configuration options for the animation, including class
71597 * names, months, focused day, and the date utility library.
71598 */
71599function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib, }) {
71600 const previousRootElSnapshotRef = (0,external_React_.useRef)(null);
71601 const previousMonthsRef = (0,external_React_.useRef)(months);
71602 const animatingRef = (0,external_React_.useRef)(false);
71603 (0,external_React_.useLayoutEffect)(() => {
71604 // get previous months before updating the previous months ref
71605 const previousMonths = previousMonthsRef.current;
71606 // update previous months ref for next effect trigger
71607 previousMonthsRef.current = months;
71608 if (!enabled ||
71609 !rootElRef.current ||
71610 // safety check because the ref can be set to anything by consumers
71611 !(rootElRef.current instanceof HTMLElement) ||
71612 // validation required for the animation to work as expected
71613 months.length === 0 ||
71614 previousMonths.length === 0 ||
71615 months.length !== previousMonths.length) {
71616 return;
71617 }
71618 const isSameMonth = dateLib.isSameMonth(months[0].date, previousMonths[0].date);
71619 const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);
71620 const captionAnimationClass = isAfterPreviousMonth
71621 ? classNames[Animation.caption_after_enter]
71622 : classNames[Animation.caption_before_enter];
71623 const weeksAnimationClass = isAfterPreviousMonth
71624 ? classNames[Animation.weeks_after_enter]
71625 : classNames[Animation.weeks_before_enter];
71626 // get previous root element snapshot before updating the snapshot ref
71627 const previousRootElSnapshot = previousRootElSnapshotRef.current;
71628 // update snapshot for next effect trigger
71629 const rootElSnapshot = rootElRef.current.cloneNode(true);
71630 if (rootElSnapshot instanceof HTMLElement) {
71631 // if this effect is triggered while animating, we need to clean up the new root snapshot
71632 // to put it in the same state as when not animating, to correctly animate the next month change
71633 const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);
71634 currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {
71635 if (!(currentMonthElSnapshot instanceof HTMLElement))
71636 return;
71637 // remove the old month snapshots from the new root snapshot
71638 const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);
71639 if (previousMonthElSnapshot &&
71640 currentMonthElSnapshot.contains(previousMonthElSnapshot)) {
71641 currentMonthElSnapshot.removeChild(previousMonthElSnapshot);
71642 }
71643 // remove animation classes from the new month snapshots
71644 const captionEl = queryCaptionEl(currentMonthElSnapshot);
71645 if (captionEl) {
71646 captionEl.classList.remove(captionAnimationClass);
71647 }
71648 const weeksEl = queryWeeksEl(currentMonthElSnapshot);
71649 if (weeksEl) {
71650 weeksEl.classList.remove(weeksAnimationClass);
71651 }
71652 });
71653 previousRootElSnapshotRef.current = rootElSnapshot;
71654 }
71655 else {
71656 previousRootElSnapshotRef.current = null;
71657 }
71658 if (animatingRef.current ||
71659 isSameMonth ||
71660 // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
71661 focused) {
71662 return;
71663 }
71664 const previousMonthEls = previousRootElSnapshot instanceof HTMLElement
71665 ? queryMonthEls(previousRootElSnapshot)
71666 : [];
71667 const currentMonthEls = queryMonthEls(rootElRef.current);
71668 if (currentMonthEls?.every((el) => el instanceof HTMLElement) &&
71669 previousMonthEls &&
71670 previousMonthEls.every((el) => el instanceof HTMLElement)) {
71671 animatingRef.current = true;
71672 const cleanUpFunctions = [];
71673 // set isolation to isolate to isolate the stacking context during animation
71674 rootElRef.current.style.isolation = "isolate";
71675 // set z-index to 1 to ensure the nav is clickable over the other elements being animated
71676 const navEl = queryNavEl(rootElRef.current);
71677 if (navEl) {
71678 navEl.style.zIndex = "1";
71679 }
71680 currentMonthEls.forEach((currentMonthEl, index) => {
71681 const previousMonthEl = previousMonthEls[index];
71682 if (!previousMonthEl) {
71683 return;
71684 }
71685 // animate new displayed month
71686 currentMonthEl.style.position = "relative";
71687 currentMonthEl.style.overflow = "hidden";
71688 const captionEl = queryCaptionEl(currentMonthEl);
71689 if (captionEl) {
71690 captionEl.classList.add(captionAnimationClass);
71691 }
71692 const weeksEl = queryWeeksEl(currentMonthEl);
71693 if (weeksEl) {
71694 weeksEl.classList.add(weeksAnimationClass);
71695 }
71696 // animate new displayed month end
71697 const cleanUp = () => {
71698 animatingRef.current = false;
71699 if (rootElRef.current) {
71700 rootElRef.current.style.isolation = "";
71701 }
71702 if (navEl) {
71703 navEl.style.zIndex = "";
71704 }
71705 if (captionEl) {
71706 captionEl.classList.remove(captionAnimationClass);
71707 }
71708 if (weeksEl) {
71709 weeksEl.classList.remove(weeksAnimationClass);
71710 }
71711 currentMonthEl.style.position = "";
71712 currentMonthEl.style.overflow = "";
71713 if (currentMonthEl.contains(previousMonthEl)) {
71714 currentMonthEl.removeChild(previousMonthEl);
71715 }
71716 };
71717 cleanUpFunctions.push(cleanUp);
71718 // animate old displayed month
71719 previousMonthEl.style.pointerEvents = "none";
71720 previousMonthEl.style.position = "absolute";
71721 previousMonthEl.style.overflow = "hidden";
71722 previousMonthEl.setAttribute("aria-hidden", "true");
71723 // hide the weekdays container of the old month and only the new one
71724 const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);
71725 if (previousWeekdaysEl) {
71726 previousWeekdaysEl.style.opacity = "0";
71727 }
71728 const previousCaptionEl = queryCaptionEl(previousMonthEl);
71729 if (previousCaptionEl) {
71730 previousCaptionEl.classList.add(isAfterPreviousMonth
71731 ? classNames[Animation.caption_before_exit]
71732 : classNames[Animation.caption_after_exit]);
71733 previousCaptionEl.addEventListener("animationend", cleanUp);
71734 }
71735 const previousWeeksEl = queryWeeksEl(previousMonthEl);
71736 if (previousWeeksEl) {
71737 previousWeeksEl.classList.add(isAfterPreviousMonth
71738 ? classNames[Animation.weeks_before_exit]
71739 : classNames[Animation.weeks_after_exit]);
71740 }
71741 currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);
71742 });
71743 }
71744 });
71745}
71746
71747;// ./node_modules/react-day-picker/dist/esm/helpers/getDates.js
71748/**
71749 * Returns all the dates to display in the calendar.
71750 *
71751 * This function calculates the range of dates to display based on the provided
71752 * display months, constraints, and calendar configuration.
71753 *
71754 * @param displayMonths The months to display in the calendar.
71755 * @param maxDate The maximum date to include in the range.
71756 * @param props The DayPicker props, including calendar configuration options.
71757 * @param dateLib The date library to use for date manipulation.
71758 * @returns An array of dates to display in the calendar.
71759 */
71760function getDates(displayMonths, maxDate, props, dateLib) {
71761 const firstMonth = displayMonths[0];
71762 const lastMonth = displayMonths[displayMonths.length - 1];
71763 const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
71764 const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
71765 const startWeekFirstDate = broadcastCalendar
71766 ? startOfBroadcastWeek(firstMonth, dateLib)
71767 : ISOWeek
71768 ? startOfISOWeek(firstMonth)
71769 : startOfWeek(firstMonth);
71770 const endWeekLastDate = broadcastCalendar
71771 ? endOfBroadcastWeek(lastMonth)
71772 : ISOWeek
71773 ? endOfISOWeek(endOfMonth(lastMonth))
71774 : endOfWeek(endOfMonth(lastMonth));
71775 const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
71776 const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
71777 const dates = [];
71778 for (let i = 0; i <= nOfDays; i++) {
71779 const date = addDays(startWeekFirstDate, i);
71780 if (maxDate && isAfter(date, maxDate)) {
71781 break;
71782 }
71783 dates.push(date);
71784 }
71785 // If fixed weeks is enabled, add the extra dates to the array
71786 const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
71787 const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
71788 if (fixedWeeks && dates.length < extraDates) {
71789 const daysToAdd = extraDates - dates.length;
71790 for (let i = 0; i < daysToAdd; i++) {
71791 const date = addDays(dates[dates.length - 1], 1);
71792 dates.push(date);
71793 }
71794 }
71795 return dates;
71796}
71797
71798;// ./node_modules/react-day-picker/dist/esm/helpers/getDays.js
71799/**
71800 * Returns all the days belonging to the calendar by merging the days in the
71801 * weeks for each month.
71802 *
71803 * @param calendarMonths The array of calendar months.
71804 * @returns An array of `CalendarDay` objects representing all the days in the
71805 * calendar.
71806 */
71807function getDays(calendarMonths) {
71808 const initialDays = [];
71809 return calendarMonths.reduce((days, month) => {
71810 const weekDays = month.weeks.reduce((weekDays, week) => {
71811 return weekDays.concat(week.days.slice());
71812 }, initialDays.slice());
71813 return days.concat(weekDays.slice());
71814 }, initialDays.slice());
71815}
71816
71817;// ./node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js
71818/**
71819 * Returns the months to display in the calendar.
71820 *
71821 * @param firstDisplayedMonth The first month currently displayed in the
71822 * calendar.
71823 * @param calendarEndMonth The latest month the user can navigate to.
71824 * @param props The DayPicker props, including `numberOfMonths`.
71825 * @param dateLib The date library to use for date manipulation.
71826 * @returns An array of dates representing the months to display.
71827 */
71828function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {
71829 const { numberOfMonths = 1 } = props;
71830 const months = [];
71831 for (let i = 0; i < numberOfMonths; i++) {
71832 const month = dateLib.addMonths(firstDisplayedMonth, i);
71833 if (calendarEndMonth && month > calendarEndMonth) {
71834 break;
71835 }
71836 months.push(month);
71837 }
71838 return months;
71839}
71840
71841;// ./node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js
71842/**
71843 * Determines the initial month to display in the calendar based on the provided
71844 * props.
71845 *
71846 * This function calculates the starting month, considering constraints such as
71847 * `startMonth`, `endMonth`, and the number of months to display.
71848 *
71849 * @param props The DayPicker props, including navigation and date constraints.
71850 * @param dateLib The date library to use for date manipulation.
71851 * @returns The initial month to display.
71852 */
71853function getInitialMonth(props, navStart, navEnd, dateLib) {
71854 const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, } = props;
71855 let initialMonth = month || defaultMonth || today;
71856 const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;
71857 if (navEnd &&
71858 differenceInCalendarMonths(navEnd, initialMonth) < numberOfMonths - 1) {
71859 const offset = -1 * (numberOfMonths - 1);
71860 initialMonth = addMonths(navEnd, offset);
71861 }
71862 if (navStart && differenceInCalendarMonths(initialMonth, navStart) < 0) {
71863 initialMonth = navStart;
71864 }
71865 return startOfMonth(initialMonth);
71866}
71867
71868;// ./node_modules/react-day-picker/dist/esm/classes/CalendarDay.js
71869
71870/**
71871 * Represents a day displayed in the calendar.
71872 *
71873 * In DayPicker, a `CalendarDay` is a wrapper around a `Date` object that
71874 * provides additional information about the day, such as whether it belongs to
71875 * the displayed month.
71876 */
71877class CalendarDay {
71878 constructor(date, displayMonth, dateLib = DateLib_defaultDateLib) {
71879 this.date = date;
71880 this.displayMonth = displayMonth;
71881 this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
71882 this.dateLib = dateLib;
71883 }
71884 /**
71885 * Checks if this day is equal to another `CalendarDay`, considering both the
71886 * date and the displayed month.
71887 *
71888 * @param day The `CalendarDay` to compare with.
71889 * @returns `true` if the days are equal, otherwise `false`.
71890 */
71891 isEqualTo(day) {
71892 return (this.dateLib.isSameDay(day.date, this.date) &&
71893 this.dateLib.isSameMonth(day.displayMonth, this.displayMonth));
71894 }
71895}
71896
71897;// ./node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js
71898/**
71899 * Represents a week in a calendar month.
71900 *
71901 * A `CalendarWeek` contains the days within the week and the week number.
71902 */
71903class CalendarWeek {
71904 constructor(weekNumber, days) {
71905 this.days = days;
71906 this.weekNumber = weekNumber;
71907 }
71908}
71909
71910;// ./node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js
71911/**
71912 * Represents a month in a calendar year.
71913 *
71914 * A `CalendarMonth` contains the weeks within the month and the date of the
71915 * month.
71916 */
71917class CalendarMonth {
71918 constructor(month, weeks) {
71919 this.date = month;
71920 this.weeks = weeks;
71921 }
71922}
71923
71924;// ./node_modules/react-day-picker/dist/esm/helpers/getMonths.js
71925
71926/**
71927 * Returns the months to display in the calendar.
71928 *
71929 * This function generates `CalendarMonth` objects for each month to be
71930 * displayed, including their weeks and days, based on the provided display
71931 * months and dates.
71932 *
71933 * @param displayMonths The months (as dates) to display in the calendar.
71934 * @param dates The dates to display in the calendar.
71935 * @param props Options from the DayPicker props context.
71936 * @param dateLib The date library to use for date manipulation.
71937 * @returns An array of `CalendarMonth` objects representing the months to
71938 * display.
71939 */
71940function getMonths(displayMonths, dates, props, dateLib) {
71941 const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
71942 const dayPickerMonths = displayMonths.reduce((months, month) => {
71943 const firstDateOfFirstWeek = props.broadcastCalendar
71944 ? startOfBroadcastWeek(month, dateLib)
71945 : props.ISOWeek
71946 ? startOfISOWeek(month)
71947 : startOfWeek(month);
71948 const lastDateOfLastWeek = props.broadcastCalendar
71949 ? endOfBroadcastWeek(month)
71950 : props.ISOWeek
71951 ? endOfISOWeek(endOfMonth(month))
71952 : endOfWeek(endOfMonth(month));
71953 /** The dates to display in the month. */
71954 const monthDates = dates.filter((date) => {
71955 return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
71956 });
71957 const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;
71958 if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
71959 const extraDates = dates.filter((date) => {
71960 const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;
71961 return (date > lastDateOfLastWeek &&
71962 date <= addDays(lastDateOfLastWeek, daysToAdd));
71963 });
71964 monthDates.push(...extraDates);
71965 }
71966 const weeks = monthDates.reduce((weeks, date) => {
71967 const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);
71968 const week = weeks.find((week) => week.weekNumber === weekNumber);
71969 const day = new CalendarDay(date, month, dateLib);
71970 if (!week) {
71971 weeks.push(new CalendarWeek(weekNumber, [day]));
71972 }
71973 else {
71974 week.days.push(day);
71975 }
71976 return weeks;
71977 }, []);
71978 const dayPickerMonth = new CalendarMonth(month, weeks);
71979 months.push(dayPickerMonth);
71980 return months;
71981 }, []);
71982 if (!props.reverseMonths) {
71983 return dayPickerMonths;
71984 }
71985 else {
71986 return dayPickerMonths.reverse();
71987 }
71988}
71989
71990;// ./node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js
71991/**
71992 * Returns the start and end months for calendar navigation.
71993 *
71994 * @param props The DayPicker props, including navigation and layout options.
71995 * @param dateLib The date library to use for date manipulation.
71996 * @returns A tuple containing the start and end months for navigation.
71997 */
71998function getNavMonths(props, dateLib) {
71999 let { startMonth, endMonth } = props;
72000 const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;
72001 // Handle deprecated code
72002 const { fromYear, toYear, fromMonth, toMonth } = props;
72003 if (!startMonth && fromMonth) {
72004 startMonth = fromMonth;
72005 }
72006 if (!startMonth && fromYear) {
72007 startMonth = dateLib.newDate(fromYear, 0, 1);
72008 }
72009 if (!endMonth && toMonth) {
72010 endMonth = toMonth;
72011 }
72012 if (!endMonth && toYear) {
72013 endMonth = newDate(toYear, 11, 31);
72014 }
72015 const hasYearDropdown = props.captionLayout === "dropdown" ||
72016 props.captionLayout === "dropdown-years";
72017 if (startMonth) {
72018 startMonth = startOfMonth(startMonth);
72019 }
72020 else if (fromYear) {
72021 startMonth = newDate(fromYear, 0, 1);
72022 }
72023 else if (!startMonth && hasYearDropdown) {
72024 startMonth = startOfYear(addYears(props.today ?? today(), -100));
72025 }
72026 if (endMonth) {
72027 endMonth = endOfMonth(endMonth);
72028 }
72029 else if (toYear) {
72030 endMonth = newDate(toYear, 11, 31);
72031 }
72032 else if (!endMonth && hasYearDropdown) {
72033 endMonth = endOfYear(props.today ?? today());
72034 }
72035 return [
72036 startMonth ? startOfDay(startMonth) : startMonth,
72037 endMonth ? startOfDay(endMonth) : endMonth,
72038 ];
72039}
72040
72041;// ./node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js
72042/**
72043 * Returns the next month the user can navigate to, based on the given options.
72044 *
72045 * The next month is not always the next calendar month:
72046 *
72047 * - If it is after the `calendarEndMonth`, it returns `undefined`.
72048 * - If paged navigation is enabled, it skips forward by the number of displayed
72049 * months.
72050 *
72051 * @param firstDisplayedMonth The first month currently displayed in the
72052 * calendar.
72053 * @param calendarEndMonth The latest month the user can navigate to.
72054 * @param options Navigation options, including `numberOfMonths` and
72055 * `pagedNavigation`.
72056 * @param dateLib The date library to use for date manipulation.
72057 * @returns The next month, or `undefined` if navigation is not possible.
72058 */
72059function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {
72060 if (options.disableNavigation) {
72061 return undefined;
72062 }
72063 const { pagedNavigation, numberOfMonths = 1 } = options;
72064 const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
72065 const offset = pagedNavigation ? numberOfMonths : 1;
72066 const month = startOfMonth(firstDisplayedMonth);
72067 if (!calendarEndMonth) {
72068 return addMonths(month, offset);
72069 }
72070 const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);
72071 if (monthsDiff < numberOfMonths) {
72072 return undefined;
72073 }
72074 return addMonths(month, offset);
72075}
72076
72077;// ./node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js
72078/**
72079 * Returns the previous month the user can navigate to, based on the given
72080 * options.
72081 *
72082 * The previous month is not always the previous calendar month:
72083 *
72084 * - If it is before the `calendarStartMonth`, it returns `undefined`.
72085 * - If paged navigation is enabled, it skips back by the number of displayed
72086 * months.
72087 *
72088 * @param firstDisplayedMonth The first month currently displayed in the
72089 * calendar.
72090 * @param calendarStartMonth The earliest month the user can navigate to.
72091 * @param options Navigation options, including `numberOfMonths` and
72092 * `pagedNavigation`.
72093 * @param dateLib The date library to use for date manipulation.
72094 * @returns The previous month, or `undefined` if navigation is not possible.
72095 */
72096function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {
72097 if (options.disableNavigation) {
72098 return undefined;
72099 }
72100 const { pagedNavigation, numberOfMonths } = options;
72101 const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;
72102 const offset = pagedNavigation ? (numberOfMonths ?? 1) : 1;
72103 const month = startOfMonth(firstDisplayedMonth);
72104 if (!calendarStartMonth) {
72105 return addMonths(month, -offset);
72106 }
72107 const monthsDiff = differenceInCalendarMonths(month, calendarStartMonth);
72108 if (monthsDiff <= 0) {
72109 return undefined;
72110 }
72111 return addMonths(month, -offset);
72112}
72113
72114;// ./node_modules/react-day-picker/dist/esm/helpers/getWeeks.js
72115/**
72116 * Returns an array of calendar weeks from an array of calendar months.
72117 *
72118 * @param months The array of calendar months.
72119 * @returns An array of calendar weeks.
72120 */
72121function getWeeks(months) {
72122 const initialWeeks = [];
72123 return months.reduce((weeks, month) => {
72124 return weeks.concat(month.weeks.slice());
72125 }, initialWeeks.slice());
72126}
72127
72128;// ./node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js
72129
72130/**
72131 * A custom hook for managing both controlled and uncontrolled component states.
72132 *
72133 * This hook allows a component to support both controlled and uncontrolled
72134 * states by determining whether the `controlledValue` is provided. If it is
72135 * undefined, the hook falls back to using the internal state.
72136 *
72137 * @example
72138 * // Uncontrolled usage
72139 * const [value, setValue] = useControlledValue(0, undefined);
72140 *
72141 * // Controlled usage
72142 * const [value, setValue] = useControlledValue(0, props.value);
72143 *
72144 * @template T - The type of the value.
72145 * @param defaultValue The initial value for the uncontrolled state.
72146 * @param controlledValue The value for the controlled state. If undefined, the
72147 * component will use the uncontrolled state.
72148 * @returns A tuple where the first element is the current value (either
72149 * controlled or uncontrolled) and the second element is a setter function to
72150 * update the value.
72151 */
72152function useControlledValue_useControlledValue(defaultValue, controlledValue) {
72153 const [uncontrolledValue, setValue] = (0,external_React_.useState)(defaultValue);
72154 const value = controlledValue === undefined ? uncontrolledValue : controlledValue;
72155 return [value, setValue];
72156}
72157
72158;// ./node_modules/react-day-picker/dist/esm/useCalendar.js
72159
72160
72161
72162
72163
72164
72165
72166
72167
72168
72169
72170/**
72171 * Provides the calendar object to work with the calendar in custom components.
72172 *
72173 * @private
72174 * @param props - The DayPicker props related to calendar configuration.
72175 * @param dateLib - The date utility library instance.
72176 * @returns The calendar object containing displayed days, weeks, months, and
72177 * navigation methods.
72178 */
72179function useCalendar(props, dateLib) {
72180 const [navStart, navEnd] = getNavMonths(props, dateLib);
72181 const { startOfMonth, endOfMonth } = dateLib;
72182 const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
72183 const [firstMonth, setFirstMonth] = useControlledValue_useControlledValue(initialMonth,
72184 // initialMonth is always computed from props.month if provided
72185 props.month ? initialMonth : undefined);
72186 // biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
72187 (0,external_React_.useEffect)(() => {
72188 const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
72189 setFirstMonth(newInitialMonth);
72190 }, [props.timeZone]);
72191 /** The months displayed in the calendar. */
72192 const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);
72193 /** The dates displayed in the calendar. */
72194 const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);
72195 /** The Months displayed in the calendar. */
72196 const months = getMonths(displayMonths, dates, props, dateLib);
72197 /** The Weeks displayed in the calendar. */
72198 const weeks = getWeeks(months);
72199 /** The Days displayed in the calendar. */
72200 const days = getDays(months);
72201 const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
72202 const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
72203 const { disableNavigation, onMonthChange } = props;
72204 const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
72205 const goToMonth = (date) => {
72206 if (disableNavigation) {
72207 return;
72208 }
72209 let newMonth = startOfMonth(date);
72210 // if month is before start, use the first month instead
72211 if (navStart && newMonth < startOfMonth(navStart)) {
72212 newMonth = startOfMonth(navStart);
72213 }
72214 // if month is after endMonth, use the last month instead
72215 if (navEnd && newMonth > startOfMonth(navEnd)) {
72216 newMonth = startOfMonth(navEnd);
72217 }
72218 setFirstMonth(newMonth);
72219 onMonthChange?.(newMonth);
72220 };
72221 const goToDay = (day) => {
72222 // is this check necessary?
72223 if (isDayInCalendar(day)) {
72224 return;
72225 }
72226 goToMonth(day.date);
72227 };
72228 const calendar = {
72229 months,
72230 weeks,
72231 days,
72232 navStart,
72233 navEnd,
72234 previousMonth,
72235 nextMonth,
72236 goToMonth,
72237 goToDay,
72238 };
72239 return calendar;
72240}
72241
72242;// ./node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
72243
72244var FocusTargetPriority;
72245(function (FocusTargetPriority) {
72246 FocusTargetPriority[FocusTargetPriority["Today"] = 0] = "Today";
72247 FocusTargetPriority[FocusTargetPriority["Selected"] = 1] = "Selected";
72248 FocusTargetPriority[FocusTargetPriority["LastFocused"] = 2] = "LastFocused";
72249 FocusTargetPriority[FocusTargetPriority["FocusedModifier"] = 3] = "FocusedModifier";
72250})(FocusTargetPriority || (FocusTargetPriority = {}));
72251/**
72252 * Determines if a day is focusable based on its modifiers.
72253 *
72254 * A day is considered focusable if it is not disabled, hidden, or outside the
72255 * displayed month.
72256 *
72257 * @param modifiers The modifiers applied to the day.
72258 * @returns `true` if the day is focusable, otherwise `false`.
72259 */
72260function isFocusableDay(modifiers) {
72261 return (!modifiers[DayFlag.disabled] &&
72262 !modifiers[DayFlag.hidden] &&
72263 !modifiers[DayFlag.outside]);
72264}
72265/**
72266 * Calculates the focus target day based on priority.
72267 *
72268 * This function determines the day that should receive focus in the calendar,
72269 * prioritizing days with specific modifiers (e.g., "focused", "today") or
72270 * selection states.
72271 *
72272 * @param days The array of `CalendarDay` objects to evaluate.
72273 * @param getModifiers A function to retrieve the modifiers for a given day.
72274 * @param isSelected A function to determine if a day is selected.
72275 * @param lastFocused The last focused day, if any.
72276 * @returns The `CalendarDay` that should receive focus, or `undefined` if no
72277 * focusable day is found.
72278 */
72279function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
72280 let focusTarget;
72281 let foundFocusTargetPriority = -1;
72282 for (const day of days) {
72283 const modifiers = getModifiers(day);
72284 if (isFocusableDay(modifiers)) {
72285 if (modifiers[DayFlag.focused] &&
72286 foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {
72287 focusTarget = day;
72288 foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;
72289 }
72290 else if (lastFocused?.isEqualTo(day) &&
72291 foundFocusTargetPriority < FocusTargetPriority.LastFocused) {
72292 focusTarget = day;
72293 foundFocusTargetPriority = FocusTargetPriority.LastFocused;
72294 }
72295 else if (isSelected(day.date) &&
72296 foundFocusTargetPriority < FocusTargetPriority.Selected) {
72297 focusTarget = day;
72298 foundFocusTargetPriority = FocusTargetPriority.Selected;
72299 }
72300 else if (modifiers[DayFlag.today] &&
72301 foundFocusTargetPriority < FocusTargetPriority.Today) {
72302 focusTarget = day;
72303 foundFocusTargetPriority = FocusTargetPriority.Today;
72304 }
72305 }
72306 }
72307 if (!focusTarget) {
72308 // Return the first day that is focusable
72309 focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));
72310 }
72311 return focusTarget;
72312}
72313
72314;// ./node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js
72315/**
72316 * Calculates the next date that should be focused in the calendar.
72317 *
72318 * This function determines the next focusable date based on the movement
72319 * direction, constraints, and calendar configuration.
72320 *
72321 * @param moveBy The unit of movement (e.g., "day", "week").
72322 * @param moveDir The direction of movement ("before" or "after").
72323 * @param refDate The reference date from which to calculate the next focusable
72324 * date.
72325 * @param navStart The earliest date the user can navigate to.
72326 * @param navEnd The latest date the user can navigate to.
72327 * @param props The DayPicker props, including calendar configuration options.
72328 * @param dateLib The date library to use for date manipulation.
72329 * @returns The next focusable date.
72330 */
72331function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
72332 const { ISOWeek, broadcastCalendar } = props;
72333 const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
72334 const moveFns = {
72335 day: addDays,
72336 week: addWeeks,
72337 month: addMonths,
72338 year: addYears,
72339 startOfWeek: (date) => broadcastCalendar
72340 ? startOfBroadcastWeek(date, dateLib)
72341 : ISOWeek
72342 ? startOfISOWeek(date)
72343 : startOfWeek(date),
72344 endOfWeek: (date) => broadcastCalendar
72345 ? endOfBroadcastWeek(date)
72346 : ISOWeek
72347 ? endOfISOWeek(date)
72348 : endOfWeek(date),
72349 };
72350 let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
72351 if (moveDir === "before" && navStart) {
72352 focusableDate = max([navStart, focusableDate]);
72353 }
72354 else if (moveDir === "after" && navEnd) {
72355 focusableDate = min([navEnd, focusableDate]);
72356 }
72357 return focusableDate;
72358}
72359
72360;// ./node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js
72361
72362
72363
72364/**
72365 * Determines the next focusable day in the calendar.
72366 *
72367 * This function recursively calculates the next focusable day based on the
72368 * movement direction and modifiers applied to the days.
72369 *
72370 * @param moveBy The unit of movement (e.g., "day", "week").
72371 * @param moveDir The direction of movement ("before" or "after").
72372 * @param refDay The currently focused day.
72373 * @param calendarStartMonth The earliest month the user can navigate to.
72374 * @param calendarEndMonth The latest month the user can navigate to.
72375 * @param props The DayPicker props, including modifiers and configuration
72376 * options.
72377 * @param dateLib The date library to use for date manipulation.
72378 * @param attempt The current recursion attempt (used to limit recursion depth).
72379 * @returns The next focusable day, or `undefined` if no focusable day is found.
72380 */
72381function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {
72382 if (attempt > 365) {
72383 // Limit the recursion to 365 attempts
72384 return undefined;
72385 }
72386 const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
72387 const isDisabled = Boolean(props.disabled &&
72388 dateMatchModifiers(focusableDate, props.disabled, dateLib));
72389 const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
72390 const targetMonth = focusableDate;
72391 const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
72392 if (!isDisabled && !isHidden) {
72393 return focusDay;
72394 }
72395 // Recursively attempt to find the next focusable date
72396 return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);
72397}
72398
72399;// ./node_modules/react-day-picker/dist/esm/useFocus.js
72400
72401
72402
72403/**
72404 * Manages focus behavior for the DayPicker component, including setting,
72405 * moving, and blurring focus on calendar days.
72406 *
72407 * @template T - The type of DayPicker props.
72408 * @param props - The DayPicker props.
72409 * @param calendar - The calendar object containing the displayed days and
72410 * months.
72411 * @param getModifiers - A function to retrieve modifiers for a given day.
72412 * @param isSelected - A function to check if a date is selected.
72413 * @param dateLib - The date utility library instance.
72414 * @returns An object containing focus-related methods and the currently focused
72415 * day.
72416 */
72417function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
72418 const { autoFocus } = props;
72419 const [lastFocused, setLastFocused] = (0,external_React_.useState)();
72420 const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
72421 const [focusedDay, setFocused] = (0,external_React_.useState)(autoFocus ? focusTarget : undefined);
72422 const blur = () => {
72423 setLastFocused(focusedDay);
72424 setFocused(undefined);
72425 };
72426 const moveFocus = (moveBy, moveDir) => {
72427 if (!focusedDay)
72428 return;
72429 const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
72430 if (!nextFocus)
72431 return;
72432 if (props.disableNavigation) {
72433 const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
72434 if (!isNextInCalendar) {
72435 return;
72436 }
72437 }
72438 calendar.goToDay(nextFocus);
72439 setFocused(nextFocus);
72440 };
72441 const isFocusTarget = (day) => {
72442 return Boolean(focusTarget?.isEqualTo(day));
72443 };
72444 const useFocus = {
72445 isFocusTarget,
72446 setFocused,
72447 focused: focusedDay,
72448 blur,
72449 moveFocus,
72450 };
72451 return useFocus;
72452}
72453
72454;// ./node_modules/react-day-picker/dist/esm/selection/useMulti.js
72455
72456/**
72457 * Hook to manage multiple-date selection in the DayPicker component.
72458 *
72459 * @template T - The type of DayPicker props.
72460 * @param props - The DayPicker props.
72461 * @param dateLib - The date utility library instance.
72462 * @returns An object containing the selected dates, a function to select dates,
72463 * and a function to check if a date is selected.
72464 */
72465function useMulti(props, dateLib) {
72466 const { selected: initiallySelected, required, onSelect, } = props;
72467 const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
72468 const selected = !onSelect ? internallySelected : initiallySelected;
72469 const { isSameDay } = dateLib;
72470 const isSelected = (date) => {
72471 return selected?.some((d) => isSameDay(d, date)) ?? false;
72472 };
72473 const { min, max } = props;
72474 const select = (triggerDate, modifiers, e) => {
72475 let newDates = [...(selected ?? [])];
72476 if (isSelected(triggerDate)) {
72477 if (selected?.length === min) {
72478 // Min value reached, do nothing
72479 return;
72480 }
72481 if (required && selected?.length === 1) {
72482 // Required value already selected do nothing
72483 return;
72484 }
72485 newDates = selected?.filter((d) => !isSameDay(d, triggerDate));
72486 }
72487 else {
72488 if (selected?.length === max) {
72489 // Max value reached, reset the selection to date
72490 newDates = [triggerDate];
72491 }
72492 else {
72493 // Add the date to the selection
72494 newDates = [...newDates, triggerDate];
72495 }
72496 }
72497 if (!onSelect) {
72498 setSelected(newDates);
72499 }
72500 onSelect?.(newDates, triggerDate, modifiers, e);
72501 return newDates;
72502 };
72503 return {
72504 selected,
72505 select,
72506 isSelected,
72507 };
72508}
72509
72510;// ./node_modules/react-day-picker/dist/esm/utils/addToRange.js
72511
72512/**
72513 * Adds a date to an existing range, considering constraints like minimum and
72514 * maximum range size.
72515 *
72516 * @param date - The date to add to the range.
72517 * @param initialRange - The initial range to which the date will be added.
72518 * @param min - The minimum number of days in the range.
72519 * @param max - The maximum number of days in the range.
72520 * @param required - Whether the range must always include at least one date.
72521 * @param dateLib - The date utility library instance.
72522 * @returns The updated date range, or `undefined` if the range is cleared.
72523 * @group Utilities
72524 */
72525function addToRange(date, initialRange, min = 0, max = 0, required = false, dateLib = DateLib_defaultDateLib) {
72526 const { from, to } = initialRange || {};
72527 const { isSameDay, isAfter, isBefore } = dateLib;
72528 let range;
72529 if (!from && !to) {
72530 // the range is empty, add the date
72531 range = { from: date, to: min > 0 ? undefined : date };
72532 }
72533 else if (from && !to) {
72534 // adding date to an incomplete range
72535 if (isSameDay(from, date)) {
72536 // adding a date equal to the start of the range
72537 if (min === 0) {
72538 range = { from, to: date };
72539 }
72540 else if (required) {
72541 range = { from, to: undefined };
72542 }
72543 else {
72544 range = undefined;
72545 }
72546 }
72547 else if (isBefore(date, from)) {
72548 // adding a date before the start of the range
72549 range = { from: date, to: from };
72550 }
72551 else {
72552 // adding a date after the start of the range
72553 range = { from, to: date };
72554 }
72555 }
72556 else if (from && to) {
72557 // adding date to a complete range
72558 if (isSameDay(from, date) && isSameDay(to, date)) {
72559 // adding a date that is equal to both start and end of the range
72560 if (required) {
72561 range = { from, to };
72562 }
72563 else {
72564 range = undefined;
72565 }
72566 }
72567 else if (isSameDay(from, date)) {
72568 // adding a date equal to the the start of the range
72569 range = { from, to: min > 0 ? undefined : date };
72570 }
72571 else if (isSameDay(to, date)) {
72572 // adding a dare equal to the end of the range
72573 range = { from: date, to: min > 0 ? undefined : date };
72574 }
72575 else if (isBefore(date, from)) {
72576 // adding a date before the start of the range
72577 range = { from: date, to: to };
72578 }
72579 else if (isAfter(date, from)) {
72580 // adding a date after the start of the range
72581 range = { from, to: date };
72582 }
72583 else if (isAfter(date, to)) {
72584 // adding a date after the end of the range
72585 range = { from, to: date };
72586 }
72587 else {
72588 throw new Error("Invalid range");
72589 }
72590 }
72591 // check for min / max
72592 if (range?.from && range?.to) {
72593 const diff = dateLib.differenceInCalendarDays(range.to, range.from);
72594 if (max > 0 && diff > max) {
72595 range = { from: date, to: undefined };
72596 }
72597 else if (min > 1 && diff < min) {
72598 range = { from: date, to: undefined };
72599 }
72600 }
72601 return range;
72602}
72603
72604;// ./node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js
72605
72606/**
72607 * Checks if a date range contains one or more specified days of the week.
72608 *
72609 * @since 9.2.2
72610 * @param range - The date range to check.
72611 * @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is
72612 * Sunday).
72613 * @param dateLib - The date utility library instance.
72614 * @returns `true` if the range contains the specified day(s) of the week,
72615 * otherwise `false`.
72616 * @group Utilities
72617 */
72618function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = DateLib_defaultDateLib) {
72619 const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
72620 let date = range.from;
72621 const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
72622 // iterate at maximum one week or the total days if the range is shorter than one week
72623 const totalDaysLimit = Math.min(totalDays, 6);
72624 for (let i = 0; i <= totalDaysLimit; i++) {
72625 if (dayOfWeekArr.includes(date.getDay())) {
72626 return true;
72627 }
72628 date = dateLib.addDays(date, 1);
72629 }
72630 return false;
72631}
72632
72633;// ./node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js
72634
72635
72636/**
72637 * Determines if two date ranges overlap.
72638 *
72639 * @since 9.2.2
72640 * @param rangeLeft - The first date range.
72641 * @param rangeRight - The second date range.
72642 * @param dateLib - The date utility library instance.
72643 * @returns `true` if the ranges overlap, otherwise `false`.
72644 * @group Utilities
72645 */
72646function rangeOverlaps(rangeLeft, rangeRight, dateLib = DateLib_defaultDateLib) {
72647 return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||
72648 rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||
72649 rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||
72650 rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));
72651}
72652
72653;// ./node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js
72654
72655
72656
72657
72658
72659
72660/**
72661 * Checks if a date range contains dates that match the given modifiers.
72662 *
72663 * @since 9.2.2
72664 * @param range - The date range to check.
72665 * @param modifiers - The modifiers to match against.
72666 * @param dateLib - The date utility library instance.
72667 * @returns `true` if the range contains matching dates, otherwise `false`.
72668 * @group Utilities
72669 */
72670function rangeContainsModifiers(range, modifiers, dateLib = DateLib_defaultDateLib) {
72671 const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
72672 // Defer function matchers evaluation as they are the least performant.
72673 const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
72674 const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
72675 if (typeof matcher === "boolean")
72676 return matcher;
72677 if (dateLib.isDate(matcher)) {
72678 return rangeIncludesDate(range, matcher, false, dateLib);
72679 }
72680 if (isDatesArray(matcher, dateLib)) {
72681 return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
72682 }
72683 if (isDateRange(matcher)) {
72684 if (matcher.from && matcher.to) {
72685 return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
72686 }
72687 return false;
72688 }
72689 if (isDayOfWeekType(matcher)) {
72690 return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
72691 }
72692 if (isDateInterval(matcher)) {
72693 const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
72694 if (isClosedInterval) {
72695 return rangeOverlaps(range, {
72696 from: dateLib.addDays(matcher.after, 1),
72697 to: dateLib.addDays(matcher.before, -1),
72698 }, dateLib);
72699 }
72700 return (dateMatchModifiers(range.from, matcher, dateLib) ||
72701 dateMatchModifiers(range.to, matcher, dateLib));
72702 }
72703 if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
72704 return (dateMatchModifiers(range.from, matcher, dateLib) ||
72705 dateMatchModifiers(range.to, matcher, dateLib));
72706 }
72707 return false;
72708 });
72709 if (nonFunctionMatchersResult) {
72710 return true;
72711 }
72712 const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
72713 if (functionMatchers.length) {
72714 let date = range.from;
72715 const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
72716 for (let i = 0; i <= totalDays; i++) {
72717 if (functionMatchers.some((matcher) => matcher(date))) {
72718 return true;
72719 }
72720 date = dateLib.addDays(date, 1);
72721 }
72722 }
72723 return false;
72724}
72725
72726;// ./node_modules/react-day-picker/dist/esm/selection/useRange.js
72727
72728
72729
72730/**
72731 * Hook to manage range selection in the DayPicker component.
72732 *
72733 * @template T - The type of DayPicker props.
72734 * @param props - The DayPicker props.
72735 * @param dateLib - The date utility library instance.
72736 * @returns An object containing the selected range, a function to select a
72737 * range, and a function to check if a date is within the range.
72738 */
72739function useRange(props, dateLib) {
72740 const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
72741 const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
72742 const selected = !onSelect ? internallySelected : initiallySelected;
72743 const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
72744 const select = (triggerDate, modifiers, e) => {
72745 const { min, max } = props;
72746 const newRange = triggerDate
72747 ? addToRange(triggerDate, selected, min, max, required, dateLib)
72748 : undefined;
72749 if (excludeDisabled && disabled && newRange?.from && newRange.to) {
72750 if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
72751 // if a disabled days is found, the range is reset
72752 newRange.from = triggerDate;
72753 newRange.to = undefined;
72754 }
72755 }
72756 if (!onSelect) {
72757 setSelected(newRange);
72758 }
72759 onSelect?.(newRange, triggerDate, modifiers, e);
72760 return newRange;
72761 };
72762 return {
72763 selected,
72764 select,
72765 isSelected,
72766 };
72767}
72768
72769;// ./node_modules/react-day-picker/dist/esm/selection/useSingle.js
72770
72771/**
72772 * Hook to manage single-date selection in the DayPicker component.
72773 *
72774 * @template T - The type of DayPicker props.
72775 * @param props - The DayPicker props.
72776 * @param dateLib - The date utility library instance.
72777 * @returns An object containing the selected date, a function to select a date,
72778 * and a function to check if a date is selected.
72779 */
72780function useSingle(props, dateLib) {
72781 const { selected: initiallySelected, required, onSelect, } = props;
72782 const [internallySelected, setSelected] = useControlledValue_useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
72783 const selected = !onSelect ? internallySelected : initiallySelected;
72784 const { isSameDay } = dateLib;
72785 const isSelected = (compareDate) => {
72786 return selected ? isSameDay(selected, compareDate) : false;
72787 };
72788 const select = (triggerDate, modifiers, e) => {
72789 let newDate = triggerDate;
72790 if (!required && selected && selected && isSameDay(triggerDate, selected)) {
72791 // If the date is the same, clear the selection.
72792 newDate = undefined;
72793 }
72794 if (!onSelect) {
72795 setSelected(newDate);
72796 }
72797 if (required) {
72798 onSelect?.(newDate, triggerDate, modifiers, e);
72799 }
72800 else {
72801 onSelect?.(newDate, triggerDate, modifiers, e);
72802 }
72803 return newDate;
72804 };
72805 return {
72806 selected,
72807 select,
72808 isSelected,
72809 };
72810}
72811
72812;// ./node_modules/react-day-picker/dist/esm/useSelection.js
72813
72814
72815
72816/**
72817 * Determines the appropriate selection hook to use based on the selection mode
72818 * and returns the corresponding selection object.
72819 *
72820 * @template T - The type of DayPicker props.
72821 * @param props - The DayPicker props.
72822 * @param dateLib - The date utility library instance.
72823 * @returns The selection object for the specified mode, or `undefined` if no
72824 * mode is set.
72825 */
72826function useSelection(props, dateLib) {
72827 const single = useSingle(props, dateLib);
72828 const multi = useMulti(props, dateLib);
72829 const range = useRange(props, dateLib);
72830 switch (props.mode) {
72831 case "single":
72832 return single;
72833 case "multiple":
72834 return multi;
72835 case "range":
72836 return range;
72837 default:
72838 return undefined;
72839 }
72840}
72841
72842;// ./node_modules/react-day-picker/dist/esm/DayPicker.js
72843
72844
72845
72846
72847
72848
72849
72850
72851
72852
72853
72854
72855
72856
72857
72858
72859
72860
72861
72862
72863
72864
72865/**
72866 * Renders the DayPicker calendar component.
72867 *
72868 * @param initialProps - The props for the DayPicker component.
72869 * @returns The rendered DayPicker component.
72870 * @group DayPicker
72871 * @see https://daypicker.dev
72872 */
72873function DayPicker(initialProps) {
72874 let props = initialProps;
72875 if (props.timeZone) {
72876 props = {
72877 ...initialProps,
72878 };
72879 if (props.today) {
72880 props.today = new date_TZDate(props.today, props.timeZone);
72881 }
72882 if (props.month) {
72883 props.month = new date_TZDate(props.month, props.timeZone);
72884 }
72885 if (props.defaultMonth) {
72886 props.defaultMonth = new date_TZDate(props.defaultMonth, props.timeZone);
72887 }
72888 if (props.startMonth) {
72889 props.startMonth = new date_TZDate(props.startMonth, props.timeZone);
72890 }
72891 if (props.endMonth) {
72892 props.endMonth = new date_TZDate(props.endMonth, props.timeZone);
72893 }
72894 if (props.mode === "single" && props.selected) {
72895 props.selected = new date_TZDate(props.selected, props.timeZone);
72896 }
72897 else if (props.mode === "multiple" && props.selected) {
72898 props.selected = props.selected?.map((date) => new date_TZDate(date, props.timeZone));
72899 }
72900 else if (props.mode === "range" && props.selected) {
72901 props.selected = {
72902 from: props.selected.from
72903 ? new date_TZDate(props.selected.from, props.timeZone)
72904 : undefined,
72905 to: props.selected.to
72906 ? new date_TZDate(props.selected.to, props.timeZone)
72907 : undefined,
72908 };
72909 }
72910 }
72911 const { components, formatters, labels, dateLib, locale, classNames } = (0,external_React_.useMemo)(() => {
72912 const locale = { ...en_US_enUS, ...props.locale };
72913 const dateLib = new DateLib({
72914 locale,
72915 weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
72916 firstWeekContainsDate: props.firstWeekContainsDate,
72917 useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
72918 useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
72919 timeZone: props.timeZone,
72920 numerals: props.numerals,
72921 }, props.dateLib);
72922 return {
72923 dateLib,
72924 components: getComponents(props.components),
72925 formatters: getFormatters(props.formatters),
72926 labels: { ...labels_namespaceObject, ...props.labels },
72927 locale,
72928 classNames: { ...getDefaultClassNames(), ...props.classNames },
72929 };
72930 }, [
72931 props.locale,
72932 props.broadcastCalendar,
72933 props.weekStartsOn,
72934 props.firstWeekContainsDate,
72935 props.useAdditionalWeekYearTokens,
72936 props.useAdditionalDayOfYearTokens,
72937 props.timeZone,
72938 props.numerals,
72939 props.dateLib,
72940 props.components,
72941 props.formatters,
72942 props.labels,
72943 props.classNames,
72944 ]);
72945 const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
72946 const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
72947 const calendar = useCalendar(props, dateLib);
72948 const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth, } = calendar;
72949 const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
72950 const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
72951 const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
72952 const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
72953 const weekdays = (0,external_React_.useMemo)(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
72954 const isInteractive = mode !== undefined || onDayClick !== undefined;
72955 const handlePreviousClick = (0,external_React_.useCallback)(() => {
72956 if (!previousMonth)
72957 return;
72958 goToMonth(previousMonth);
72959 onPrevClick?.(previousMonth);
72960 }, [previousMonth, goToMonth, onPrevClick]);
72961 const handleNextClick = (0,external_React_.useCallback)(() => {
72962 if (!nextMonth)
72963 return;
72964 goToMonth(nextMonth);
72965 onNextClick?.(nextMonth);
72966 }, [goToMonth, nextMonth, onNextClick]);
72967 const handleDayClick = (0,external_React_.useCallback)((day, m) => (e) => {
72968 e.preventDefault();
72969 e.stopPropagation();
72970 setFocused(day);
72971 select?.(day.date, m, e);
72972 onDayClick?.(day.date, m, e);
72973 }, [select, onDayClick, setFocused]);
72974 const handleDayFocus = (0,external_React_.useCallback)((day, m) => (e) => {
72975 setFocused(day);
72976 onDayFocus?.(day.date, m, e);
72977 }, [onDayFocus, setFocused]);
72978 const handleDayBlur = (0,external_React_.useCallback)((day, m) => (e) => {
72979 blur();
72980 onDayBlur?.(day.date, m, e);
72981 }, [blur, onDayBlur]);
72982 const handleDayKeyDown = (0,external_React_.useCallback)((day, modifiers) => (e) => {
72983 const keyMap = {
72984 ArrowLeft: [
72985 e.shiftKey ? "month" : "day",
72986 props.dir === "rtl" ? "after" : "before",
72987 ],
72988 ArrowRight: [
72989 e.shiftKey ? "month" : "day",
72990 props.dir === "rtl" ? "before" : "after",
72991 ],
72992 ArrowDown: [e.shiftKey ? "year" : "week", "after"],
72993 ArrowUp: [e.shiftKey ? "year" : "week", "before"],
72994 PageUp: [e.shiftKey ? "year" : "month", "before"],
72995 PageDown: [e.shiftKey ? "year" : "month", "after"],
72996 Home: ["startOfWeek", "before"],
72997 End: ["endOfWeek", "after"],
72998 };
72999 if (keyMap[e.key]) {
73000 e.preventDefault();
73001 e.stopPropagation();
73002 const [moveBy, moveDir] = keyMap[e.key];
73003 moveFocus(moveBy, moveDir);
73004 }
73005 onDayKeyDown?.(day.date, modifiers, e);
73006 }, [moveFocus, onDayKeyDown, props.dir]);
73007 const handleDayMouseEnter = (0,external_React_.useCallback)((day, modifiers) => (e) => {
73008 onDayMouseEnter?.(day.date, modifiers, e);
73009 }, [onDayMouseEnter]);
73010 const handleDayMouseLeave = (0,external_React_.useCallback)((day, modifiers) => (e) => {
73011 onDayMouseLeave?.(day.date, modifiers, e);
73012 }, [onDayMouseLeave]);
73013 const handleMonthChange = (0,external_React_.useCallback)((date) => (e) => {
73014 const selectedMonth = Number(e.target.value);
73015 const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
73016 goToMonth(month);
73017 }, [dateLib, goToMonth]);
73018 const handleYearChange = (0,external_React_.useCallback)((date) => (e) => {
73019 const selectedYear = Number(e.target.value);
73020 const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
73021 goToMonth(month);
73022 }, [dateLib, goToMonth]);
73023 const { className, style } = (0,external_React_.useMemo)(() => ({
73024 className: [classNames[UI_UI.Root], props.className]
73025 .filter(Boolean)
73026 .join(" "),
73027 style: { ...styles?.[UI_UI.Root], ...props.style },
73028 }), [classNames, props.className, props.style, styles]);
73029 const dataAttributes = getDataAttributes(props);
73030 const rootElRef = (0,external_React_.useRef)(null);
73031 useAnimation(rootElRef, Boolean(props.animate), {
73032 classNames,
73033 months,
73034 focused,
73035 dateLib,
73036 });
73037 const contextValue = {
73038 dayPickerProps: props,
73039 selected: selectedValue,
73040 select: select,
73041 isSelected,
73042 months,
73043 nextMonth,
73044 previousMonth,
73045 goToMonth,
73046 getModifiers,
73047 components,
73048 classNames,
73049 styles,
73050 labels,
73051 formatters,
73052 };
73053 return (external_React_.createElement(dayPickerContext.Provider, { value: contextValue },
73054 external_React_.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
73055 external_React_.createElement(components.Months, { className: classNames[UI_UI.Months], style: styles?.[UI_UI.Months] },
73056 !props.hideNavigation && !navLayout && (external_React_.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI_UI.Nav], style: styles?.[UI_UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
73057 months.map((calendarMonth, displayIndex) => {
73058 return (external_React_.createElement(components.Month, { "data-animated-month": props.animate ? "true" : undefined, className: classNames[UI_UI.Month], style: styles?.[UI_UI.Month],
73059 // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
73060 key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },
73061 navLayout === "around" &&
73062 !props.hideNavigation &&
73063 displayIndex === 0 && (external_React_.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI_UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
73064 external_React_.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
73065 external_React_.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI_UI.MonthCaption], style: styles?.[UI_UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (external_React_.createElement(components.DropdownNav, { className: classNames[UI_UI.Dropdowns], style: styles?.[UI_UI.Dropdowns] },
73066 (() => {
73067 const monthControl = captionLayout === "dropdown" ||
73068 captionLayout === "dropdown-months" ? (external_React_.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI_UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI_UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (external_React_.createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
73069 const yearControl = captionLayout === "dropdown" ||
73070 captionLayout === "dropdown-years" ? (external_React_.createElement(components.YearsDropdown, { key: "year", className: classNames[UI_UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI_UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (external_React_.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
73071 const controls = dateLib.getMonthYearOrder() === "year-first"
73072 ? [yearControl, monthControl]
73073 : [monthControl, yearControl];
73074 return controls;
73075 })(),
73076 external_React_.createElement("span", { role: "status", "aria-live": "polite", style: {
73077 border: 0,
73078 clip: "rect(0 0 0 0)",
73079 height: "1px",
73080 margin: "-1px",
73081 overflow: "hidden",
73082 padding: 0,
73083 position: "absolute",
73084 width: "1px",
73085 whiteSpace: "nowrap",
73086 wordWrap: "normal",
73087 } }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
73088 // biome-ignore lint/a11y/useSemanticElements: breaking change
73089 external_React_.createElement(components.CaptionLabel, { className: classNames[UI_UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
73090 navLayout === "around" &&
73091 !props.hideNavigation &&
73092 displayIndex === numberOfMonths - 1 && (external_React_.createElement(components.NextMonthButton, { type: "button", className: classNames[UI_UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
73093 external_React_.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, className: classNames[UI_UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" }))),
73094 displayIndex === numberOfMonths - 1 &&
73095 navLayout === "after" &&
73096 !props.hideNavigation && (external_React_.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI_UI.Nav], style: styles?.[UI_UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
73097 external_React_.createElement(components.MonthGrid, { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid(calendarMonth.date, dateLib.options, dateLib) ||
73098 undefined, className: classNames[UI_UI.MonthGrid], style: styles?.[UI_UI.MonthGrid] },
73099 !props.hideWeekdays && (external_React_.createElement(components.Weekdays, { "data-animated-weekdays": props.animate ? "true" : undefined, className: classNames[UI_UI.Weekdays], style: styles?.[UI_UI.Weekdays] },
73100 showWeekNumber && (external_React_.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader(dateLib.options), className: classNames[UI_UI.WeekNumberHeader], style: styles?.[UI_UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader())),
73101 weekdays.map((weekday) => (external_React_.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI_UI.Weekday], key: String(weekday), style: styles?.[UI_UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
73102 external_React_.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI_UI.Weeks], style: styles?.[UI_UI.Weeks] }, calendarMonth.weeks.map((week) => {
73103 return (external_React_.createElement(components.Week, { className: classNames[UI_UI.Week], key: week.weekNumber, style: styles?.[UI_UI.Week], week: week },
73104 showWeekNumber && (
73105 // biome-ignore lint/a11y/useSemanticElements: react component
73106 external_React_.createElement(components.WeekNumber, { week: week, style: styles?.[UI_UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
73107 locale,
73108 }), className: classNames[UI_UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
73109 week.days.map((day) => {
73110 const { date } = day;
73111 const modifiers = getModifiers(day);
73112 modifiers[DayFlag.focused] =
73113 !modifiers.hidden &&
73114 Boolean(focused?.isEqualTo(day));
73115 modifiers[SelectionState.selected] =
73116 isSelected?.(date) || modifiers.selected;
73117 if (isDateRange(selectedValue)) {
73118 // add range modifiers
73119 const { from, to } = selectedValue;
73120 modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
73121 modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
73122 modifiers[SelectionState.range_middle] =
73123 rangeIncludesDate(selectedValue, date, true, dateLib);
73124 }
73125 const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
73126 const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
73127 const ariaLabel = !isInteractive && !modifiers.hidden
73128 ? labelGridcell(date, modifiers, dateLib.options, dateLib)
73129 : undefined;
73130 return (
73131 // biome-ignore lint/a11y/useSemanticElements: react component
73132 external_React_.createElement(components.Day, { key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": dateLib.format(date, "yyyy-MM-dd"), "data-month": day.outside
73133 ? dateLib.format(date, "yyyy-MM")
73134 : undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (external_React_.createElement(components.DayButton, { className: classNames[UI_UI.DayButton], style: styles?.[UI_UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
73135 formatDay(day.date, dateLib.options, dateLib))));
73136 })));
73137 })))));
73138 })),
73139 props.footer && (
73140 // biome-ignore lint/a11y/useSemanticElements: react component
73141 external_React_.createElement(components.Footer, { className: classNames[UI_UI.Footer], style: styles?.[UI_UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
73142}
73143
73144;// ./node_modules/@wordpress/components/build-module/calendar/utils/day-cell.js
73145
73146const PreviewDashStartAndEnd = () => {
73147 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
73148 viewBox: "0 0 32 32",
73149 xmlns: "http://www.w3.org/2000/svg",
73150 fill: "none",
73151 stroke: "currentColor",
73152 strokeDasharray: "3.7677",
73153 strokeDashoffset: "3.2",
73154 strokeWidth: "1",
73155 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
73156 d: "M29.5,0.5 h-27 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h27 a2,2 0 0 0 2,-2 v-27 a2,2 0 0 0 -2,-2"
73157 })
73158 });
73159};
73160const PreviewDashStart = () => {
73161 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
73162 viewBox: "0 0 32 32",
73163 xmlns: "http://www.w3.org/2000/svg",
73164 fill: "none",
73165 stroke: "currentColor",
73166 strokeDasharray: "3.84516",
73167 strokeDashoffset: "1.9226",
73168 strokeWidth: "1",
73169 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
73170 d: "M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30"
73171 })
73172 });
73173};
73174const PreviewDashMiddle = () => {
73175 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("svg", {
73176 viewBox: "0 0 32 32",
73177 xmlns: "http://www.w3.org/2000/svg",
73178 fill: "none",
73179 stroke: "currentColor",
73180 strokeDasharray: "3.9 4",
73181 strokeDashoffset: "2",
73182 strokeWidth: "1",
73183 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("line", {
73184 x1: "0",
73185 y1: "0.5",
73186 x2: "100",
73187 y2: "0.5"
73188 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("line", {
73189 x1: "0",
73190 y1: "31.5",
73191 x2: "100",
73192 y2: "31.5"
73193 })]
73194 });
73195};
73196const PreviewDashEnd = () => {
73197 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
73198 viewBox: "0 0 32 32",
73199 xmlns: "http://www.w3.org/2000/svg",
73200 fill: "none",
73201 stroke: "currentColor",
73202 strokeDasharray: "3.84516",
73203 strokeDashoffset: "1.9226",
73204 strokeWidth: "1",
73205 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("path", {
73206 d: "M0,0.5 h29.5 a2,2 0 0 1 2,2 v27 a2,2 0 0 1 -2,2 h-29.5"
73207 })
73208 });
73209};
73210function day_cell_Day(props) {
73211 const {
73212 day,
73213 modifiers,
73214 children,
73215 ...tdProps
73216 } = props;
73217 let PreviewDash;
73218 if (modifiers.preview_start && modifiers.preview_end) {
73219 PreviewDash = PreviewDashStartAndEnd;
73220 } else if (modifiers.preview_start) {
73221 PreviewDash = PreviewDashStart;
73222 } else if (modifiers.preview_end) {
73223 PreviewDash = PreviewDashEnd;
73224 } else if (modifiers.preview) {
73225 PreviewDash = PreviewDashMiddle;
73226 }
73227 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("td", {
73228 ...tdProps,
73229 children: [PreviewDash && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDash, {}), children]
73230 });
73231}
73232
73233
73234;// ./node_modules/@wordpress/components/build-module/calendar/utils/constants.js
73235
73236const CLASSNAMES = {
73237 root: "components-calendar",
73238 day: "components-calendar__day",
73239 day_button: "components-calendar__day-button",
73240 caption_label: "components-calendar__caption-label",
73241 button_next: "components-calendar__button-next",
73242 button_previous: "components-calendar__button-previous",
73243 chevron: "components-calendar__chevron",
73244 nav: "components-calendar__nav",
73245 month_caption: "components-calendar__month-caption",
73246 months: "components-calendar__months",
73247 month_grid: "components-calendar__month-grid",
73248 weekday: "components-calendar__weekday",
73249 today: "components-calendar__day--today",
73250 selected: "components-calendar__day--selected",
73251 disabled: "components-calendar__day--disabled",
73252 hidden: "components-calendar__day--hidden",
73253 range_start: "components-calendar__range-start",
73254 range_end: "components-calendar__range-end",
73255 range_middle: "components-calendar__range-middle",
73256 weeks_before_enter: "components-calendar__weeks-before-enter",
73257 weeks_before_exit: "components-calendar__weeks-before-exit",
73258 weeks_after_enter: "components-calendar__weeks-after-enter",
73259 weeks_after_exit: "components-calendar__weeks-after-exit",
73260 caption_after_enter: "components-calendar__caption-after-enter",
73261 caption_after_exit: "components-calendar__caption-after-exit",
73262 caption_before_enter: "components-calendar__caption-before-enter",
73263 caption_before_exit: "components-calendar__caption-before-exit"
73264};
73265const MODIFIER_CLASSNAMES = {
73266 preview: "components-calendar__day--preview",
73267 preview_start: "components-calendar__day--preview-start",
73268 preview_end: "components-calendar__day--preview-end"
73269};
73270const COMMON_PROPS = {
73271 animate: true,
73272 // Only show days in the current month
73273 showOutsideDays: false,
73274 // Hide week number column
73275 showWeekNumber: false,
73276 // Show weekdays row
73277 hideWeekdays: false,
73278 // Month and year caption are not interactive
73279 captionLayout: "label",
73280 // Show a variable number of weeks depending on the month
73281 fixedWeeks: false,
73282 // Show navigation buttons
73283 hideNavigation: false,
73284 // Class names
73285 classNames: CLASSNAMES,
73286 // Default role
73287 role: "application",
73288 components: {
73289 Day: day_cell_Day
73290 }
73291};
73292
73293
73294;// ./node_modules/@wordpress/components/build-module/calendar/utils/misc.js
73295function clampNumberOfMonths(numberOfMonths) {
73296 return Math.min(3, Math.max(1, numberOfMonths));
73297}
73298
73299
73300;// ./node_modules/@wordpress/components/build-module/calendar/utils/use-localization-props.js
73301
73302
73303function isLocaleRTL(localeCode) {
73304 const localeObj = new Intl.Locale(localeCode);
73305 if ("getTextInfo" in localeObj) {
73306 return localeObj.getTextInfo().direction === "rtl";
73307 }
73308 return [
73309 "ar",
73310 // Arabic
73311 "he",
73312 // Hebrew
73313 "fa",
73314 // Persian (Farsi)
73315 "ur",
73316 // Urdu
73317 "ps",
73318 // Pashto
73319 "syr",
73320 // Syriac
73321 "dv",
73322 // Divehi
73323 "ku",
73324 // Kurdish (Sorani)
73325 "yi"
73326 // Yiddish
73327 ].includes(localeObj.language);
73328}
73329const useLocalizationProps = ({
73330 locale,
73331 timeZone,
73332 mode
73333}) => {
73334 return (0,external_wp_element_namespaceObject.useMemo)(() => {
73335 const monthNameFormatter = new Intl.DateTimeFormat(locale.code, {
73336 year: "numeric",
73337 month: "long",
73338 timeZone
73339 });
73340 const weekdayNarrowFormatter = new Intl.DateTimeFormat(locale.code, {
73341 weekday: "narrow",
73342 timeZone
73343 });
73344 const weekdayLongFormatter = new Intl.DateTimeFormat(locale.code, {
73345 weekday: "long",
73346 timeZone
73347 });
73348 const fullDateFormatter = new Intl.DateTimeFormat(locale.code, {
73349 weekday: "long",
73350 year: "numeric",
73351 month: "long",
73352 day: "numeric",
73353 timeZone
73354 });
73355 return {
73356 "aria-label": mode === "single" ? (0,external_wp_i18n_namespaceObject.__)("Date calendar") : (0,external_wp_i18n_namespaceObject.__)("Date range calendar"),
73357 labels: {
73358 /**
73359 * The label for the month grid.
73360 * @param date
73361 */
73362 labelGrid: (date) => monthNameFormatter.format(date),
73363 /**
73364 * The label for the gridcell, when the calendar is not interactive.
73365 * @param date
73366 * @param modifiers
73367 */
73368 labelGridcell: (date, modifiers) => {
73369 const formattedDate = fullDateFormatter.format(date);
73370 let label = formattedDate;
73371 if (modifiers?.today) {
73372 label = (0,external_wp_i18n_namespaceObject.sprintf)(
73373 // translators: %s is the full date (e.g. "Monday, April 29, 2025")
73374 (0,external_wp_i18n_namespaceObject.__)("Today, %s"),
73375 formattedDate
73376 );
73377 }
73378 return label;
73379 },
73380 /** The label for the "next month" button. */
73381 labelNext: () => (0,external_wp_i18n_namespaceObject.__)("Go to the Next Month"),
73382 /** The label for the "previous month" button. */
73383 labelPrevious: () => (0,external_wp_i18n_namespaceObject.__)("Go to the Previous Month"),
73384 /**
73385 * The label for the day button.
73386 * @param date
73387 * @param modifiers
73388 */
73389 labelDayButton: (date, modifiers) => {
73390 const formattedDate = fullDateFormatter.format(date);
73391 let label = formattedDate;
73392 if (modifiers?.today) {
73393 label = (0,external_wp_i18n_namespaceObject.sprintf)(
73394 // translators: %s is the full date (e.g. "Monday, April 29, 2025")
73395 (0,external_wp_i18n_namespaceObject.__)("Today, %s"),
73396 formattedDate
73397 );
73398 }
73399 if (modifiers?.selected) {
73400 label = (0,external_wp_i18n_namespaceObject.sprintf)(
73401 // translators: %s is the full date (e.g. "Monday, April 29, 2025")
73402 (0,external_wp_i18n_namespaceObject.__)("%s, selected"),
73403 formattedDate
73404 );
73405 }
73406 return label;
73407 },
73408 /**
73409 * The label for the weekday.
73410 * @param date
73411 */
73412 labelWeekday: (date) => weekdayLongFormatter.format(date)
73413 },
73414 locale,
73415 dir: isLocaleRTL(locale.code) ? "rtl" : "ltr",
73416 formatters: {
73417 formatWeekdayName: (date) => {
73418 return weekdayNarrowFormatter.format(date);
73419 },
73420 formatCaption: (date) => {
73421 return monthNameFormatter.format(date);
73422 }
73423 },
73424 timeZone
73425 };
73426 }, [locale, timeZone, mode]);
73427};
73428
73429
73430;// ./node_modules/@wordpress/components/build-module/calendar/date-calendar/index.js
73431
73432
73433
73434
73435
73436
73437
73438
73439const DateCalendar = ({
73440 defaultSelected,
73441 selected: selectedProp,
73442 onSelect,
73443 numberOfMonths = 1,
73444 locale = en_US_enUS,
73445 timeZone,
73446 ...props
73447}) => {
73448 const localizationProps = useLocalizationProps({
73449 locale,
73450 timeZone,
73451 mode: "single"
73452 });
73453 const onChange = (0,external_wp_element_namespaceObject.useCallback)((selected2, triggerDate, modifiers, e) => {
73454 onSelect?.(selected2 !== null && selected2 !== void 0 ? selected2 : void 0, triggerDate, modifiers, e);
73455 }, [onSelect]);
73456 const [selected, setSelected] = useControlledValue({
73457 defaultValue: defaultSelected,
73458 value: selectedProp,
73459 onChange
73460 });
73461 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayPicker, {
73462 ...COMMON_PROPS,
73463 ...localizationProps,
73464 ...props,
73465 mode: "single",
73466 numberOfMonths: clampNumberOfMonths(numberOfMonths),
73467 selected: selected !== null && selected !== void 0 ? selected : void 0,
73468 onSelect: setSelected
73469 });
73470};
73471
73472
73473;// ./node_modules/@wordpress/components/build-module/calendar/date-range-calendar/index.js
73474
73475
73476
73477
73478
73479
73480
73481
73482
73483function usePreviewRange({
73484 selected,
73485 hoveredDate,
73486 excludeDisabled,
73487 min,
73488 max,
73489 disabled
73490}) {
73491 return (0,external_wp_element_namespaceObject.useMemo)(() => {
73492 if (!hoveredDate || !selected?.from) {
73493 return;
73494 }
73495 let previewHighlight;
73496 let potentialNewRange;
73497 if (hoveredDate < selected.from) {
73498 var _selected$to;
73499 previewHighlight = {
73500 from: hoveredDate,
73501 to: selected.from
73502 };
73503 potentialNewRange = {
73504 from: hoveredDate,
73505 to: (_selected$to = selected.to) !== null && _selected$to !== void 0 ? _selected$to : selected.from
73506 };
73507 } else if (selected.to && hoveredDate > selected.from && hoveredDate < selected.to) {
73508 previewHighlight = {
73509 from: selected.from,
73510 to: hoveredDate
73511 };
73512 potentialNewRange = {
73513 from: selected.from,
73514 to: hoveredDate
73515 };
73516 } else if (hoveredDate > selected.from) {
73517 var _selected$to2;
73518 previewHighlight = {
73519 from: (_selected$to2 = selected.to) !== null && _selected$to2 !== void 0 ? _selected$to2 : selected.from,
73520 to: hoveredDate
73521 };
73522 potentialNewRange = {
73523 from: selected.from,
73524 to: hoveredDate
73525 };
73526 }
73527 if (min !== void 0 && min > 0 && potentialNewRange && differenceInCalendarDays(potentialNewRange.to, potentialNewRange.from) < min) {
73528 previewHighlight = {
73529 from: hoveredDate,
73530 to: hoveredDate
73531 };
73532 }
73533 if (max !== void 0 && max > 0 && potentialNewRange && differenceInCalendarDays(potentialNewRange.to, potentialNewRange.from) > max) {
73534 previewHighlight = {
73535 from: hoveredDate,
73536 to: hoveredDate
73537 };
73538 }
73539 if (excludeDisabled && disabled && potentialNewRange && rangeContainsModifiers(potentialNewRange, disabled)) {
73540 previewHighlight = {
73541 from: hoveredDate,
73542 to: hoveredDate
73543 };
73544 }
73545 return previewHighlight;
73546 }, [selected, hoveredDate, excludeDisabled, min, max, disabled]);
73547}
73548const DateRangeCalendar = ({
73549 defaultSelected,
73550 selected: selectedProp,
73551 onSelect,
73552 numberOfMonths = 1,
73553 excludeDisabled,
73554 min,
73555 max,
73556 disabled,
73557 locale = en_US_enUS,
73558 timeZone,
73559 ...props
73560}) => {
73561 const localizationProps = useLocalizationProps({
73562 locale,
73563 timeZone,
73564 mode: "range"
73565 });
73566 const onChange = (0,external_wp_element_namespaceObject.useCallback)((selected2, triggerDate, modifiers2, e) => {
73567 onSelect?.(selected2 !== null && selected2 !== void 0 ? selected2 : void 0, triggerDate, modifiers2, e);
73568 }, [onSelect]);
73569 const [selected, setSelected] = useControlledValue({
73570 defaultValue: defaultSelected,
73571 value: selectedProp,
73572 onChange
73573 });
73574 const [hoveredDate, setHoveredDate] = (0,external_wp_element_namespaceObject.useState)(void 0);
73575 const previewRange = usePreviewRange({
73576 selected,
73577 hoveredDate,
73578 excludeDisabled,
73579 min,
73580 max,
73581 disabled
73582 });
73583 const modifiers = (0,external_wp_element_namespaceObject.useMemo)(() => {
73584 return {
73585 preview: previewRange,
73586 preview_start: previewRange?.from,
73587 preview_end: previewRange?.to
73588 };
73589 }, [previewRange]);
73590 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DayPicker, {
73591 ...COMMON_PROPS,
73592 ...localizationProps,
73593 ...props,
73594 mode: "range",
73595 numberOfMonths: clampNumberOfMonths(numberOfMonths),
73596 disabled,
73597 excludeDisabled,
73598 min,
73599 max,
73600 selected: selected !== null && selected !== void 0 ? selected : void 0,
73601 onSelect: setSelected,
73602 onDayMouseEnter: (date) => setHoveredDate(date),
73603 onDayMouseLeave: () => setHoveredDate(void 0),
73604 modifiers,
73605 modifiersClassNames: MODIFIER_CLASSNAMES
73606 });
73607};
73608
73609
73610;// ./node_modules/@wordpress/components/build-module/validated-form-controls/validity-indicator.js
73611
73612
73613
73614
73615
73616function ValidityIndicator({
73617 type,
73618 message
73619}) {
73620 const ICON = {
73621 valid: published_default,
73622 invalid: error_default
73623 };
73624 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
73625 className: dist_clsx("components-validated-control__indicator", `is-${type}`),
73626 children: [type === "validating" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(spinner_default, {
73627 className: "components-validated-control__indicator-spinner"
73628 }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(icon_icon_default, {
73629 className: "components-validated-control__indicator-icon",
73630 icon: ICON[type],
73631 size: 16,
73632 fill: "currentColor"
73633 }), message]
73634 });
73635}
73636
73637
73638;// ./node_modules/@wordpress/components/build-module/validated-form-controls/control-with-error.js
73639
73640
73641
73642
73643
73644
73645function appendRequiredIndicator(label, required, markWhenOptional) {
73646 if (required && !markWhenOptional) {
73647 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
73648 children: [label, " ", `(${(0,external_wp_i18n_namespaceObject.__)("Required")})`]
73649 });
73650 }
73651 if (!required && markWhenOptional) {
73652 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
73653 children: [label, " ", `(${(0,external_wp_i18n_namespaceObject.__)("Optional")})`]
73654 });
73655 }
73656 return label;
73657}
73658function UnforwardedControlWithError({
73659 required,
73660 markWhenOptional,
73661 onValidate,
73662 customValidity,
73663 getValidityTarget,
73664 children
73665}, forwardedRef) {
73666 const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)();
73667 const [statusMessage, setStatusMessage] = (0,external_wp_element_namespaceObject.useState)();
73668 const [isTouched, setIsTouched] = (0,external_wp_element_namespaceObject.useState)(false);
73669 const previousCustomValidityType = (0,external_wp_compose_namespaceObject.usePrevious)(customValidity?.type);
73670 (0,external_wp_element_namespaceObject.useEffect)(() => {
73671 const validityTarget = getValidityTarget();
73672 const showValidationMessage = () => setErrorMessage(validityTarget?.validationMessage);
73673 validityTarget?.addEventListener("invalid", showValidationMessage);
73674 return () => {
73675 validityTarget?.removeEventListener("invalid", showValidationMessage);
73676 };
73677 });
73678 (0,external_wp_element_namespaceObject.useEffect)(() => {
73679 if (!isTouched) {
73680 return;
73681 }
73682 const validityTarget = getValidityTarget();
73683 if (!customValidity?.type) {
73684 validityTarget?.setCustomValidity("");
73685 setErrorMessage(validityTarget?.validationMessage);
73686 setStatusMessage(void 0);
73687 return;
73688 }
73689 switch (customValidity.type) {
73690 case "validating": {
73691 const timer = setTimeout(() => {
73692 validityTarget?.setCustomValidity("");
73693 setErrorMessage(void 0);
73694 setStatusMessage({
73695 type: "validating",
73696 message: customValidity.message
73697 });
73698 }, 1e3);
73699 return () => clearTimeout(timer);
73700 }
73701 case "valid": {
73702 if (previousCustomValidityType === "valid") {
73703 break;
73704 }
73705 validityTarget?.setCustomValidity("");
73706 setErrorMessage(validityTarget?.validationMessage);
73707 setStatusMessage({
73708 type: "valid",
73709 message: customValidity.message
73710 });
73711 break;
73712 }
73713 case "invalid": {
73714 var _customValidity$messa;
73715 validityTarget?.setCustomValidity((_customValidity$messa = customValidity.message) !== null && _customValidity$messa !== void 0 ? _customValidity$messa : "");
73716 setErrorMessage(validityTarget?.validationMessage);
73717 setStatusMessage(void 0);
73718 break;
73719 }
73720 }
73721 }, [isTouched, customValidity?.type, customValidity?.message, getValidityTarget, previousCustomValidityType]);
73722 const onBlur = (event) => {
73723 if (isTouched) {
73724 return;
73725 }
73726 if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
73727 setIsTouched(true);
73728 onValidate?.();
73729 }
73730 };
73731 const onChange = (...args) => {
73732 children.props.onChange?.(...args);
73733 if (isTouched || errorMessage) {
73734 onValidate?.();
73735 }
73736 };
73737 const onKeyDown = (event) => {
73738 if (event.key === "Enter") {
73739 onValidate?.();
73740 }
73741 };
73742 return (
73743 // Disable reason: Just listening to a bubbled event, not for interaction.
73744 // eslint-disable-next-line jsx-a11y/no-static-element-interactions
73745 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
73746 className: "components-validated-control",
73747 ref: forwardedRef,
73748 onBlur,
73749 onKeyDown: withIgnoreIMEEvents(onKeyDown),
73750 children: [(0,external_wp_element_namespaceObject.cloneElement)(children, {
73751 label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
73752 onChange,
73753 required
73754 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
73755 "aria-live": "polite",
73756 children: [errorMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidityIndicator, {
73757 type: "invalid",
73758 message: errorMessage
73759 }), !errorMessage && statusMessage && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ValidityIndicator, {
73760 type: statusMessage.type,
73761 message: statusMessage.message
73762 })]
73763 })]
73764 })
73765 );
73766}
73767const ControlWithError = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedControlWithError);
73768
73769
73770;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/input-control.js
73771
73772
73773
73774
73775
73776const UnforwardedValidatedInputControl = ({
73777 required,
73778 onValidate,
73779 customValidity,
73780 onChange,
73781 markWhenOptional,
73782 ...restProps
73783}, forwardedRef) => {
73784 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73785 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73786 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
73787 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73788 required,
73789 markWhenOptional,
73790 onValidate: () => {
73791 return onValidate?.(valueRef.current);
73792 },
73793 customValidity,
73794 getValidityTarget: () => validityTargetRef.current,
73795 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(input_control_default, {
73796 __next40pxDefaultSize: true,
73797 ref: mergedRefs,
73798 onChange: (value, ...args) => {
73799 valueRef.current = value;
73800 onChange?.(value, ...args);
73801 },
73802 ...restProps
73803 })
73804 });
73805};
73806const ValidatedInputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedInputControl);
73807
73808
73809;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/checkbox-control.js
73810
73811
73812
73813
73814
73815const UnforwardedValidatedCheckboxControl = ({
73816 required,
73817 onValidate,
73818 customValidity,
73819 onChange,
73820 markWhenOptional,
73821 ...restProps
73822}, forwardedRef) => {
73823 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73824 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73825 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.checked);
73826 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73827 required,
73828 markWhenOptional,
73829 ref: mergedRefs,
73830 onValidate: () => {
73831 return onValidate?.(valueRef.current);
73832 },
73833 customValidity,
73834 getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="checkbox"]'),
73835 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(checkbox_control_default, {
73836 __nextHasNoMarginBottom: true,
73837 onChange: (value) => {
73838 valueRef.current = value;
73839 onChange?.(value);
73840 },
73841 ...restProps
73842 })
73843 });
73844};
73845const ValidatedCheckboxControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedCheckboxControl);
73846
73847
73848;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/number-control.js
73849
73850
73851
73852
73853
73854const UnforwardedValidatedNumberControl = ({
73855 required,
73856 onValidate,
73857 customValidity,
73858 onChange,
73859 markWhenOptional,
73860 ...restProps
73861}, forwardedRef) => {
73862 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73863 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73864 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
73865 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73866 required,
73867 markWhenOptional,
73868 onValidate: () => {
73869 return onValidate?.(valueRef.current);
73870 },
73871 customValidity,
73872 getValidityTarget: () => validityTargetRef.current,
73873 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(number_control_default, {
73874 __next40pxDefaultSize: true,
73875 ref: mergedRefs,
73876 onChange: (value, ...args) => {
73877 valueRef.current = value;
73878 onChange?.(value, ...args);
73879 },
73880 ...restProps
73881 })
73882 });
73883};
73884const ValidatedNumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedNumberControl);
73885
73886
73887;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/select-control.js
73888
73889
73890
73891
73892
73893const UnforwardedValidatedSelectControl = ({
73894 required,
73895 onValidate,
73896 customValidity,
73897 onChange,
73898 markWhenOptional,
73899 ...restProps
73900}, forwardedRef) => {
73901 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73902 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73903 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
73904 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73905 required,
73906 markWhenOptional,
73907 onValidate: () => {
73908 return onValidate?.(valueRef.current);
73909 },
73910 customValidity,
73911 getValidityTarget: () => validityTargetRef.current,
73912 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(select_control_default, {
73913 __nextHasNoMarginBottom: true,
73914 __next40pxDefaultSize: true,
73915 ref: mergedRefs,
73916 onChange: (value) => {
73917 valueRef.current = value;
73918 onChange?.(value);
73919 },
73920 ...restProps
73921 })
73922 });
73923};
73924const ValidatedSelectControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedSelectControl);
73925
73926
73927;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/radio-control.js
73928
73929
73930
73931
73932
73933const UnforwardedValidatedRadioControl = ({
73934 required,
73935 onValidate,
73936 customValidity,
73937 onChange,
73938 markWhenOptional,
73939 ...restProps
73940}, forwardedRef) => {
73941 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73942 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73943 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.selected);
73944 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73945 required,
73946 markWhenOptional,
73947 ref: mergedRefs,
73948 onValidate: () => {
73949 return onValidate?.(valueRef.current);
73950 },
73951 customValidity,
73952 getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="radio"]'),
73953 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(radio_control_default, {
73954 onChange: (value) => {
73955 valueRef.current = value;
73956 onChange?.(value);
73957 },
73958 ...restProps
73959 })
73960 });
73961};
73962const ValidatedRadioControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedRadioControl);
73963
73964
73965;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/text-control.js
73966
73967
73968
73969
73970
73971const UnforwardedValidatedTextControl = ({
73972 required,
73973 onValidate,
73974 customValidity,
73975 onChange,
73976 markWhenOptional,
73977 ...restProps
73978}, forwardedRef) => {
73979 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
73980 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
73981 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
73982 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
73983 required,
73984 markWhenOptional,
73985 onValidate: () => {
73986 return onValidate?.(valueRef.current);
73987 },
73988 customValidity,
73989 getValidityTarget: () => validityTargetRef.current,
73990 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(text_control_default, {
73991 __next40pxDefaultSize: true,
73992 __nextHasNoMarginBottom: true,
73993 ref: mergedRefs,
73994 onChange: (value) => {
73995 valueRef.current = value;
73996 onChange?.(value);
73997 },
73998 ...restProps
73999 })
74000 });
74001};
74002const ValidatedTextControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedTextControl);
74003
74004
74005;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/textarea-control.js
74006
74007
74008
74009
74010
74011const UnforwardedValidatedTextareaControl = ({
74012 required,
74013 onValidate,
74014 customValidity,
74015 onChange,
74016 markWhenOptional,
74017 ...restProps
74018}, forwardedRef) => {
74019 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
74020 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
74021 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
74022 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
74023 required,
74024 markWhenOptional,
74025 onValidate: () => {
74026 return onValidate?.(valueRef.current);
74027 },
74028 customValidity,
74029 getValidityTarget: () => validityTargetRef.current,
74030 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(textarea_control_default, {
74031 __nextHasNoMarginBottom: true,
74032 ref: mergedRefs,
74033 onChange: (value) => {
74034 valueRef.current = value;
74035 onChange?.(value);
74036 },
74037 ...restProps
74038 })
74039 });
74040};
74041const ValidatedTextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedTextareaControl);
74042
74043
74044;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/toggle-control.js
74045
74046
74047
74048
74049
74050const UnforwardedValidatedToggleControl = ({
74051 required,
74052 onValidate,
74053 customValidity,
74054 onChange,
74055 markWhenOptional,
74056 ...restProps
74057}, forwardedRef) => {
74058 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
74059 const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, validityTargetRef]);
74060 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.checked);
74061 (0,external_wp_element_namespaceObject.useEffect)(() => {
74062 if (validityTargetRef.current) {
74063 validityTargetRef.current.required = required !== null && required !== void 0 ? required : false;
74064 }
74065 }, [required]);
74066 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
74067 required,
74068 markWhenOptional,
74069 onValidate: () => {
74070 return onValidate?.(valueRef.current);
74071 },
74072 customValidity,
74073 getValidityTarget: () => validityTargetRef.current,
74074 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_control_default, {
74075 __nextHasNoMarginBottom: true,
74076 ref: mergedRefs,
74077 onChange: (value) => {
74078 valueRef.current = value;
74079 onChange?.(value);
74080 },
74081 ...restProps
74082 })
74083 });
74084};
74085const ValidatedToggleControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedToggleControl);
74086
74087
74088;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/toggle-group-control.js
74089
74090
74091
74092
74093const UnforwardedValidatedToggleGroupControl = ({
74094 required,
74095 onValidate,
74096 customValidity,
74097 onChange,
74098 markWhenOptional,
74099 ...restProps
74100}, forwardedRef) => {
74101 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
74102 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
74103 const nameAttr = (0,external_wp_element_namespaceObject.useId)();
74104 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
74105 className: "components-validated-control__wrapper-with-error-delegate",
74106 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
74107 required,
74108 markWhenOptional,
74109 onValidate: () => {
74110 return onValidate?.(valueRef.current);
74111 },
74112 customValidity,
74113 getValidityTarget: () => validityTargetRef.current,
74114 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_component_component_default, {
74115 __nextHasNoMarginBottom: true,
74116 __next40pxDefaultSize: true,
74117 ref: forwardedRef,
74118 onChange: (value) => {
74119 valueRef.current = value;
74120 onChange?.(value);
74121 },
74122 ...restProps
74123 })
74124 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
74125 className: "components-validated-control__error-delegate",
74126 type: "radio",
74127 ref: validityTargetRef,
74128 required,
74129 checked: restProps.value !== void 0,
74130 tabIndex: -1,
74131 name: nameAttr,
74132 onChange: () => {
74133 },
74134 onFocus: (e) => {
74135 e.target.previousElementSibling?.querySelector('[data-active-item="true"]')?.focus();
74136 }
74137 })]
74138 });
74139};
74140const ValidatedToggleGroupControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedToggleGroupControl);
74141
74142
74143;// ./node_modules/@wordpress/components/build-module/validated-form-controls/components/form-token-field.js
74144
74145
74146
74147
74148const UnforwardedValidatedFormTokenField = ({
74149 required,
74150 onValidate,
74151 customValidity,
74152 onChange,
74153 markWhenOptional,
74154 ...restProps
74155}, forwardedRef) => {
74156 const validityTargetRef = (0,external_wp_element_namespaceObject.useRef)(null);
74157 const valueRef = (0,external_wp_element_namespaceObject.useRef)(restProps.value);
74158 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
74159 className: "components-validated-control__wrapper-with-error-delegate",
74160 ref: forwardedRef,
74161 children: [/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlWithError, {
74162 required,
74163 markWhenOptional,
74164 onValidate: () => {
74165 return onValidate?.(valueRef.current);
74166 },
74167 customValidity,
74168 getValidityTarget: () => validityTargetRef.current,
74169 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FormTokenField, {
74170 __next40pxDefaultSize: true,
74171 __nextHasNoMarginBottom: true,
74172 ...restProps,
74173 onChange: (value, ...args) => {
74174 valueRef.current = value;
74175 onChange?.(value, ...args);
74176 }
74177 })
74178 }), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
74179 className: "components-validated-control__error-delegate",
74180 type: "text",
74181 ref: validityTargetRef,
74182 required,
74183 value: valueRef.current && valueRef.current.length > 0 ? "hasvalue" : "",
74184 tabIndex: -1,
74185 onChange: () => {
74186 },
74187 onFocus: (e) => {
74188 e.target.previousElementSibling?.querySelector('input[type="text"]')?.focus();
74189 }
74190 })]
74191 });
74192};
74193const ValidatedFormTokenField = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedValidatedFormTokenField);
74194
74195
74196;// ./node_modules/@wordpress/components/build-module/private-apis.js
74197
74198
74199
74200
74201
74202
74203
74204
74205
74206
74207
74208
74209
74210const privateApis = {};
74211lock(privateApis, {
74212 __experimentalPopoverLegacyPositionToPlacement: positionToPlacement,
74213 ComponentsContext: ComponentsContext,
74214 Tabs: Tabs,
74215 Theme: theme_default,
74216 Menu: menu_Menu,
74217 kebabCase: kebabCase,
74218 withIgnoreIMEEvents: withIgnoreIMEEvents,
74219 Badge: badge_default,
74220 normalizeTextString: normalizeTextString,
74221 DateCalendar: DateCalendar,
74222 DateRangeCalendar: DateRangeCalendar,
74223 TZDate: date_TZDate,
74224 Picker: Picker,
74225 ValidatedInputControl: ValidatedInputControl,
74226 ValidatedCheckboxControl: ValidatedCheckboxControl,
74227 ValidatedNumberControl: ValidatedNumberControl,
74228 ValidatedSelectControl: ValidatedSelectControl,
74229 ValidatedRadioControl: ValidatedRadioControl,
74230 ValidatedTextControl: ValidatedTextControl,
74231 ValidatedTextareaControl: ValidatedTextareaControl,
74232 ValidatedToggleControl: ValidatedToggleControl,
74233 ValidatedToggleGroupControl: ValidatedToggleGroupControl,
74234 ValidatedFormTokenField: ValidatedFormTokenField
74235});
74236
74237
74238;// ./node_modules/@wordpress/components/build-module/index.js
74239
74240
74241
74242
74243
74244
74245
74246
74247
74248
74249
74250
74251
74252
74253
74254
74255
74256
74257
74258
74259
74260
74261
74262
74263
74264
74265
74266
74267
74268
74269
74270
74271
74272
74273
74274
74275
74276
74277
74278
74279
74280
74281
74282
74283
74284
74285
74286
74287
74288
74289
74290
74291
74292
74293
74294
74295
74296
74297
74298
74299
74300
74301
74302
74303
74304
74305
74306
74307
74308
74309
74310
74311
74312
74313
74314
74315
74316
74317
74318
74319
74320
74321
74322
74323
74324
74325
74326
74327
74328
74329
74330
74331
74332
74333
74334
74335
74336
74337
74338
74339
74340
74341
74342
74343
74344
74345
74346
74347
74348
74349
74350
74351
74352
74353
74354
74355
74356
74357
74358
74359
74360
74361
74362
74363
74364
74365
74366
74367
74368
74369
74370
74371})();
74372
74373(window.wp = window.wp || {}).components = __webpack_exports__;
74374/******/ })()
74375;