[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({}); 4 /************************************************************************/ 5 /******/ // The module cache 6 /******/ var __webpack_module_cache__ = {}; 7 /******/ 8 /******/ // The require function 9 /******/ function __webpack_require__(moduleId) { 10 /******/ // Check if module is in cache 11 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 12 /******/ if (cachedModule !== undefined) { 13 /******/ return cachedModule.exports; 14 /******/ } 15 /******/ // Create a new module (and put it into the cache) 16 /******/ var module = __webpack_module_cache__[moduleId] = { 17 /******/ // no module.id needed 18 /******/ // no module.loaded needed 19 /******/ exports: {} 20 /******/ }; 21 /******/ 22 /******/ // Execute the module function 23 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 24 /******/ 25 /******/ // Return the exports of the module 26 /******/ return module.exports; 27 /******/ } 28 /******/ 29 /************************************************************************/ 30 /******/ /* webpack/runtime/create fake namespace object */ 31 /******/ (() => { 32 /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); 33 /******/ var leafPrototypes; 34 /******/ // create a fake namespace object 35 /******/ // mode & 1: value is a module id, require it 36 /******/ // mode & 2: merge all properties of value into the ns 37 /******/ // mode & 4: return value when already ns object 38 /******/ // mode & 16: return value when it's Promise-like 39 /******/ // mode & 8|1: behave like require 40 /******/ __webpack_require__.t = function(value, mode) { 41 /******/ if(mode & 1) value = this(value); 42 /******/ if(mode & 8) return value; 43 /******/ if(typeof value === 'object' && value) { 44 /******/ if((mode & 4) && value.__esModule) return value; 45 /******/ if((mode & 16) && typeof value.then === 'function') return value; 46 /******/ } 47 /******/ var ns = Object.create(null); 48 /******/ __webpack_require__.r(ns); 49 /******/ var def = {}; 50 /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; 51 /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { 52 /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); 53 /******/ } 54 /******/ def['default'] = () => (value); 55 /******/ __webpack_require__.d(ns, def); 56 /******/ return ns; 57 /******/ }; 58 /******/ })(); 59 /******/ 60 /******/ /* webpack/runtime/define property getters */ 61 /******/ (() => { 62 /******/ // define getter functions for harmony exports 63 /******/ __webpack_require__.d = (exports, definition) => { 64 /******/ for(var key in definition) { 65 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 66 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 67 /******/ } 68 /******/ } 69 /******/ }; 70 /******/ })(); 71 /******/ 72 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 73 /******/ (() => { 74 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 75 /******/ })(); 76 /******/ 77 /******/ /* webpack/runtime/make namespace object */ 78 /******/ (() => { 79 /******/ // define __esModule on exports 80 /******/ __webpack_require__.r = (exports) => { 81 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 82 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 83 /******/ } 84 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 85 /******/ }; 86 /******/ })(); 87 /******/ 88 /******/ /* webpack/runtime/nonce */ 89 /******/ (() => { 90 /******/ __webpack_require__.nc = undefined; 91 /******/ })(); 92 /******/ 93 /************************************************************************/ 94 var __webpack_exports__ = {}; 95 // ESM COMPAT FLAG 96 __webpack_require__.r(__webpack_exports__); 97 98 // EXPORTS 99 __webpack_require__.d(__webpack_exports__, { 100 CommandMenu: () => (/* reexport */ CommandMenu), 101 privateApis: () => (/* reexport */ privateApis), 102 store: () => (/* reexport */ store), 103 useCommand: () => (/* reexport */ useCommand), 104 useCommandLoader: () => (/* reexport */ useCommandLoader) 105 }); 106 107 // NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/actions.js 108 var actions_namespaceObject = {}; 109 __webpack_require__.r(actions_namespaceObject); 110 __webpack_require__.d(actions_namespaceObject, { 111 close: () => (actions_close), 112 open: () => (actions_open), 113 registerCommand: () => (registerCommand), 114 registerCommandLoader: () => (registerCommandLoader), 115 unregisterCommand: () => (unregisterCommand), 116 unregisterCommandLoader: () => (unregisterCommandLoader) 117 }); 118 119 // NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/selectors.js 120 var selectors_namespaceObject = {}; 121 __webpack_require__.r(selectors_namespaceObject); 122 __webpack_require__.d(selectors_namespaceObject, { 123 getCommandLoaders: () => (getCommandLoaders), 124 getCommands: () => (getCommands), 125 getContext: () => (getContext), 126 isOpen: () => (selectors_isOpen) 127 }); 128 129 // NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/private-actions.js 130 var private_actions_namespaceObject = {}; 131 __webpack_require__.r(private_actions_namespaceObject); 132 __webpack_require__.d(private_actions_namespaceObject, { 133 setContext: () => (setContext) 134 }); 135 136 ;// ./node_modules/cmdk/dist/chunk-NZJY6EH4.mjs 137 var U=1,Y=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k=.99,m=/[\\\/_+.#"@\[\(\{&]/,B=/[\\\/_+.#"@\[\(\{&]/g,K=/[\s-]/,X=/[\s-]/g;function G(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k;var T=`$A},$f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B),R&&A>0&&(E*=Math.pow(u,R.length))):K.test(_.charAt(c-1))?(E*=Y,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X," ")}function W(_,C,h){return _=h&&h.length>0?`$_+" "+h.join(" ")}`:_,G(_,C,D(_),D(C),0,0,{})} 138 139 ;// ./node_modules/@babel/runtime/helpers/esm/extends.js 140 function _extends() { 141 return _extends = Object.assign ? Object.assign.bind() : function (n) { 142 for (var e = 1; e < arguments.length; e++) { 143 var t = arguments[e]; 144 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); 145 } 146 return n; 147 }, _extends.apply(null, arguments); 148 } 149 150 ;// external "React" 151 const external_React_namespaceObject = window["React"]; 152 var external_React_namespaceObject_0 = /*#__PURE__*/__webpack_require__.t(external_React_namespaceObject, 2); 153 ;// ./node_modules/@radix-ui/primitive/dist/index.mjs 154 function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) { 155 return function handleEvent(event) { 156 originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event); 157 if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); 158 }; 159 } 160 161 162 163 164 165 ;// ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs 166 167 168 169 /** 170 * Set a given ref to a given value 171 * This utility takes care of different types of refs: callback refs and RefObject(s) 172 */ function $6ed0406888f73fc4$var$setRef(ref, value) { 173 if (typeof ref === 'function') ref(value); 174 else if (ref !== null && ref !== undefined) ref.current = value; 175 } 176 /** 177 * A utility to compose multiple refs together 178 * Accepts callback refs and RefObject(s) 179 */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) { 180 return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node) 181 ) 182 ; 183 } 184 /** 185 * A custom hook that composes multiple refs 186 * Accepts callback refs and RefObject(s) 187 */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) { 188 // eslint-disable-next-line react-hooks/exhaustive-deps 189 return (0,external_React_namespaceObject.useCallback)($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs); 190 } 191 192 193 194 195 196 ;// ./node_modules/@radix-ui/react-context/dist/index.mjs 197 198 199 200 function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { 201 const Context = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext); 202 function Provider(props) { 203 const { children: children , ...context } = props; // Only re-memoize when prop values change 204 // eslint-disable-next-line react-hooks/exhaustive-deps 205 const value = (0,external_React_namespaceObject.useMemo)(()=>context 206 , Object.values(context)); 207 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Context.Provider, { 208 value: value 209 }, children); 210 } 211 function useContext(consumerName) { 212 const context = (0,external_React_namespaceObject.useContext)(Context); 213 if (context) return context; 214 if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. 215 throw new Error(`\`$consumerName}\` must be used within \`$rootComponentName}\``); 216 } 217 Provider.displayName = rootComponentName + 'Provider'; 218 return [ 219 Provider, 220 useContext 221 ]; 222 } 223 /* ------------------------------------------------------------------------------------------------- 224 * createContextScope 225 * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) { 226 let defaultContexts = []; 227 /* ----------------------------------------------------------------------------------------------- 228 * createContext 229 * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { 230 const BaseContext = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext); 231 const index = defaultContexts.length; 232 defaultContexts = [ 233 ...defaultContexts, 234 defaultContext 235 ]; 236 function Provider(props) { 237 const { scope: scope , children: children , ...context } = props; 238 const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change 239 // eslint-disable-next-line react-hooks/exhaustive-deps 240 const value = (0,external_React_namespaceObject.useMemo)(()=>context 241 , Object.values(context)); 242 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Context.Provider, { 243 value: value 244 }, children); 245 } 246 function useContext(consumerName, scope) { 247 const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; 248 const context = (0,external_React_namespaceObject.useContext)(Context); 249 if (context) return context; 250 if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. 251 throw new Error(`\`$consumerName}\` must be used within \`$rootComponentName}\``); 252 } 253 Provider.displayName = rootComponentName + 'Provider'; 254 return [ 255 Provider, 256 useContext 257 ]; 258 } 259 /* ----------------------------------------------------------------------------------------------- 260 * createScope 261 * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{ 262 const scopeContexts = defaultContexts.map((defaultContext)=>{ 263 return /*#__PURE__*/ (0,external_React_namespaceObject.createContext)(defaultContext); 264 }); 265 return function useScope(scope) { 266 const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; 267 return (0,external_React_namespaceObject.useMemo)(()=>({ 268 [`__scope$scopeName}`]: { 269 ...scope, 270 [scopeName]: contexts 271 } 272 }) 273 , [ 274 scope, 275 contexts 276 ]); 277 }; 278 }; 279 createScope.scopeName = scopeName; 280 return [ 281 $c512c27ab02ef895$export$fd42f52fd3ae1109, 282 $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps) 283 ]; 284 } 285 /* ------------------------------------------------------------------------------------------------- 286 * composeContextScopes 287 * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) { 288 const baseScope = scopes[0]; 289 if (scopes.length === 1) return baseScope; 290 const createScope1 = ()=>{ 291 const scopeHooks = scopes.map((createScope)=>({ 292 useScope: createScope(), 293 scopeName: createScope.scopeName 294 }) 295 ); 296 return function useComposedScopes(overrideScopes) { 297 const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{ 298 // We are calling a hook inside a callback which React warns against to avoid inconsistent 299 // renders, however, scoping doesn't have render side effects so we ignore the rule. 300 // eslint-disable-next-line react-hooks/rules-of-hooks 301 const scopeProps = useScope(overrideScopes); 302 const currentScope = scopeProps[`__scope$scopeName}`]; 303 return { 304 ...nextScopes, 305 ...currentScope 306 }; 307 }, {}); 308 return (0,external_React_namespaceObject.useMemo)(()=>({ 309 [`__scope$baseScope.scopeName}`]: nextScopes1 310 }) 311 , [ 312 nextScopes1 313 ]); 314 }; 315 }; 316 createScope1.scopeName = baseScope.scopeName; 317 return createScope1; 318 } 319 320 321 322 323 324 ;// ./node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs 325 326 327 328 /** 329 * On the server, React emits a warning when calling `useLayoutEffect`. 330 * This is because neither `useLayoutEffect` nor `useEffect` run on the server. 331 * We use this safe version which suppresses the warning by replacing it with a noop on the server. 332 * 333 * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect 334 */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? external_React_namespaceObject.useLayoutEffect : ()=>{}; 335 336 337 338 339 340 ;// ./node_modules/@radix-ui/react-id/dist/index.mjs 341 342 343 344 345 346 const $1746a345f3d73bb7$var$useReactId = external_React_namespaceObject_0['useId'.toString()] || (()=>undefined 347 ); 348 let $1746a345f3d73bb7$var$count = 0; 349 function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) { 350 const [id, setId] = external_React_namespaceObject.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only. 351 $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ 352 if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++) 353 ); 354 }, [ 355 deterministicId 356 ]); 357 return deterministicId || (id ? `radix-$id}` : ''); 358 } 359 360 361 362 363 364 ;// ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs 365 366 367 368 /** 369 * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a 370 * prop or avoid re-executing effects when passed as a dependency 371 */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) { 372 const callbackRef = (0,external_React_namespaceObject.useRef)(callback); 373 (0,external_React_namespaceObject.useEffect)(()=>{ 374 callbackRef.current = callback; 375 }); // https://github.com/facebook/react/issues/19240 376 return (0,external_React_namespaceObject.useMemo)(()=>(...args)=>{ 377 var _callbackRef$current; 378 return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args); 379 } 380 , []); 381 } 382 383 384 385 386 387 ;// ./node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs 388 389 390 391 392 393 function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) { 394 const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({ 395 defaultProp: defaultProp, 396 onChange: onChange 397 }); 398 const isControlled = prop !== undefined; 399 const value1 = isControlled ? prop : uncontrolledProp; 400 const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange); 401 const setValue = (0,external_React_namespaceObject.useCallback)((nextValue)=>{ 402 if (isControlled) { 403 const setter = nextValue; 404 const value = typeof nextValue === 'function' ? setter(prop) : nextValue; 405 if (value !== prop) handleChange(value); 406 } else setUncontrolledProp(nextValue); 407 }, [ 408 isControlled, 409 prop, 410 setUncontrolledProp, 411 handleChange 412 ]); 413 return [ 414 value1, 415 setValue 416 ]; 417 } 418 function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) { 419 const uncontrolledState = (0,external_React_namespaceObject.useState)(defaultProp); 420 const [value] = uncontrolledState; 421 const prevValueRef = (0,external_React_namespaceObject.useRef)(value); 422 const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange); 423 (0,external_React_namespaceObject.useEffect)(()=>{ 424 if (prevValueRef.current !== value) { 425 handleChange(value); 426 prevValueRef.current = value; 427 } 428 }, [ 429 value, 430 prevValueRef, 431 handleChange 432 ]); 433 return uncontrolledState; 434 } 435 436 437 438 439 440 ;// external "ReactDOM" 441 const external_ReactDOM_namespaceObject = window["ReactDOM"]; 442 ;// ./node_modules/@radix-ui/react-slot/dist/index.mjs 443 444 445 446 447 448 449 450 /* ------------------------------------------------------------------------------------------------- 451 * Slot 452 * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 453 const { children: children , ...slotProps } = props; 454 const childrenArray = external_React_namespaceObject.Children.toArray(children); 455 const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable); 456 if (slottable) { 457 // the new element to render is the one passed as a child of `Slottable` 458 const newElement = slottable.props.children; 459 const newChildren = childrenArray.map((child)=>{ 460 if (child === slottable) { 461 // because the new element will be the one rendered, we are only interested 462 // in grabbing its children (`newElement.props.children`) 463 if (external_React_namespaceObject.Children.count(newElement) > 1) return external_React_namespaceObject.Children.only(null); 464 return /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(newElement) ? newElement.props.children : null; 465 } else return child; 466 }); 467 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, { 468 ref: forwardedRef 469 }), /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(newElement) ? /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(newElement, undefined, newChildren) : null); 470 } 471 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, { 472 ref: forwardedRef 473 }), children); 474 }); 475 $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot'; 476 /* ------------------------------------------------------------------------------------------------- 477 * SlotClone 478 * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 479 const { children: children , ...slotProps } = props; 480 if (/*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(children)) return /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(children, { 481 ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props), 482 ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref 483 }); 484 return external_React_namespaceObject.Children.count(children) > 1 ? external_React_namespaceObject.Children.only(null) : null; 485 }); 486 $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone'; 487 /* ------------------------------------------------------------------------------------------------- 488 * Slottable 489 * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{ 490 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, children); 491 }; 492 /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) { 493 return /*#__PURE__*/ (0,external_React_namespaceObject.isValidElement)(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45; 494 } 495 function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) { 496 // all child props should override 497 const overrideProps = { 498 ...childProps 499 }; 500 for(const propName in childProps){ 501 const slotPropValue = slotProps[propName]; 502 const childPropValue = childProps[propName]; 503 const isHandler = /^on[A-Z]/.test(propName); 504 if (isHandler) { 505 // if the handler exists on both, we compose them 506 if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{ 507 childPropValue(...args); 508 slotPropValue(...args); 509 }; 510 else if (slotPropValue) overrideProps[propName] = slotPropValue; 511 } else if (propName === 'style') overrideProps[propName] = { 512 ...slotPropValue, 513 ...childPropValue 514 }; 515 else if (propName === 'className') overrideProps[propName] = [ 516 slotPropValue, 517 childPropValue 518 ].filter(Boolean).join(' '); 519 } 520 return { 521 ...slotProps, 522 ...overrideProps 523 }; 524 } 525 const $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5e63c961fc1ce211$export$8c6ed5c666ac1360)); 526 527 528 529 530 531 ;// ./node_modules/@radix-ui/react-primitive/dist/index.mjs 532 533 534 535 536 537 538 539 540 541 const $8927f6f2acc4f386$var$NODES = [ 542 'a', 543 'button', 544 'div', 545 'form', 546 'h2', 547 'h3', 548 'img', 549 'input', 550 'label', 551 'li', 552 'nav', 553 'ol', 554 'p', 555 'span', 556 'svg', 557 'ul' 558 ]; // Temporary while we await merge of this fix: 559 // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396 560 // prettier-ignore 561 /* ------------------------------------------------------------------------------------------------- 562 * Primitive 563 * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{ 564 const Node = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 565 const { asChild: asChild , ...primitiveProps } = props; 566 const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node; 567 (0,external_React_namespaceObject.useEffect)(()=>{ 568 window[Symbol.for('radix-ui')] = true; 569 }, []); 570 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(Comp, _extends({}, primitiveProps, { 571 ref: forwardedRef 572 })); 573 }); 574 Node.displayName = `Primitive.$node}`; 575 return { 576 ...primitive, 577 [node]: Node 578 }; 579 }, {}); 580 /* ------------------------------------------------------------------------------------------------- 581 * Utils 582 * -----------------------------------------------------------------------------------------------*/ /** 583 * Flush custom event dispatch 584 * https://github.com/radix-ui/primitives/pull/1378 585 * 586 * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. 587 * 588 * Internally, React prioritises events in the following order: 589 * - discrete 590 * - continuous 591 * - default 592 * 593 * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 594 * 595 * `discrete` is an important distinction as updates within these events are applied immediately. 596 * React however, is not able to infer the priority of custom event types due to how they are detected internally. 597 * Because of this, it's possible for updates from custom events to be unexpectedly batched when 598 * dispatched by another `discrete` event. 599 * 600 * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. 601 * This utility should be used when dispatching a custom event from within another `discrete` event, this utility 602 * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. 603 * For example: 604 * 605 * dispatching a known click 👎 606 * target.dispatchEvent(new Event(‘click’)) 607 * 608 * dispatching a custom type within a non-discrete event 👎 609 * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} 610 * 611 * dispatching a custom type within a `discrete` event 👍 612 * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} 613 * 614 * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use 615 * this utility with them. This is because it's possible for those handlers to be called implicitly during render 616 * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. 617 */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) { 618 if (target) (0,external_ReactDOM_namespaceObject.flushSync)(()=>target.dispatchEvent(event) 619 ); 620 } 621 /* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($8927f6f2acc4f386$export$250ffa63cdc0d034)); 622 623 624 625 626 627 ;// ./node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs 628 629 630 631 632 633 /** 634 * Listens for when the escape key is down 635 */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { 636 const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp); 637 (0,external_React_namespaceObject.useEffect)(()=>{ 638 const handleKeyDown = (event)=>{ 639 if (event.key === 'Escape') onEscapeKeyDown(event); 640 }; 641 ownerDocument.addEventListener('keydown', handleKeyDown); 642 return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown) 643 ; 644 }, [ 645 onEscapeKeyDown, 646 ownerDocument 647 ]); 648 } 649 650 651 652 653 654 ;// ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 /* ------------------------------------------------------------------------------------------------- 671 * DismissableLayer 672 * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer'; 673 const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update'; 674 const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside'; 675 const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside'; 676 let $5cb92bef7577960e$var$originalBodyPointerEvents; 677 const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ (0,external_React_namespaceObject.createContext)({ 678 layers: new Set(), 679 layersWithOutsidePointerEventsDisabled: new Set(), 680 branches: new Set() 681 }); 682 const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 683 var _node$ownerDocument; 684 const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props; 685 const context = (0,external_React_namespaceObject.useContext)($5cb92bef7577960e$var$DismissableLayerContext); 686 const [node1, setNode] = (0,external_React_namespaceObject.useState)(null); 687 const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; 688 const [, force] = (0,external_React_namespaceObject.useState)({}); 689 const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node) 690 ); 691 const layers = Array.from(context.layers); 692 const [highestLayerWithOutsidePointerEventsDisabled] = [ 693 ...context.layersWithOutsidePointerEventsDisabled 694 ].slice(-1); // prettier-ignore 695 const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore 696 const index = node1 ? layers.indexOf(node1) : -1; 697 const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; 698 const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; 699 const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{ 700 const target = event.target; 701 const isPointerDownOnBranch = [ 702 ...context.branches 703 ].some((branch)=>branch.contains(target) 704 ); 705 if (!isPointerEventsEnabled || isPointerDownOnBranch) return; 706 onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event); 707 onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); 708 if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); 709 }, ownerDocument); 710 const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{ 711 const target = event.target; 712 const isFocusInBranch = [ 713 ...context.branches 714 ].some((branch)=>branch.contains(target) 715 ); 716 if (isFocusInBranch) return; 717 onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event); 718 onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); 719 if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); 720 }, ownerDocument); 721 $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{ 722 const isHighestLayer = index === context.layers.size - 1; 723 if (!isHighestLayer) return; 724 onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event); 725 if (!event.defaultPrevented && onDismiss) { 726 event.preventDefault(); 727 onDismiss(); 728 } 729 }, ownerDocument); 730 (0,external_React_namespaceObject.useEffect)(()=>{ 731 if (!node1) return; 732 if (disableOutsidePointerEvents) { 733 if (context.layersWithOutsidePointerEventsDisabled.size === 0) { 734 $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; 735 ownerDocument.body.style.pointerEvents = 'none'; 736 } 737 context.layersWithOutsidePointerEventsDisabled.add(node1); 738 } 739 context.layers.add(node1); 740 $5cb92bef7577960e$var$dispatchUpdate(); 741 return ()=>{ 742 if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents; 743 }; 744 }, [ 745 node1, 746 ownerDocument, 747 disableOutsidePointerEvents, 748 context 749 ]); 750 /** 751 * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect 752 * because a change to `disableOutsidePointerEvents` would remove this layer from the stack 753 * and add it to the end again so the layering order wouldn't be _creation order_. 754 * We only want them to be removed from context stacks when unmounted. 755 */ (0,external_React_namespaceObject.useEffect)(()=>{ 756 return ()=>{ 757 if (!node1) return; 758 context.layers.delete(node1); 759 context.layersWithOutsidePointerEventsDisabled.delete(node1); 760 $5cb92bef7577960e$var$dispatchUpdate(); 761 }; 762 }, [ 763 node1, 764 context 765 ]); 766 (0,external_React_namespaceObject.useEffect)(()=>{ 767 const handleUpdate = ()=>force({}) 768 ; 769 document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate); 770 return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate) 771 ; 772 }, []); 773 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, { 774 ref: composedRefs, 775 style: { 776 pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined, 777 ...props.style 778 }, 779 onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture), 780 onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture), 781 onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture) 782 })); 783 }); 784 /*#__PURE__*/ Object.assign($5cb92bef7577960e$export$177fb62ff3ec1f22, { 785 displayName: $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME 786 }); 787 /* ------------------------------------------------------------------------------------------------- 788 * DismissableLayerBranch 789 * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$BRANCH_NAME = 'DismissableLayerBranch'; 790 const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 791 const context = (0,external_React_namespaceObject.useContext)($5cb92bef7577960e$var$DismissableLayerContext); 792 const ref = (0,external_React_namespaceObject.useRef)(null); 793 const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); 794 (0,external_React_namespaceObject.useEffect)(()=>{ 795 const node = ref.current; 796 if (node) { 797 context.branches.add(node); 798 return ()=>{ 799 context.branches.delete(node); 800 }; 801 } 802 }, [ 803 context.branches 804 ]); 805 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, props, { 806 ref: composedRefs 807 })); 808 }); 809 /*#__PURE__*/ Object.assign($5cb92bef7577960e$export$4d5eb2109db14228, { 810 displayName: $5cb92bef7577960e$var$BRANCH_NAME 811 }); 812 /* -----------------------------------------------------------------------------------------------*/ /** 813 * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup` 814 * to mimic layer dismissing behaviour present in OS. 815 * Returns props to pass to the node we want to check for outside events. 816 */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { 817 const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside); 818 const isPointerInsideReactTreeRef = (0,external_React_namespaceObject.useRef)(false); 819 const handleClickRef = (0,external_React_namespaceObject.useRef)(()=>{}); 820 (0,external_React_namespaceObject.useEffect)(()=>{ 821 const handlePointerDown = (event)=>{ 822 if (event.target && !isPointerInsideReactTreeRef.current) { 823 const eventDetail = { 824 originalEvent: event 825 }; 826 function handleAndDispatchPointerDownOutsideEvent() { 827 $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { 828 discrete: true 829 }); 830 } 831 /** 832 * On touch devices, we need to wait for a click event because browsers implement 833 * a ~350ms delay between the time the user stops touching the display and when the 834 * browser executres events. We need to ensure we don't reactivate pointer-events within 835 * this timeframe otherwise the browser may execute events that should have been prevented. 836 * 837 * Additionally, this also lets us deal automatically with cancellations when a click event 838 * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc. 839 * 840 * This is why we also continuously remove the previous listener, because we cannot be 841 * certain that it was raised, and therefore cleaned-up. 842 */ if (event.pointerType === 'touch') { 843 ownerDocument.removeEventListener('click', handleClickRef.current); 844 handleClickRef.current = handleAndDispatchPointerDownOutsideEvent; 845 ownerDocument.addEventListener('click', handleClickRef.current, { 846 once: true 847 }); 848 } else handleAndDispatchPointerDownOutsideEvent(); 849 } else // We need to remove the event listener in case the outside click has been canceled. 850 // See: https://github.com/radix-ui/primitives/issues/2171 851 ownerDocument.removeEventListener('click', handleClickRef.current); 852 isPointerInsideReactTreeRef.current = false; 853 }; 854 /** 855 * if this hook executes in a component that mounts via a `pointerdown` event, the event 856 * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid 857 * this by delaying the event listener registration on the document. 858 * This is not React specific, but rather how the DOM works, ie: 859 * ``` 860 * button.addEventListener('pointerdown', () => { 861 * console.log('I will log'); 862 * document.addEventListener('pointerdown', () => { 863 * console.log('I will also log'); 864 * }) 865 * }); 866 */ const timerId = window.setTimeout(()=>{ 867 ownerDocument.addEventListener('pointerdown', handlePointerDown); 868 }, 0); 869 return ()=>{ 870 window.clearTimeout(timerId); 871 ownerDocument.removeEventListener('pointerdown', handlePointerDown); 872 ownerDocument.removeEventListener('click', handleClickRef.current); 873 }; 874 }, [ 875 ownerDocument, 876 handlePointerDownOutside 877 ]); 878 return { 879 // ensures we check React component tree (not just DOM tree) 880 onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true 881 }; 882 } 883 /** 884 * Listens for when focus happens outside a react subtree. 885 * Returns props to pass to the root (node) of the subtree we want to check. 886 */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { 887 const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside); 888 const isFocusInsideReactTreeRef = (0,external_React_namespaceObject.useRef)(false); 889 (0,external_React_namespaceObject.useEffect)(()=>{ 890 const handleFocus = (event)=>{ 891 if (event.target && !isFocusInsideReactTreeRef.current) { 892 const eventDetail = { 893 originalEvent: event 894 }; 895 $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { 896 discrete: false 897 }); 898 } 899 }; 900 ownerDocument.addEventListener('focusin', handleFocus); 901 return ()=>ownerDocument.removeEventListener('focusin', handleFocus) 902 ; 903 }, [ 904 ownerDocument, 905 handleFocusOutside 906 ]); 907 return { 908 onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true 909 , 910 onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false 911 }; 912 } 913 function $5cb92bef7577960e$var$dispatchUpdate() { 914 const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE); 915 document.dispatchEvent(event); 916 } 917 function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) { 918 const target = detail.originalEvent.target; 919 const event = new CustomEvent(name, { 920 bubbles: false, 921 cancelable: true, 922 detail: detail 923 }); 924 if (handler) target.addEventListener(name, handler, { 925 once: true 926 }); 927 if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event); 928 else target.dispatchEvent(event); 929 } 930 const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$177fb62ff3ec1f22)); 931 const $5cb92bef7577960e$export$aecb2ddcb55c95be = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$4d5eb2109db14228)); 932 933 934 935 936 937 ;// ./node_modules/@radix-ui/react-focus-scope/dist/index.mjs 938 939 940 941 942 943 944 945 946 947 948 949 const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount'; 950 const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount'; 951 const $d3863c46a17e8a28$var$EVENT_OPTIONS = { 952 bubbles: false, 953 cancelable: true 954 }; 955 /* ------------------------------------------------------------------------------------------------- 956 * FocusScope 957 * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME = 'FocusScope'; 958 const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 959 const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props; 960 const [container1, setContainer] = (0,external_React_namespaceObject.useState)(null); 961 const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp); 962 const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp); 963 const lastFocusedElementRef = (0,external_React_namespaceObject.useRef)(null); 964 const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node) 965 ); 966 const focusScope = (0,external_React_namespaceObject.useRef)({ 967 paused: false, 968 pause () { 969 this.paused = true; 970 }, 971 resume () { 972 this.paused = false; 973 } 974 }).current; // Takes care of trapping focus if focus is moved outside programmatically for example 975 (0,external_React_namespaceObject.useEffect)(()=>{ 976 if (trapped) { 977 function handleFocusIn(event) { 978 if (focusScope.paused || !container1) return; 979 const target = event.target; 980 if (container1.contains(target)) lastFocusedElementRef.current = target; 981 else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, { 982 select: true 983 }); 984 } 985 function handleFocusOut(event) { 986 if (focusScope.paused || !container1) return; 987 const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases: 988 // 989 // 1. When the user switches app/tabs/windows/the browser itself loses focus. 990 // 2. In Google Chrome, when the focused element is removed from the DOM. 991 // 992 // We let the browser do its thing here because: 993 // 994 // 1. The browser already keeps a memory of what's focused for when the page gets refocused. 995 // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it 996 // throws the CPU to 100%, so we avoid doing anything for this reason here too. 997 if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`) 998 // that is outside the container, we move focus to the last valid focused element inside. 999 if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, { 1000 select: true 1001 }); 1002 } // When the focused element gets removed from the DOM, browsers move focus 1003 // back to the document.body. In this case, we move focus to the container 1004 // to keep focus trapped correctly. 1005 function handleMutations(mutations) { 1006 const focusedElement = document.activeElement; 1007 if (focusedElement !== document.body) return; 1008 for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1); 1009 } 1010 document.addEventListener('focusin', handleFocusIn); 1011 document.addEventListener('focusout', handleFocusOut); 1012 const mutationObserver = new MutationObserver(handleMutations); 1013 if (container1) mutationObserver.observe(container1, { 1014 childList: true, 1015 subtree: true 1016 }); 1017 return ()=>{ 1018 document.removeEventListener('focusin', handleFocusIn); 1019 document.removeEventListener('focusout', handleFocusOut); 1020 mutationObserver.disconnect(); 1021 }; 1022 } 1023 }, [ 1024 trapped, 1025 container1, 1026 focusScope.paused 1027 ]); 1028 (0,external_React_namespaceObject.useEffect)(()=>{ 1029 if (container1) { 1030 $d3863c46a17e8a28$var$focusScopesStack.add(focusScope); 1031 const previouslyFocusedElement = document.activeElement; 1032 const hasFocusedCandidate = container1.contains(previouslyFocusedElement); 1033 if (!hasFocusedCandidate) { 1034 const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS); 1035 container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); 1036 container1.dispatchEvent(mountEvent); 1037 if (!mountEvent.defaultPrevented) { 1038 $d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), { 1039 select: true 1040 }); 1041 if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1); 1042 } 1043 } 1044 return ()=>{ 1045 container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount. 1046 // We need to delay the focus a little to get around it for now. 1047 // See: https://github.com/facebook/react/issues/17894 1048 setTimeout(()=>{ 1049 const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS); 1050 container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 1051 container1.dispatchEvent(unmountEvent); 1052 if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, { 1053 select: true 1054 }); 1055 // we need to remove the listener after we `dispatchEvent` 1056 container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 1057 $d3863c46a17e8a28$var$focusScopesStack.remove(focusScope); 1058 }, 0); 1059 }; 1060 } 1061 }, [ 1062 container1, 1063 onMountAutoFocus, 1064 onUnmountAutoFocus, 1065 focusScope 1066 ]); // Takes care of looping focus (when tabbing whilst at the edges) 1067 const handleKeyDown = (0,external_React_namespaceObject.useCallback)((event)=>{ 1068 if (!loop && !trapped) return; 1069 if (focusScope.paused) return; 1070 const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey; 1071 const focusedElement = document.activeElement; 1072 if (isTabKey && focusedElement) { 1073 const container = event.currentTarget; 1074 const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container); 1075 const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges 1076 if (!hasTabbableElementsInside) { 1077 if (focusedElement === container) event.preventDefault(); 1078 } else { 1079 if (!event.shiftKey && focusedElement === last) { 1080 event.preventDefault(); 1081 if (loop) $d3863c46a17e8a28$var$focus(first, { 1082 select: true 1083 }); 1084 } else if (event.shiftKey && focusedElement === first) { 1085 event.preventDefault(); 1086 if (loop) $d3863c46a17e8a28$var$focus(last, { 1087 select: true 1088 }); 1089 } 1090 } 1091 } 1092 }, [ 1093 loop, 1094 trapped, 1095 focusScope.paused 1096 ]); 1097 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({ 1098 tabIndex: -1 1099 }, scopeProps, { 1100 ref: composedRefs, 1101 onKeyDown: handleKeyDown 1102 })); 1103 }); 1104 /*#__PURE__*/ Object.assign($d3863c46a17e8a28$export$20e40289641fbbb6, { 1105 displayName: $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME 1106 }); 1107 /* ------------------------------------------------------------------------------------------------- 1108 * Utils 1109 * -----------------------------------------------------------------------------------------------*/ /** 1110 * Attempts focusing the first element in a list of candidates. 1111 * Stops when focus has actually moved. 1112 */ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) { 1113 const previouslyFocusedElement = document.activeElement; 1114 for (const candidate of candidates){ 1115 $d3863c46a17e8a28$var$focus(candidate, { 1116 select: select 1117 }); 1118 if (document.activeElement !== previouslyFocusedElement) return; 1119 } 1120 } 1121 /** 1122 * Returns the first and last tabbable elements inside a container. 1123 */ function $d3863c46a17e8a28$var$getTabbableEdges(container) { 1124 const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container); 1125 const first = $d3863c46a17e8a28$var$findVisible(candidates, container); 1126 const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container); 1127 return [ 1128 first, 1129 last 1130 ]; 1131 } 1132 /** 1133 * Returns a list of potential tabbable candidates. 1134 * 1135 * NOTE: This is only a close approximation. For example it doesn't take into account cases like when 1136 * elements are not visible. This cannot be worked out easily by just reading a property, but rather 1137 * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately. 1138 * 1139 * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker 1140 * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1 1141 */ function $d3863c46a17e8a28$var$getTabbableCandidates(container) { 1142 const nodes = []; 1143 const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { 1144 acceptNode: (node)=>{ 1145 const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden'; 1146 if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the 1147 // runtime's understanding of tabbability, so this automatically accounts 1148 // for any kind of element that could be tabbed to. 1149 return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 1150 } 1151 }); 1152 while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it 1153 // hinders accessibility to have tab order different from visual order. 1154 return nodes; 1155 } 1156 /** 1157 * Returns the first visible element in a list. 1158 * NOTE: Only checks visibility up to the `container`. 1159 */ function $d3863c46a17e8a28$var$findVisible(elements, container) { 1160 for (const element of elements){ 1161 // we stop checking if it's hidden at the `container` level (excluding) 1162 if (!$d3863c46a17e8a28$var$isHidden(element, { 1163 upTo: container 1164 })) return element; 1165 } 1166 } 1167 function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) { 1168 if (getComputedStyle(node).visibility === 'hidden') return true; 1169 while(node){ 1170 // we stop at `upTo` (excluding it) 1171 if (upTo !== undefined && node === upTo) return false; 1172 if (getComputedStyle(node).display === 'none') return true; 1173 node = node.parentElement; 1174 } 1175 return false; 1176 } 1177 function $d3863c46a17e8a28$var$isSelectableInput(element) { 1178 return element instanceof HTMLInputElement && 'select' in element; 1179 } 1180 function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) { 1181 // only focus if that element is focusable 1182 if (element && element.focus) { 1183 const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users 1184 element.focus({ 1185 preventScroll: true 1186 }); // only select if its not the same element, it supports selection and we need to select 1187 if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select(); 1188 } 1189 } 1190 /* ------------------------------------------------------------------------------------------------- 1191 * FocusScope stack 1192 * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack(); 1193 function $d3863c46a17e8a28$var$createFocusScopesStack() { 1194 /** A stack of focus scopes, with the active one at the top */ let stack = []; 1195 return { 1196 add (focusScope) { 1197 // pause the currently active focus scope (at the top of the stack) 1198 const activeFocusScope = stack[0]; 1199 if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause(); 1200 // remove in case it already exists (because we'll re-add it at the top of the stack) 1201 stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope); 1202 stack.unshift(focusScope); 1203 }, 1204 remove (focusScope) { 1205 var _stack$; 1206 stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope); 1207 (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume(); 1208 } 1209 }; 1210 } 1211 function $d3863c46a17e8a28$var$arrayRemove(array, item) { 1212 const updatedArray = [ 1213 ...array 1214 ]; 1215 const index = updatedArray.indexOf(item); 1216 if (index !== -1) updatedArray.splice(index, 1); 1217 return updatedArray; 1218 } 1219 function $d3863c46a17e8a28$var$removeLinks(items) { 1220 return items.filter((item)=>item.tagName !== 'A' 1221 ); 1222 } 1223 const $d3863c46a17e8a28$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($d3863c46a17e8a28$export$20e40289641fbbb6)); 1224 1225 1226 1227 1228 1229 ;// ./node_modules/@radix-ui/react-portal/dist/index.mjs 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 /* ------------------------------------------------------------------------------------------------- 1240 * Portal 1241 * -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$var$PORTAL_NAME = 'Portal'; 1242 const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 1243 var _globalThis$document; 1244 const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props; 1245 return container ? /*#__PURE__*/ external_ReactDOM_namespaceObject.createPortal(/*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, { 1246 ref: forwardedRef 1247 })), container) : null; 1248 }); 1249 /*#__PURE__*/ Object.assign($f1701beae083dbae$export$602eac185826482c, { 1250 displayName: $f1701beae083dbae$var$PORTAL_NAME 1251 }); 1252 /* -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($f1701beae083dbae$export$602eac185826482c)); 1253 1254 1255 1256 1257 1258 ;// ./node_modules/@radix-ui/react-presence/dist/index.mjs 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) { 1270 return (0,external_React_namespaceObject.useReducer)((state, event)=>{ 1271 const nextState = machine[state][event]; 1272 return nextState !== null && nextState !== void 0 ? nextState : state; 1273 }, initialState); 1274 } 1275 1276 1277 const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{ 1278 const { present: present , children: children } = props; 1279 const presence = $921a889cee6df7e8$var$usePresence(present); 1280 const child = typeof children === 'function' ? children({ 1281 present: presence.isPresent 1282 }) : external_React_namespaceObject.Children.only(children); 1283 const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref); 1284 const forceMount = typeof children === 'function'; 1285 return forceMount || presence.isPresent ? /*#__PURE__*/ (0,external_React_namespaceObject.cloneElement)(child, { 1286 ref: ref 1287 }) : null; 1288 }; 1289 $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence'; 1290 /* ------------------------------------------------------------------------------------------------- 1291 * usePresence 1292 * -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) { 1293 const [node1, setNode] = (0,external_React_namespaceObject.useState)(); 1294 const stylesRef = (0,external_React_namespaceObject.useRef)({}); 1295 const prevPresentRef = (0,external_React_namespaceObject.useRef)(present); 1296 const prevAnimationNameRef = (0,external_React_namespaceObject.useRef)('none'); 1297 const initialState = present ? 'mounted' : 'unmounted'; 1298 const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, { 1299 mounted: { 1300 UNMOUNT: 'unmounted', 1301 ANIMATION_OUT: 'unmountSuspended' 1302 }, 1303 unmountSuspended: { 1304 MOUNT: 'mounted', 1305 ANIMATION_END: 'unmounted' 1306 }, 1307 unmounted: { 1308 MOUNT: 'mounted' 1309 } 1310 }); 1311 (0,external_React_namespaceObject.useEffect)(()=>{ 1312 const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); 1313 prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none'; 1314 }, [ 1315 state 1316 ]); 1317 $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ 1318 const styles = stylesRef.current; 1319 const wasPresent = prevPresentRef.current; 1320 const hasPresentChanged = wasPresent !== present; 1321 if (hasPresentChanged) { 1322 const prevAnimationName = prevAnimationNameRef.current; 1323 const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles); 1324 if (present) send('MOUNT'); 1325 else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run 1326 // so we unmount instantly 1327 send('UNMOUNT'); 1328 else { 1329 /** 1330 * When `present` changes to `false`, we check changes to animation-name to 1331 * determine whether an animation has started. We chose this approach (reading 1332 * computed styles) because there is no `animationrun` event and `animationstart` 1333 * fires after `animation-delay` has expired which would be too late. 1334 */ const isAnimating = prevAnimationName !== currentAnimationName; 1335 if (wasPresent && isAnimating) send('ANIMATION_OUT'); 1336 else send('UNMOUNT'); 1337 } 1338 prevPresentRef.current = present; 1339 } 1340 }, [ 1341 present, 1342 send 1343 ]); 1344 $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ 1345 if (node1) { 1346 /** 1347 * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel` 1348 * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we 1349 * make sure we only trigger ANIMATION_END for the currently active animation. 1350 */ const handleAnimationEnd = (event)=>{ 1351 const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); 1352 const isCurrentAnimation = currentAnimationName.includes(event.animationName); 1353 if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied 1354 // a frame after the animation ends, creating a flash of visible content. 1355 // By manually flushing we ensure they sync within a frame, removing the flash. 1356 (0,external_ReactDOM_namespaceObject.flushSync)(()=>send('ANIMATION_END') 1357 ); 1358 }; 1359 const handleAnimationStart = (event)=>{ 1360 if (event.target === node1) // if animation occurred, store its name as the previous animation. 1361 prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); 1362 }; 1363 node1.addEventListener('animationstart', handleAnimationStart); 1364 node1.addEventListener('animationcancel', handleAnimationEnd); 1365 node1.addEventListener('animationend', handleAnimationEnd); 1366 return ()=>{ 1367 node1.removeEventListener('animationstart', handleAnimationStart); 1368 node1.removeEventListener('animationcancel', handleAnimationEnd); 1369 node1.removeEventListener('animationend', handleAnimationEnd); 1370 }; 1371 } else // Transition to the unmounted state if the node is removed prematurely. 1372 // We avoid doing so during cleanup as the node may change but still exist. 1373 send('ANIMATION_END'); 1374 }, [ 1375 node1, 1376 send 1377 ]); 1378 return { 1379 isPresent: [ 1380 'mounted', 1381 'unmountSuspended' 1382 ].includes(state), 1383 ref: (0,external_React_namespaceObject.useCallback)((node)=>{ 1384 if (node) stylesRef.current = getComputedStyle(node); 1385 setNode(node); 1386 }, []) 1387 }; 1388 } 1389 /* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) { 1390 return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none'; 1391 } 1392 1393 1394 1395 1396 1397 ;// ./node_modules/@radix-ui/react-focus-guards/dist/index.mjs 1398 1399 1400 1401 /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0; 1402 function $3db38b7d1fb3fe6a$export$ac5b58043b79449b(props) { 1403 $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(); 1404 return props.children; 1405 } 1406 /** 1407 * Injects a pair of focus guards at the edges of the whole DOM tree 1408 * to ensure `focusin` & `focusout` events can be caught consistently. 1409 */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() { 1410 (0,external_React_namespaceObject.useEffect)(()=>{ 1411 var _edgeGuards$, _edgeGuards$2; 1412 const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]'); 1413 document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard()); 1414 document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard()); 1415 $3db38b7d1fb3fe6a$var$count++; 1416 return ()=>{ 1417 if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove() 1418 ); 1419 $3db38b7d1fb3fe6a$var$count--; 1420 }; 1421 }, []); 1422 } 1423 function $3db38b7d1fb3fe6a$var$createFocusGuard() { 1424 const element = document.createElement('span'); 1425 element.setAttribute('data-radix-focus-guard', ''); 1426 element.tabIndex = 0; 1427 element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none'; 1428 return element; 1429 } 1430 const $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($3db38b7d1fb3fe6a$export$ac5b58043b79449b)); 1431 1432 1433 1434 1435 1436 ;// ./node_modules/tslib/tslib.es6.mjs 1437 /****************************************************************************** 1438 Copyright (c) Microsoft Corporation. 1439 1440 Permission to use, copy, modify, and/or distribute this software for any 1441 purpose with or without fee is hereby granted. 1442 1443 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 1444 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 1445 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 1446 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 1447 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 1448 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 1449 PERFORMANCE OF THIS SOFTWARE. 1450 ***************************************************************************** */ 1451 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 1452 1453 var extendStatics = function(d, b) { 1454 extendStatics = Object.setPrototypeOf || 1455 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 1456 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 1457 return extendStatics(d, b); 1458 }; 1459 1460 function __extends(d, b) { 1461 if (typeof b !== "function" && b !== null) 1462 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 1463 extendStatics(d, b); 1464 function __() { this.constructor = d; } 1465 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 1466 } 1467 1468 var __assign = function() { 1469 __assign = Object.assign || function __assign(t) { 1470 for (var s, i = 1, n = arguments.length; i < n; i++) { 1471 s = arguments[i]; 1472 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 1473 } 1474 return t; 1475 } 1476 return __assign.apply(this, arguments); 1477 } 1478 1479 function __rest(s, e) { 1480 var t = {}; 1481 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 1482 t[p] = s[p]; 1483 if (s != null && typeof Object.getOwnPropertySymbols === "function") 1484 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 1485 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 1486 t[p[i]] = s[p[i]]; 1487 } 1488 return t; 1489 } 1490 1491 function __decorate(decorators, target, key, desc) { 1492 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 1493 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 1494 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; 1495 return c > 3 && r && Object.defineProperty(target, key, r), r; 1496 } 1497 1498 function __param(paramIndex, decorator) { 1499 return function (target, key) { decorator(target, key, paramIndex); } 1500 } 1501 1502 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 1503 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 1504 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 1505 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 1506 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 1507 var _, done = false; 1508 for (var i = decorators.length - 1; i >= 0; i--) { 1509 var context = {}; 1510 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 1511 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 1512 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 1513 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 1514 if (kind === "accessor") { 1515 if (result === void 0) continue; 1516 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 1517 if (_ = accept(result.get)) descriptor.get = _; 1518 if (_ = accept(result.set)) descriptor.set = _; 1519 if (_ = accept(result.init)) initializers.unshift(_); 1520 } 1521 else if (_ = accept(result)) { 1522 if (kind === "field") initializers.unshift(_); 1523 else descriptor[key] = _; 1524 } 1525 } 1526 if (target) Object.defineProperty(target, contextIn.name, descriptor); 1527 done = true; 1528 }; 1529 1530 function __runInitializers(thisArg, initializers, value) { 1531 var useValue = arguments.length > 2; 1532 for (var i = 0; i < initializers.length; i++) { 1533 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 1534 } 1535 return useValue ? value : void 0; 1536 }; 1537 1538 function __propKey(x) { 1539 return typeof x === "symbol" ? x : "".concat(x); 1540 }; 1541 1542 function __setFunctionName(f, name, prefix) { 1543 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 1544 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 1545 }; 1546 1547 function __metadata(metadataKey, metadataValue) { 1548 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 1549 } 1550 1551 function __awaiter(thisArg, _arguments, P, generator) { 1552 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 1553 return new (P || (P = Promise))(function (resolve, reject) { 1554 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 1555 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 1556 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 1557 step((generator = generator.apply(thisArg, _arguments || [])).next()); 1558 }); 1559 } 1560 1561 function __generator(thisArg, body) { 1562 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); 1563 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 1564 function verb(n) { return function (v) { return step([n, v]); }; } 1565 function step(op) { 1566 if (f) throw new TypeError("Generator is already executing."); 1567 while (g && (g = 0, op[0] && (_ = 0)), _) try { 1568 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; 1569 if (y = 0, t) op = [op[0] & 2, t.value]; 1570 switch (op[0]) { 1571 case 0: case 1: t = op; break; 1572 case 4: _.label++; return { value: op[1], done: false }; 1573 case 5: _.label++; y = op[1]; op = [0]; continue; 1574 case 7: op = _.ops.pop(); _.trys.pop(); continue; 1575 default: 1576 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 1577 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 1578 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 1579 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 1580 if (t[2]) _.ops.pop(); 1581 _.trys.pop(); continue; 1582 } 1583 op = body.call(thisArg, _); 1584 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 1585 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 1586 } 1587 } 1588 1589 var __createBinding = Object.create ? (function(o, m, k, k2) { 1590 if (k2 === undefined) k2 = k; 1591 var desc = Object.getOwnPropertyDescriptor(m, k); 1592 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1593 desc = { enumerable: true, get: function() { return m[k]; } }; 1594 } 1595 Object.defineProperty(o, k2, desc); 1596 }) : (function(o, m, k, k2) { 1597 if (k2 === undefined) k2 = k; 1598 o[k2] = m[k]; 1599 }); 1600 1601 function __exportStar(m, o) { 1602 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 1603 } 1604 1605 function __values(o) { 1606 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 1607 if (m) return m.call(o); 1608 if (o && typeof o.length === "number") return { 1609 next: function () { 1610 if (o && i >= o.length) o = void 0; 1611 return { value: o && o[i++], done: !o }; 1612 } 1613 }; 1614 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 1615 } 1616 1617 function __read(o, n) { 1618 var m = typeof Symbol === "function" && o[Symbol.iterator]; 1619 if (!m) return o; 1620 var i = m.call(o), r, ar = [], e; 1621 try { 1622 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 1623 } 1624 catch (error) { e = { error: error }; } 1625 finally { 1626 try { 1627 if (r && !r.done && (m = i["return"])) m.call(i); 1628 } 1629 finally { if (e) throw e.error; } 1630 } 1631 return ar; 1632 } 1633 1634 /** @deprecated */ 1635 function __spread() { 1636 for (var ar = [], i = 0; i < arguments.length; i++) 1637 ar = ar.concat(__read(arguments[i])); 1638 return ar; 1639 } 1640 1641 /** @deprecated */ 1642 function __spreadArrays() { 1643 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 1644 for (var r = Array(s), k = 0, i = 0; i < il; i++) 1645 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 1646 r[k] = a[j]; 1647 return r; 1648 } 1649 1650 function __spreadArray(to, from, pack) { 1651 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 1652 if (ar || !(i in from)) { 1653 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 1654 ar[i] = from[i]; 1655 } 1656 } 1657 return to.concat(ar || Array.prototype.slice.call(from)); 1658 } 1659 1660 function __await(v) { 1661 return this instanceof __await ? (this.v = v, this) : new __await(v); 1662 } 1663 1664 function __asyncGenerator(thisArg, _arguments, generator) { 1665 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1666 var g = generator.apply(thisArg, _arguments || []), i, q = []; 1667 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 1668 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 1669 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]); } } 1670 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 1671 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 1672 function fulfill(value) { resume("next", value); } 1673 function reject(value) { resume("throw", value); } 1674 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 1675 } 1676 1677 function __asyncDelegator(o) { 1678 var i, p; 1679 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 1680 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; } 1681 } 1682 1683 function __asyncValues(o) { 1684 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1685 var m = o[Symbol.asyncIterator], i; 1686 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); 1687 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); }); }; } 1688 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 1689 } 1690 1691 function __makeTemplateObject(cooked, raw) { 1692 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 1693 return cooked; 1694 }; 1695 1696 var __setModuleDefault = Object.create ? (function(o, v) { 1697 Object.defineProperty(o, "default", { enumerable: true, value: v }); 1698 }) : function(o, v) { 1699 o["default"] = v; 1700 }; 1701 1702 var ownKeys = function(o) { 1703 ownKeys = Object.getOwnPropertyNames || function (o) { 1704 var ar = []; 1705 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 1706 return ar; 1707 }; 1708 return ownKeys(o); 1709 }; 1710 1711 function __importStar(mod) { 1712 if (mod && mod.__esModule) return mod; 1713 var result = {}; 1714 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 1715 __setModuleDefault(result, mod); 1716 return result; 1717 } 1718 1719 function __importDefault(mod) { 1720 return (mod && mod.__esModule) ? mod : { default: mod }; 1721 } 1722 1723 function __classPrivateFieldGet(receiver, state, kind, f) { 1724 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 1725 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"); 1726 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 1727 } 1728 1729 function __classPrivateFieldSet(receiver, state, value, kind, f) { 1730 if (kind === "m") throw new TypeError("Private method is not writable"); 1731 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 1732 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"); 1733 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 1734 } 1735 1736 function __classPrivateFieldIn(state, receiver) { 1737 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 1738 return typeof state === "function" ? receiver === state : state.has(receiver); 1739 } 1740 1741 function __addDisposableResource(env, value, async) { 1742 if (value !== null && value !== void 0) { 1743 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 1744 var dispose, inner; 1745 if (async) { 1746 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 1747 dispose = value[Symbol.asyncDispose]; 1748 } 1749 if (dispose === void 0) { 1750 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 1751 dispose = value[Symbol.dispose]; 1752 if (async) inner = dispose; 1753 } 1754 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 1755 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 1756 env.stack.push({ value: value, dispose: dispose, async: async }); 1757 } 1758 else if (async) { 1759 env.stack.push({ async: true }); 1760 } 1761 return value; 1762 } 1763 1764 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 1765 var e = new Error(message); 1766 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 1767 }; 1768 1769 function __disposeResources(env) { 1770 function fail(e) { 1771 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 1772 env.hasError = true; 1773 } 1774 var r, s = 0; 1775 function next() { 1776 while (r = env.stack.pop()) { 1777 try { 1778 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 1779 if (r.dispose) { 1780 var result = r.dispose.call(r.value); 1781 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 1782 } 1783 else s |= 1; 1784 } 1785 catch (e) { 1786 fail(e); 1787 } 1788 } 1789 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 1790 if (env.hasError) throw env.error; 1791 } 1792 return next(); 1793 } 1794 1795 function __rewriteRelativeImportExtension(path, preserveJsx) { 1796 if (typeof path === "string" && /^\.\.?\//.test(path)) { 1797 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 1798 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 1799 }); 1800 } 1801 return path; 1802 } 1803 1804 /* harmony default export */ const tslib_es6 = ({ 1805 __extends, 1806 __assign, 1807 __rest, 1808 __decorate, 1809 __param, 1810 __esDecorate, 1811 __runInitializers, 1812 __propKey, 1813 __setFunctionName, 1814 __metadata, 1815 __awaiter, 1816 __generator, 1817 __createBinding, 1818 __exportStar, 1819 __values, 1820 __read, 1821 __spread, 1822 __spreadArrays, 1823 __spreadArray, 1824 __await, 1825 __asyncGenerator, 1826 __asyncDelegator, 1827 __asyncValues, 1828 __makeTemplateObject, 1829 __importStar, 1830 __importDefault, 1831 __classPrivateFieldGet, 1832 __classPrivateFieldSet, 1833 __classPrivateFieldIn, 1834 __addDisposableResource, 1835 __disposeResources, 1836 __rewriteRelativeImportExtension, 1837 }); 1838 1839 ;// ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js 1840 var zeroRightClassName = 'right-scroll-bar-position'; 1841 var fullWidthClassName = 'width-before-scroll-bar'; 1842 var noScrollbarsClassName = 'with-scroll-bars-hidden'; 1843 /** 1844 * Name of a CSS variable containing the amount of "hidden" scrollbar 1845 * ! might be undefined ! use will fallback! 1846 */ 1847 var removedBarSizeVariable = '--removed-body-scroll-bar-size'; 1848 1849 ;// ./node_modules/use-callback-ref/dist/es2015/assignRef.js 1850 /** 1851 * Assigns a value for a given ref, no matter of the ref format 1852 * @param {RefObject} ref - a callback function or ref object 1853 * @param value - a new value 1854 * 1855 * @see https://github.com/theKashey/use-callback-ref#assignref 1856 * @example 1857 * const refObject = useRef(); 1858 * const refFn = (ref) => {....} 1859 * 1860 * assignRef(refObject, "refValue"); 1861 * assignRef(refFn, "refValue"); 1862 */ 1863 function assignRef(ref, value) { 1864 if (typeof ref === 'function') { 1865 ref(value); 1866 } 1867 else if (ref) { 1868 ref.current = value; 1869 } 1870 return ref; 1871 } 1872 1873 ;// ./node_modules/use-callback-ref/dist/es2015/useRef.js 1874 1875 /** 1876 * creates a MutableRef with ref change callback 1877 * @param initialValue - initial ref value 1878 * @param {Function} callback - a callback to run when value changes 1879 * 1880 * @example 1881 * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); 1882 * ref.current = 1; 1883 * // prints 0 -> 1 1884 * 1885 * @see https://reactjs.org/docs/hooks-reference.html#useref 1886 * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref 1887 * @returns {MutableRefObject} 1888 */ 1889 function useCallbackRef(initialValue, callback) { 1890 var ref = (0,external_React_namespaceObject.useState)(function () { return ({ 1891 // value 1892 value: initialValue, 1893 // last callback 1894 callback: callback, 1895 // "memoized" public interface 1896 facade: { 1897 get current() { 1898 return ref.value; 1899 }, 1900 set current(value) { 1901 var last = ref.value; 1902 if (last !== value) { 1903 ref.value = value; 1904 ref.callback(value, last); 1905 } 1906 }, 1907 }, 1908 }); })[0]; 1909 // update callback 1910 ref.callback = callback; 1911 return ref.facade; 1912 } 1913 1914 ;// ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js 1915 1916 1917 1918 var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_React_namespaceObject.useLayoutEffect : external_React_namespaceObject.useEffect; 1919 var currentValues = new WeakMap(); 1920 /** 1921 * Merges two or more refs together providing a single interface to set their value 1922 * @param {RefObject|Ref} refs 1923 * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} 1924 * 1925 * @see {@link mergeRefs} a version without buit-in memoization 1926 * @see https://github.com/theKashey/use-callback-ref#usemergerefs 1927 * @example 1928 * const Component = React.forwardRef((props, ref) => { 1929 * const ownRef = useRef(); 1930 * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together 1931 * return <div ref={domRef}>...</div> 1932 * } 1933 */ 1934 function useMergeRefs(refs, defaultValue) { 1935 var callbackRef = useCallbackRef(defaultValue || null, function (newValue) { 1936 return refs.forEach(function (ref) { return assignRef(ref, newValue); }); 1937 }); 1938 // handle refs changes - added or removed 1939 useIsomorphicLayoutEffect(function () { 1940 var oldValue = currentValues.get(callbackRef); 1941 if (oldValue) { 1942 var prevRefs_1 = new Set(oldValue); 1943 var nextRefs_1 = new Set(refs); 1944 var current_1 = callbackRef.current; 1945 prevRefs_1.forEach(function (ref) { 1946 if (!nextRefs_1.has(ref)) { 1947 assignRef(ref, null); 1948 } 1949 }); 1950 nextRefs_1.forEach(function (ref) { 1951 if (!prevRefs_1.has(ref)) { 1952 assignRef(ref, current_1); 1953 } 1954 }); 1955 } 1956 currentValues.set(callbackRef, refs); 1957 }, [refs]); 1958 return callbackRef; 1959 } 1960 1961 ;// ./node_modules/use-sidecar/dist/es2015/medium.js 1962 1963 function ItoI(a) { 1964 return a; 1965 } 1966 function innerCreateMedium(defaults, middleware) { 1967 if (middleware === void 0) { middleware = ItoI; } 1968 var buffer = []; 1969 var assigned = false; 1970 var medium = { 1971 read: function () { 1972 if (assigned) { 1973 throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); 1974 } 1975 if (buffer.length) { 1976 return buffer[buffer.length - 1]; 1977 } 1978 return defaults; 1979 }, 1980 useMedium: function (data) { 1981 var item = middleware(data, assigned); 1982 buffer.push(item); 1983 return function () { 1984 buffer = buffer.filter(function (x) { return x !== item; }); 1985 }; 1986 }, 1987 assignSyncMedium: function (cb) { 1988 assigned = true; 1989 while (buffer.length) { 1990 var cbs = buffer; 1991 buffer = []; 1992 cbs.forEach(cb); 1993 } 1994 buffer = { 1995 push: function (x) { return cb(x); }, 1996 filter: function () { return buffer; }, 1997 }; 1998 }, 1999 assignMedium: function (cb) { 2000 assigned = true; 2001 var pendingQueue = []; 2002 if (buffer.length) { 2003 var cbs = buffer; 2004 buffer = []; 2005 cbs.forEach(cb); 2006 pendingQueue = buffer; 2007 } 2008 var executeQueue = function () { 2009 var cbs = pendingQueue; 2010 pendingQueue = []; 2011 cbs.forEach(cb); 2012 }; 2013 var cycle = function () { return Promise.resolve().then(executeQueue); }; 2014 cycle(); 2015 buffer = { 2016 push: function (x) { 2017 pendingQueue.push(x); 2018 cycle(); 2019 }, 2020 filter: function (filter) { 2021 pendingQueue = pendingQueue.filter(filter); 2022 return buffer; 2023 }, 2024 }; 2025 }, 2026 }; 2027 return medium; 2028 } 2029 function createMedium(defaults, middleware) { 2030 if (middleware === void 0) { middleware = ItoI; } 2031 return innerCreateMedium(defaults, middleware); 2032 } 2033 // eslint-disable-next-line @typescript-eslint/ban-types 2034 function createSidecarMedium(options) { 2035 if (options === void 0) { options = {}; } 2036 var medium = innerCreateMedium(null); 2037 medium.options = __assign({ async: true, ssr: false }, options); 2038 return medium; 2039 } 2040 2041 ;// ./node_modules/react-remove-scroll/dist/es2015/medium.js 2042 2043 var effectCar = createSidecarMedium(); 2044 2045 ;// ./node_modules/react-remove-scroll/dist/es2015/UI.js 2046 2047 2048 2049 2050 2051 var nothing = function () { 2052 return; 2053 }; 2054 /** 2055 * Removes scrollbar from the page and contain the scroll within the Lock 2056 */ 2057 var RemoveScroll = external_React_namespaceObject.forwardRef(function (props, parentRef) { 2058 var ref = external_React_namespaceObject.useRef(null); 2059 var _a = external_React_namespaceObject.useState({ 2060 onScrollCapture: nothing, 2061 onWheelCapture: nothing, 2062 onTouchMoveCapture: nothing, 2063 }), callbacks = _a[0], setCallbacks = _a[1]; 2064 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]); 2065 var SideCar = sideCar; 2066 var containerRef = useMergeRefs([ref, parentRef]); 2067 var containerProps = __assign(__assign({}, rest), callbacks); 2068 return (external_React_namespaceObject.createElement(external_React_namespaceObject.Fragment, null, 2069 enabled && (external_React_namespaceObject.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })), 2070 forwardProps ? (external_React_namespaceObject.cloneElement(external_React_namespaceObject.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (external_React_namespaceObject.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children)))); 2071 }); 2072 RemoveScroll.defaultProps = { 2073 enabled: true, 2074 removeScrollBar: true, 2075 inert: false, 2076 }; 2077 RemoveScroll.classNames = { 2078 fullWidth: fullWidthClassName, 2079 zeroRight: zeroRightClassName, 2080 }; 2081 2082 2083 ;// ./node_modules/use-sidecar/dist/es2015/exports.js 2084 2085 2086 var SideCar = function (_a) { 2087 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); 2088 if (!sideCar) { 2089 throw new Error('Sidecar: please provide `sideCar` property to import the right car'); 2090 } 2091 var Target = sideCar.read(); 2092 if (!Target) { 2093 throw new Error('Sidecar medium not found'); 2094 } 2095 return external_React_namespaceObject.createElement(Target, __assign({}, rest)); 2096 }; 2097 SideCar.isSideCarExport = true; 2098 function exportSidecar(medium, exported) { 2099 medium.useMedium(exported); 2100 return SideCar; 2101 } 2102 2103 ;// ./node_modules/get-nonce/dist/es2015/index.js 2104 var currentNonce; 2105 var setNonce = function (nonce) { 2106 currentNonce = nonce; 2107 }; 2108 var getNonce = function () { 2109 if (currentNonce) { 2110 return currentNonce; 2111 } 2112 if (true) { 2113 return __webpack_require__.nc; 2114 } 2115 return undefined; 2116 }; 2117 2118 ;// ./node_modules/react-style-singleton/dist/es2015/singleton.js 2119 2120 function makeStyleTag() { 2121 if (!document) 2122 return null; 2123 var tag = document.createElement('style'); 2124 tag.type = 'text/css'; 2125 var nonce = getNonce(); 2126 if (nonce) { 2127 tag.setAttribute('nonce', nonce); 2128 } 2129 return tag; 2130 } 2131 function injectStyles(tag, css) { 2132 // @ts-ignore 2133 if (tag.styleSheet) { 2134 // @ts-ignore 2135 tag.styleSheet.cssText = css; 2136 } 2137 else { 2138 tag.appendChild(document.createTextNode(css)); 2139 } 2140 } 2141 function insertStyleTag(tag) { 2142 var head = document.head || document.getElementsByTagName('head')[0]; 2143 head.appendChild(tag); 2144 } 2145 var stylesheetSingleton = function () { 2146 var counter = 0; 2147 var stylesheet = null; 2148 return { 2149 add: function (style) { 2150 if (counter == 0) { 2151 if ((stylesheet = makeStyleTag())) { 2152 injectStyles(stylesheet, style); 2153 insertStyleTag(stylesheet); 2154 } 2155 } 2156 counter++; 2157 }, 2158 remove: function () { 2159 counter--; 2160 if (!counter && stylesheet) { 2161 stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); 2162 stylesheet = null; 2163 } 2164 }, 2165 }; 2166 }; 2167 2168 ;// ./node_modules/react-style-singleton/dist/es2015/hook.js 2169 2170 2171 /** 2172 * creates a hook to control style singleton 2173 * @see {@link styleSingleton} for a safer component version 2174 * @example 2175 * ```tsx 2176 * const useStyle = styleHookSingleton(); 2177 * /// 2178 * useStyle('body { overflow: hidden}'); 2179 */ 2180 var styleHookSingleton = function () { 2181 var sheet = stylesheetSingleton(); 2182 return function (styles, isDynamic) { 2183 external_React_namespaceObject.useEffect(function () { 2184 sheet.add(styles); 2185 return function () { 2186 sheet.remove(); 2187 }; 2188 }, [styles && isDynamic]); 2189 }; 2190 }; 2191 2192 ;// ./node_modules/react-style-singleton/dist/es2015/component.js 2193 2194 /** 2195 * create a Component to add styles on demand 2196 * - styles are added when first instance is mounted 2197 * - styles are removed when the last instance is unmounted 2198 * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior 2199 */ 2200 var styleSingleton = function () { 2201 var useStyle = styleHookSingleton(); 2202 var Sheet = function (_a) { 2203 var styles = _a.styles, dynamic = _a.dynamic; 2204 useStyle(styles, dynamic); 2205 return null; 2206 }; 2207 return Sheet; 2208 }; 2209 2210 ;// ./node_modules/react-style-singleton/dist/es2015/index.js 2211 2212 2213 2214 2215 ;// ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js 2216 var zeroGap = { 2217 left: 0, 2218 top: 0, 2219 right: 0, 2220 gap: 0, 2221 }; 2222 var parse = function (x) { return parseInt(x || '', 10) || 0; }; 2223 var getOffset = function (gapMode) { 2224 var cs = window.getComputedStyle(document.body); 2225 var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; 2226 var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; 2227 var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; 2228 return [parse(left), parse(top), parse(right)]; 2229 }; 2230 var getGapWidth = function (gapMode) { 2231 if (gapMode === void 0) { gapMode = 'margin'; } 2232 if (typeof window === 'undefined') { 2233 return zeroGap; 2234 } 2235 var offsets = getOffset(gapMode); 2236 var documentWidth = document.documentElement.clientWidth; 2237 var windowWidth = window.innerWidth; 2238 return { 2239 left: offsets[0], 2240 top: offsets[1], 2241 right: offsets[2], 2242 gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]), 2243 }; 2244 }; 2245 2246 ;// ./node_modules/react-remove-scroll-bar/dist/es2015/component.js 2247 2248 2249 2250 2251 var Style = styleSingleton(); 2252 var lockAttribute = 'data-scroll-locked'; 2253 // important tip - once we measure scrollBar width and remove them 2254 // we could not repeat this operation 2255 // thus we are using style-singleton - only the first "yet correct" style will be applied. 2256 var getStyles = function (_a, allowRelative, gapMode, important) { 2257 var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; 2258 if (gapMode === void 0) { gapMode = 'margin'; } 2259 return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ 2260 allowRelative && "position: relative ".concat(important, ";"), 2261 gapMode === 'margin' && 2262 "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), 2263 gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"), 2264 ] 2265 .filter(Boolean) 2266 .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); 2267 }; 2268 var getCurrentUseCounter = function () { 2269 var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10); 2270 return isFinite(counter) ? counter : 0; 2271 }; 2272 var useLockAttribute = function () { 2273 external_React_namespaceObject.useEffect(function () { 2274 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); 2275 return function () { 2276 var newCounter = getCurrentUseCounter() - 1; 2277 if (newCounter <= 0) { 2278 document.body.removeAttribute(lockAttribute); 2279 } 2280 else { 2281 document.body.setAttribute(lockAttribute, newCounter.toString()); 2282 } 2283 }; 2284 }, []); 2285 }; 2286 /** 2287 * Removes page scrollbar and blocks page scroll when mounted 2288 */ 2289 var RemoveScrollBar = function (_a) { 2290 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b; 2291 useLockAttribute(); 2292 /* 2293 gap will be measured on every component mount 2294 however it will be used only by the "first" invocation 2295 due to singleton nature of <Style 2296 */ 2297 var gap = external_React_namespaceObject.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]); 2298 return external_React_namespaceObject.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') }); 2299 }; 2300 2301 ;// ./node_modules/react-remove-scroll-bar/dist/es2015/index.js 2302 2303 2304 2305 2306 2307 ;// ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js 2308 var passiveSupported = false; 2309 if (typeof window !== 'undefined') { 2310 try { 2311 var options = Object.defineProperty({}, 'passive', { 2312 get: function () { 2313 passiveSupported = true; 2314 return true; 2315 }, 2316 }); 2317 // @ts-ignore 2318 window.addEventListener('test', options, options); 2319 // @ts-ignore 2320 window.removeEventListener('test', options, options); 2321 } 2322 catch (err) { 2323 passiveSupported = false; 2324 } 2325 } 2326 var nonPassive = passiveSupported ? { passive: false } : false; 2327 2328 ;// ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js 2329 var alwaysContainsScroll = function (node) { 2330 // textarea will always _contain_ scroll inside self. It only can be hidden 2331 return node.tagName === 'TEXTAREA'; 2332 }; 2333 var elementCanBeScrolled = function (node, overflow) { 2334 var styles = window.getComputedStyle(node); 2335 return ( 2336 // not-not-scrollable 2337 styles[overflow] !== 'hidden' && 2338 // contains scroll inside self 2339 !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible')); 2340 }; 2341 var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); }; 2342 var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); }; 2343 var locationCouldBeScrolled = function (axis, node) { 2344 var current = node; 2345 do { 2346 // Skip over shadow root 2347 if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { 2348 current = current.host; 2349 } 2350 var isScrollable = elementCouldBeScrolled(axis, current); 2351 if (isScrollable) { 2352 var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2]; 2353 if (s > d) { 2354 return true; 2355 } 2356 } 2357 current = current.parentNode; 2358 } while (current && current !== document.body); 2359 return false; 2360 }; 2361 var getVScrollVariables = function (_a) { 2362 var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; 2363 return [ 2364 scrollTop, 2365 scrollHeight, 2366 clientHeight, 2367 ]; 2368 }; 2369 var getHScrollVariables = function (_a) { 2370 var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; 2371 return [ 2372 scrollLeft, 2373 scrollWidth, 2374 clientWidth, 2375 ]; 2376 }; 2377 var elementCouldBeScrolled = function (axis, node) { 2378 return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); 2379 }; 2380 var getScrollVariables = function (axis, node) { 2381 return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); 2382 }; 2383 var getDirectionFactor = function (axis, direction) { 2384 /** 2385 * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, 2386 * and then increasingly negative as you scroll towards the end of the content. 2387 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft 2388 */ 2389 return axis === 'h' && direction === 'rtl' ? -1 : 1; 2390 }; 2391 var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { 2392 var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); 2393 var delta = directionFactor * sourceDelta; 2394 // find scrollable target 2395 var target = event.target; 2396 var targetInLock = endTarget.contains(target); 2397 var shouldCancelScroll = false; 2398 var isDeltaPositive = delta > 0; 2399 var availableScroll = 0; 2400 var availableScrollTop = 0; 2401 do { 2402 var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; 2403 var elementScroll = scroll_1 - capacity - directionFactor * position; 2404 if (position || elementScroll) { 2405 if (elementCouldBeScrolled(axis, target)) { 2406 availableScroll += elementScroll; 2407 availableScrollTop += position; 2408 } 2409 } 2410 target = target.parentNode; 2411 } while ( 2412 // portaled content 2413 (!targetInLock && target !== document.body) || 2414 // self content 2415 (targetInLock && (endTarget.contains(target) || endTarget === target))); 2416 if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) { 2417 shouldCancelScroll = true; 2418 } 2419 else if (!isDeltaPositive && 2420 ((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) { 2421 shouldCancelScroll = true; 2422 } 2423 return shouldCancelScroll; 2424 }; 2425 2426 ;// ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js 2427 2428 2429 2430 2431 2432 2433 var getTouchXY = function (event) { 2434 return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; 2435 }; 2436 var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; }; 2437 var extractRef = function (ref) { 2438 return ref && 'current' in ref ? ref.current : ref; 2439 }; 2440 var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; }; 2441 var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; 2442 var idCounter = 0; 2443 var lockStack = []; 2444 function RemoveScrollSideCar(props) { 2445 var shouldPreventQueue = external_React_namespaceObject.useRef([]); 2446 var touchStartRef = external_React_namespaceObject.useRef([0, 0]); 2447 var activeAxis = external_React_namespaceObject.useRef(); 2448 var id = external_React_namespaceObject.useState(idCounter++)[0]; 2449 var Style = external_React_namespaceObject.useState(function () { return styleSingleton(); })[0]; 2450 var lastProps = external_React_namespaceObject.useRef(props); 2451 external_React_namespaceObject.useEffect(function () { 2452 lastProps.current = props; 2453 }, [props]); 2454 external_React_namespaceObject.useEffect(function () { 2455 if (props.inert) { 2456 document.body.classList.add("block-interactivity-".concat(id)); 2457 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); 2458 allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); }); 2459 return function () { 2460 document.body.classList.remove("block-interactivity-".concat(id)); 2461 allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); }); 2462 }; 2463 } 2464 return; 2465 }, [props.inert, props.lockRef.current, props.shards]); 2466 var shouldCancelEvent = external_React_namespaceObject.useCallback(function (event, parent) { 2467 if ('touches' in event && event.touches.length === 2) { 2468 return !lastProps.current.allowPinchZoom; 2469 } 2470 var touch = getTouchXY(event); 2471 var touchStart = touchStartRef.current; 2472 var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; 2473 var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; 2474 var currentAxis; 2475 var target = event.target; 2476 var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; 2477 // allow horizontal touch move on Range inputs. They will not cause any scroll 2478 if ('touches' in event && moveDirection === 'h' && target.type === 'range') { 2479 return false; 2480 } 2481 var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 2482 if (!canBeScrolledInMainDirection) { 2483 return true; 2484 } 2485 if (canBeScrolledInMainDirection) { 2486 currentAxis = moveDirection; 2487 } 2488 else { 2489 currentAxis = moveDirection === 'v' ? 'h' : 'v'; 2490 canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 2491 // other axis might be not scrollable 2492 } 2493 if (!canBeScrolledInMainDirection) { 2494 return false; 2495 } 2496 if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { 2497 activeAxis.current = currentAxis; 2498 } 2499 if (!currentAxis) { 2500 return true; 2501 } 2502 var cancelingAxis = activeAxis.current || currentAxis; 2503 return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); 2504 }, []); 2505 var shouldPrevent = external_React_namespaceObject.useCallback(function (_event) { 2506 var event = _event; 2507 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { 2508 // not the last active 2509 return; 2510 } 2511 var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); 2512 var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0]; 2513 // self event, and should be canceled 2514 if (sourceEvent && sourceEvent.should) { 2515 if (event.cancelable) { 2516 event.preventDefault(); 2517 } 2518 return; 2519 } 2520 // outside or shard event 2521 if (!sourceEvent) { 2522 var shardNodes = (lastProps.current.shards || []) 2523 .map(extractRef) 2524 .filter(Boolean) 2525 .filter(function (node) { return node.contains(event.target); }); 2526 var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; 2527 if (shouldStop) { 2528 if (event.cancelable) { 2529 event.preventDefault(); 2530 } 2531 } 2532 } 2533 }, []); 2534 var shouldCancel = external_React_namespaceObject.useCallback(function (name, delta, target, should) { 2535 var event = { name: name, delta: delta, target: target, should: should }; 2536 shouldPreventQueue.current.push(event); 2537 setTimeout(function () { 2538 shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; }); 2539 }, 1); 2540 }, []); 2541 var scrollTouchStart = external_React_namespaceObject.useCallback(function (event) { 2542 touchStartRef.current = getTouchXY(event); 2543 activeAxis.current = undefined; 2544 }, []); 2545 var scrollWheel = external_React_namespaceObject.useCallback(function (event) { 2546 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 2547 }, []); 2548 var scrollTouchMove = external_React_namespaceObject.useCallback(function (event) { 2549 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 2550 }, []); 2551 external_React_namespaceObject.useEffect(function () { 2552 lockStack.push(Style); 2553 props.setCallbacks({ 2554 onScrollCapture: scrollWheel, 2555 onWheelCapture: scrollWheel, 2556 onTouchMoveCapture: scrollTouchMove, 2557 }); 2558 document.addEventListener('wheel', shouldPrevent, nonPassive); 2559 document.addEventListener('touchmove', shouldPrevent, nonPassive); 2560 document.addEventListener('touchstart', scrollTouchStart, nonPassive); 2561 return function () { 2562 lockStack = lockStack.filter(function (inst) { return inst !== Style; }); 2563 document.removeEventListener('wheel', shouldPrevent, nonPassive); 2564 document.removeEventListener('touchmove', shouldPrevent, nonPassive); 2565 document.removeEventListener('touchstart', scrollTouchStart, nonPassive); 2566 }; 2567 }, []); 2568 var removeScrollBar = props.removeScrollBar, inert = props.inert; 2569 return (external_React_namespaceObject.createElement(external_React_namespaceObject.Fragment, null, 2570 inert ? external_React_namespaceObject.createElement(Style, { styles: generateStyle(id) }) : null, 2571 removeScrollBar ? external_React_namespaceObject.createElement(RemoveScrollBar, { gapMode: "margin" }) : null)); 2572 } 2573 2574 ;// ./node_modules/react-remove-scroll/dist/es2015/sidecar.js 2575 2576 2577 2578 /* harmony default export */ const sidecar = (exportSidecar(effectCar, RemoveScrollSideCar)); 2579 2580 ;// ./node_modules/react-remove-scroll/dist/es2015/Combination.js 2581 2582 2583 2584 2585 var ReactRemoveScroll = external_React_namespaceObject.forwardRef(function (props, ref) { return (external_React_namespaceObject.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: sidecar }))); }); 2586 ReactRemoveScroll.classNames = RemoveScroll.classNames; 2587 /* harmony default export */ const Combination = (ReactRemoveScroll); 2588 2589 ;// ./node_modules/aria-hidden/dist/es2015/index.js 2590 var getDefaultParent = function (originalTarget) { 2591 if (typeof document === 'undefined') { 2592 return null; 2593 } 2594 var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; 2595 return sampleTarget.ownerDocument.body; 2596 }; 2597 var counterMap = new WeakMap(); 2598 var uncontrolledNodes = new WeakMap(); 2599 var markerMap = {}; 2600 var lockCount = 0; 2601 var unwrapHost = function (node) { 2602 return node && (node.host || unwrapHost(node.parentNode)); 2603 }; 2604 var correctTargets = function (parent, targets) { 2605 return targets 2606 .map(function (target) { 2607 if (parent.contains(target)) { 2608 return target; 2609 } 2610 var correctedTarget = unwrapHost(target); 2611 if (correctedTarget && parent.contains(correctedTarget)) { 2612 return correctedTarget; 2613 } 2614 console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); 2615 return null; 2616 }) 2617 .filter(function (x) { return Boolean(x); }); 2618 }; 2619 /** 2620 * Marks everything except given node(or nodes) as aria-hidden 2621 * @param {Element | Element[]} originalTarget - elements to keep on the page 2622 * @param [parentNode] - top element, defaults to document.body 2623 * @param {String} [markerName] - a special attribute to mark every node 2624 * @param {String} [controlAttribute] - html Attribute to control 2625 * @return {Undo} undo command 2626 */ 2627 var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { 2628 var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 2629 if (!markerMap[markerName]) { 2630 markerMap[markerName] = new WeakMap(); 2631 } 2632 var markerCounter = markerMap[markerName]; 2633 var hiddenNodes = []; 2634 var elementsToKeep = new Set(); 2635 var elementsToStop = new Set(targets); 2636 var keep = function (el) { 2637 if (!el || elementsToKeep.has(el)) { 2638 return; 2639 } 2640 elementsToKeep.add(el); 2641 keep(el.parentNode); 2642 }; 2643 targets.forEach(keep); 2644 var deep = function (parent) { 2645 if (!parent || elementsToStop.has(parent)) { 2646 return; 2647 } 2648 Array.prototype.forEach.call(parent.children, function (node) { 2649 if (elementsToKeep.has(node)) { 2650 deep(node); 2651 } 2652 else { 2653 try { 2654 var attr = node.getAttribute(controlAttribute); 2655 var alreadyHidden = attr !== null && attr !== 'false'; 2656 var counterValue = (counterMap.get(node) || 0) + 1; 2657 var markerValue = (markerCounter.get(node) || 0) + 1; 2658 counterMap.set(node, counterValue); 2659 markerCounter.set(node, markerValue); 2660 hiddenNodes.push(node); 2661 if (counterValue === 1 && alreadyHidden) { 2662 uncontrolledNodes.set(node, true); 2663 } 2664 if (markerValue === 1) { 2665 node.setAttribute(markerName, 'true'); 2666 } 2667 if (!alreadyHidden) { 2668 node.setAttribute(controlAttribute, 'true'); 2669 } 2670 } 2671 catch (e) { 2672 console.error('aria-hidden: cannot operate on ', node, e); 2673 } 2674 } 2675 }); 2676 }; 2677 deep(parentNode); 2678 elementsToKeep.clear(); 2679 lockCount++; 2680 return function () { 2681 hiddenNodes.forEach(function (node) { 2682 var counterValue = counterMap.get(node) - 1; 2683 var markerValue = markerCounter.get(node) - 1; 2684 counterMap.set(node, counterValue); 2685 markerCounter.set(node, markerValue); 2686 if (!counterValue) { 2687 if (!uncontrolledNodes.has(node)) { 2688 node.removeAttribute(controlAttribute); 2689 } 2690 uncontrolledNodes.delete(node); 2691 } 2692 if (!markerValue) { 2693 node.removeAttribute(markerName); 2694 } 2695 }); 2696 lockCount--; 2697 if (!lockCount) { 2698 // clear 2699 counterMap = new WeakMap(); 2700 counterMap = new WeakMap(); 2701 uncontrolledNodes = new WeakMap(); 2702 markerMap = {}; 2703 } 2704 }; 2705 }; 2706 /** 2707 * Marks everything except given node(or nodes) as aria-hidden 2708 * @param {Element | Element[]} originalTarget - elements to keep on the page 2709 * @param [parentNode] - top element, defaults to document.body 2710 * @param {String} [markerName] - a special attribute to mark every node 2711 * @return {Undo} undo command 2712 */ 2713 var hideOthers = function (originalTarget, parentNode, markerName) { 2714 if (markerName === void 0) { markerName = 'data-aria-hidden'; } 2715 var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 2716 var activeParentNode = parentNode || getDefaultParent(originalTarget); 2717 if (!activeParentNode) { 2718 return function () { return null; }; 2719 } 2720 // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 2721 targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); 2722 return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); 2723 }; 2724 /** 2725 * Marks everything except given node(or nodes) as inert 2726 * @param {Element | Element[]} originalTarget - elements to keep on the page 2727 * @param [parentNode] - top element, defaults to document.body 2728 * @param {String} [markerName] - a special attribute to mark every node 2729 * @return {Undo} undo command 2730 */ 2731 var inertOthers = function (originalTarget, parentNode, markerName) { 2732 if (markerName === void 0) { markerName = 'data-inert-ed'; } 2733 var activeParentNode = parentNode || getDefaultParent(originalTarget); 2734 if (!activeParentNode) { 2735 return function () { return null; }; 2736 } 2737 return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); 2738 }; 2739 /** 2740 * @returns if current browser supports inert 2741 */ 2742 var supportsInert = function () { 2743 return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); 2744 }; 2745 /** 2746 * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way 2747 * @param {Element | Element[]} originalTarget - elements to keep on the page 2748 * @param [parentNode] - top element, defaults to document.body 2749 * @param {String} [markerName] - a special attribute to mark every node 2750 * @return {Undo} undo command 2751 */ 2752 var suppressOthers = function (originalTarget, parentNode, markerName) { 2753 if (markerName === void 0) { markerName = 'data-suppressed'; } 2754 return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); 2755 }; 2756 2757 ;// ./node_modules/@radix-ui/react-dialog/dist/index.mjs 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 /* ------------------------------------------------------------------------------------------------- 2792 * Dialog 2793 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog'; 2794 const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME); 2795 const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME); 2796 const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{ 2797 const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props; 2798 const triggerRef = (0,external_React_namespaceObject.useRef)(null); 2799 const contentRef = (0,external_React_namespaceObject.useRef)(null); 2800 const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({ 2801 prop: openProp, 2802 defaultProp: defaultOpen, 2803 onChange: onOpenChange 2804 }); 2805 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogProvider, { 2806 scope: __scopeDialog, 2807 triggerRef: triggerRef, 2808 contentRef: contentRef, 2809 contentId: $1746a345f3d73bb7$export$f680877a34711e37(), 2810 titleId: $1746a345f3d73bb7$export$f680877a34711e37(), 2811 descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(), 2812 open: open, 2813 onOpenChange: setOpen, 2814 onOpenToggle: (0,external_React_namespaceObject.useCallback)(()=>setOpen((prevOpen)=>!prevOpen 2815 ) 2816 , [ 2817 setOpen 2818 ]), 2819 modal: modal 2820 }, children); 2821 }; 2822 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$3ddf2d174ce01153, { 2823 displayName: $5d3850c4d0b4e6c7$var$DIALOG_NAME 2824 }); 2825 /* ------------------------------------------------------------------------------------------------- 2826 * DialogTrigger 2827 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TRIGGER_NAME = 'DialogTrigger'; 2828 const $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2829 const { __scopeDialog: __scopeDialog , ...triggerProps } = props; 2830 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TRIGGER_NAME, __scopeDialog); 2831 const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.triggerRef); 2832 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({ 2833 type: "button", 2834 "aria-haspopup": "dialog", 2835 "aria-expanded": context.open, 2836 "aria-controls": context.contentId, 2837 "data-state": $5d3850c4d0b4e6c7$var$getState(context.open) 2838 }, triggerProps, { 2839 ref: composedTriggerRef, 2840 onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle) 2841 })); 2842 }); 2843 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88, { 2844 displayName: $5d3850c4d0b4e6c7$var$TRIGGER_NAME 2845 }); 2846 /* ------------------------------------------------------------------------------------------------- 2847 * DialogPortal 2848 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal'; 2849 const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, { 2850 forceMount: undefined 2851 }); 2852 const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{ 2853 const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props; 2854 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog); 2855 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$PortalProvider, { 2856 scope: __scopeDialog, 2857 forceMount: forceMount 2858 }, external_React_namespaceObject.Children.map(children, (child)=>/*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { 2859 present: forceMount || context.open 2860 }, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($f1701beae083dbae$export$602eac185826482c, { 2861 asChild: true, 2862 container: container 2863 }, child)) 2864 )); 2865 }; 2866 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$dad7c95542bacce0, { 2867 displayName: $5d3850c4d0b4e6c7$var$PORTAL_NAME 2868 }); 2869 /* ------------------------------------------------------------------------------------------------- 2870 * DialogOverlay 2871 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay'; 2872 const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2873 const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog); 2874 const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props; 2875 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog); 2876 return context.modal ? /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { 2877 present: forceMount || context.open 2878 }, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, { 2879 ref: forwardedRef 2880 }))) : null; 2881 }); 2882 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$bd1d06c79be19e17, { 2883 displayName: $5d3850c4d0b4e6c7$var$OVERLAY_NAME 2884 }); 2885 const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2886 const { __scopeDialog: __scopeDialog , ...overlayProps } = props; 2887 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog); 2888 return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` 2889 // ie. when `Overlay` and `Content` are siblings 2890 (0,external_React_namespaceObject.createElement)(Combination, { 2891 as: $5e63c961fc1ce211$export$8c6ed5c666ac1360, 2892 allowPinchZoom: true, 2893 shards: [ 2894 context.contentRef 2895 ] 2896 }, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({ 2897 "data-state": $5d3850c4d0b4e6c7$var$getState(context.open) 2898 }, overlayProps, { 2899 ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay. 2900 , 2901 style: { 2902 pointerEvents: 'auto', 2903 ...overlayProps.style 2904 } 2905 })))); 2906 }); 2907 /* ------------------------------------------------------------------------------------------------- 2908 * DialogContent 2909 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent'; 2910 const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2911 const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog); 2912 const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props; 2913 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog); 2914 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { 2915 present: forceMount || context.open 2916 }, context.modal ? /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, { 2917 ref: forwardedRef 2918 })) : /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, { 2919 ref: forwardedRef 2920 }))); 2921 }); 2922 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$b6d9565de1e068cf, { 2923 displayName: $5d3850c4d0b4e6c7$var$CONTENT_NAME 2924 }); 2925 /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2926 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog); 2927 const contentRef = (0,external_React_namespaceObject.useRef)(null); 2928 const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal) 2929 (0,external_React_namespaceObject.useEffect)(()=>{ 2930 const content = contentRef.current; 2931 if (content) return hideOthers(content); 2932 }, []); 2933 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, { 2934 ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed 2935 , 2936 trapFocus: context.open, 2937 disableOutsidePointerEvents: true, 2938 onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{ 2939 var _context$triggerRef$c; 2940 event.preventDefault(); 2941 (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); 2942 }), 2943 onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{ 2944 const originalEvent = event.detail.originalEvent; 2945 const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; 2946 const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because 2947 // it is effectively as if we right-clicked the `Overlay`. 2948 if (isRightClick) event.preventDefault(); 2949 }) // When focus is trapped, a `focusout` event may still happen. 2950 , 2951 onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault() 2952 ) 2953 })); 2954 }); 2955 /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2956 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog); 2957 const hasInteractedOutsideRef = (0,external_React_namespaceObject.useRef)(false); 2958 const hasPointerDownOutsideRef = (0,external_React_namespaceObject.useRef)(false); 2959 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, { 2960 ref: forwardedRef, 2961 trapFocus: false, 2962 disableOutsidePointerEvents: false, 2963 onCloseAutoFocus: (event)=>{ 2964 var _props$onCloseAutoFoc; 2965 (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event); 2966 if (!event.defaultPrevented) { 2967 var _context$triggerRef$c2; 2968 if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus 2969 event.preventDefault(); 2970 } 2971 hasInteractedOutsideRef.current = false; 2972 hasPointerDownOutsideRef.current = false; 2973 }, 2974 onInteractOutside: (event)=>{ 2975 var _props$onInteractOuts, _context$triggerRef$c3; 2976 (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event); 2977 if (!event.defaultPrevented) { 2978 hasInteractedOutsideRef.current = true; 2979 if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true; 2980 } // Prevent dismissing when clicking the trigger. 2981 // As the trigger is already setup to close, without doing so would 2982 // cause it to close and immediately open. 2983 const target = event.target; 2984 const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target); 2985 if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked 2986 // we will get the pointer down outside event on the trigger, but then a subsequent 2987 // focus outside event on the container, we ignore any focus outside event when we've 2988 // already had a pointer down outside event. 2989 if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault(); 2990 } 2991 })); 2992 }); 2993 /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 2994 const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props; 2995 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog); 2996 const contentRef = (0,external_React_namespaceObject.useRef)(null); 2997 const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be 2998 // the last element in the DOM (beacuse of the `Portal`) 2999 $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(); 3000 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($d3863c46a17e8a28$export$20e40289641fbbb6, { 3001 asChild: true, 3002 loop: true, 3003 trapped: trapFocus, 3004 onMountAutoFocus: onOpenAutoFocus, 3005 onUnmountAutoFocus: onCloseAutoFocus 3006 }, /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({ 3007 role: "dialog", 3008 id: context.contentId, 3009 "aria-describedby": context.descriptionId, 3010 "aria-labelledby": context.titleId, 3011 "data-state": $5d3850c4d0b4e6c7$var$getState(context.open) 3012 }, contentProps, { 3013 ref: composedRefs, 3014 onDismiss: ()=>context.onOpenChange(false) 3015 }))), false); 3016 }); 3017 /* ------------------------------------------------------------------------------------------------- 3018 * DialogTitle 3019 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle'; 3020 const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 3021 const { __scopeDialog: __scopeDialog , ...titleProps } = props; 3022 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog); 3023 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({ 3024 id: context.titleId 3025 }, titleProps, { 3026 ref: forwardedRef 3027 })); 3028 }); 3029 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$16f7638e4a34b909, { 3030 displayName: $5d3850c4d0b4e6c7$var$TITLE_NAME 3031 }); 3032 /* ------------------------------------------------------------------------------------------------- 3033 * DialogDescription 3034 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription'; 3035 const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 3036 const { __scopeDialog: __scopeDialog , ...descriptionProps } = props; 3037 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog); 3038 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({ 3039 id: context.descriptionId 3040 }, descriptionProps, { 3041 ref: forwardedRef 3042 })); 3043 }); 3044 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5, { 3045 displayName: $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME 3046 }); 3047 /* ------------------------------------------------------------------------------------------------- 3048 * DialogClose 3049 * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose'; 3050 const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ (0,external_React_namespaceObject.forwardRef)((props, forwardedRef)=>{ 3051 const { __scopeDialog: __scopeDialog , ...closeProps } = props; 3052 const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog); 3053 return /*#__PURE__*/ (0,external_React_namespaceObject.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({ 3054 type: "button" 3055 }, closeProps, { 3056 ref: forwardedRef, 3057 onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false) 3058 ) 3059 })); 3060 }); 3061 /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac, { 3062 displayName: $5d3850c4d0b4e6c7$var$CLOSE_NAME 3063 }); 3064 /* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) { 3065 return open ? 'open' : 'closed'; 3066 } 3067 const $5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME = 'DialogTitleWarning'; 3068 const [$5d3850c4d0b4e6c7$export$69b62a49393917d6, $5d3850c4d0b4e6c7$var$useWarningContext] = $c512c27ab02ef895$export$fd42f52fd3ae1109($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME, { 3069 contentName: $5d3850c4d0b4e6c7$var$CONTENT_NAME, 3070 titleName: $5d3850c4d0b4e6c7$var$TITLE_NAME, 3071 docsSlug: 'dialog' 3072 }); 3073 const $5d3850c4d0b4e6c7$var$TitleWarning = ({ titleId: titleId })=>{ 3074 const titleWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME); 3075 const MESSAGE = `\`$titleWarningContext.contentName}\` requires a \`$titleWarningContext.titleName}\` for the component to be accessible for screen reader users. 3076 3077 If you want to hide the \`$titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. 3078 3079 For more information, see https://radix-ui.com/primitives/docs/components/$titleWarningContext.docsSlug}`; 3080 $67UHm$useEffect(()=>{ 3081 if (titleId) { 3082 const hasTitle = document.getElementById(titleId); 3083 if (!hasTitle) throw new Error(MESSAGE); 3084 } 3085 }, [ 3086 MESSAGE, 3087 titleId 3088 ]); 3089 return null; 3090 }; 3091 const $5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning'; 3092 const $5d3850c4d0b4e6c7$var$DescriptionWarning = ({ contentRef: contentRef , descriptionId: descriptionId })=>{ 3093 const descriptionWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME); 3094 const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {$descriptionWarningContext.contentName}}.`; 3095 $67UHm$useEffect(()=>{ 3096 var _contentRef$current; 3097 const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined} 3098 if (descriptionId && describedById) { 3099 const hasDescription = document.getElementById(descriptionId); 3100 if (!hasDescription) console.warn(MESSAGE); 3101 } 3102 }, [ 3103 MESSAGE, 3104 contentRef, 3105 descriptionId 3106 ]); 3107 return null; 3108 }; 3109 const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153; 3110 const $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88)); 3111 const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0; 3112 const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17; 3113 const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf; 3114 const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$16f7638e4a34b909)); 3115 const $5d3850c4d0b4e6c7$export$393edc798c47379d = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5)); 3116 const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = (/* unused pure expression or super */ null && ($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac)); 3117 3118 3119 3120 3121 3122 ;// ./node_modules/cmdk/dist/index.mjs 3123 var V='[cmdk-group=""]',dist_X='[cmdk-group-items=""]',ge='[cmdk-group-heading=""]',dist_Y='[cmdk-item=""]',le=`$dist_Y}:not([aria-disabled="true"])`,Q="cmdk-item-select",M="data-value",Re=(r,o,n)=>W(r,o,n),ue=external_React_namespaceObject.createContext(void 0),dist_G=()=>external_React_namespaceObject.useContext(ue),de=external_React_namespaceObject.createContext(void 0),Z=()=>external_React_namespaceObject.useContext(de),fe=external_React_namespaceObject.createContext(void 0),me=external_React_namespaceObject.forwardRef((r,o)=>{let n=dist_k(()=>{var e,s;return{search:"",value:(s=(e=r.value)!=null?e:r.defaultValue)!=null?s:"",filtered:{count:0,items:new Map,groups:new Set}}}),u=dist_k(()=>new Set),c=dist_k(()=>new Map),d=dist_k(()=>new Map),f=dist_k(()=>new Set),p=pe(r),{label:v,children:b,value:l,onValueChange:y,filter:S,shouldFilter:C,loop:L,disablePointerSelection:ee=!1,vimBindings:j=!0,...H}=r,te=external_React_namespaceObject.useId(),$=external_React_namespaceObject.useId(),K=external_React_namespaceObject.useId(),x=external_React_namespaceObject.useRef(null),g=Me();T(()=>{if(l!==void 0){let e=l.trim();n.current.value=e,h.emit()}},[l]),T(()=>{g(6,re)},[]);let h=external_React_namespaceObject.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,s,i)=>{var a,m,R;if(!Object.is(n.current[e],s)){if(n.current[e]=s,e==="search")z(),q(),g(1,U);else if(e==="value"&&(i||g(5,re),((a=p.current)==null?void 0:a.value)!==void 0)){let E=s!=null?s:"";(R=(m=p.current).onValueChange)==null||R.call(m,E);return}h.emit()}},emit:()=>{f.current.forEach(e=>e())}}),[]),B=external_React_namespaceObject.useMemo(()=>({value:(e,s,i)=>{var a;s!==((a=d.current.get(e))==null?void 0:a.value)&&(d.current.set(e,{value:s,keywords:i}),n.current.filtered.items.set(e,ne(s,i)),g(2,()=>{q(),h.emit()}))},item:(e,s)=>(u.current.add(e),s&&(c.current.has(s)?c.current.get(s).add(e):c.current.set(s,new Set([e]))),g(3,()=>{z(),q(),n.current.value||U(),h.emit()}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let i=O();g(4,()=>{z(),(i==null?void 0:i.getAttribute("id"))===e&&U(),h.emit()})}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e)}),filter:()=>p.current.shouldFilter,label:v||r["aria-label"],disablePointerSelection:ee,listId:te,inputId:K,labelId:$,listInnerRef:x}),[]);function ne(e,s){var a,m;let i=(m=(a=p.current)==null?void 0:a.filter)!=null?m:Re;return e?i(e,n.current.search,s):0}function q(){if(!n.current.search||p.current.shouldFilter===!1)return;let e=n.current.filtered.items,s=[];n.current.filtered.groups.forEach(a=>{let m=c.current.get(a),R=0;m.forEach(E=>{let P=e.get(E);R=Math.max(P,R)}),s.push([a,R])});let i=x.current;A().sort((a,m)=>{var P,_;let R=a.getAttribute("id"),E=m.getAttribute("id");return((P=e.get(E))!=null?P:0)-((_=e.get(R))!=null?_:0)}).forEach(a=>{let m=a.closest(dist_X);m?m.appendChild(a.parentElement===m?a:a.closest(`$dist_X} > *`)):i.appendChild(a.parentElement===i?a:a.closest(`$dist_X} > *`))}),s.sort((a,m)=>m[1]-a[1]).forEach(a=>{let m=x.current.querySelector(`$V}[$M}="$encodeURIComponent(a[0])}"]`);m==null||m.parentElement.appendChild(m)})}function U(){let e=A().find(i=>i.getAttribute("aria-disabled")!=="true"),s=e==null?void 0:e.getAttribute(M);h.setState("value",s||void 0)}function z(){var s,i,a,m;if(!n.current.search||p.current.shouldFilter===!1){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let R of u.current){let E=(i=(s=d.current.get(R))==null?void 0:s.value)!=null?i:"",P=(m=(a=d.current.get(R))==null?void 0:a.keywords)!=null?m:[],_=ne(E,P);n.current.filtered.items.set(R,_),_>0&&e++}for(let[R,E]of c.current)for(let P of E)if(n.current.filtered.items.get(P)>0){n.current.filtered.groups.add(R);break}n.current.filtered.count=e}function re(){var s,i,a;let e=O();e&&(((s=e.parentElement)==null?void 0:s.firstChild)===e&&((a=(i=e.closest(V))==null?void 0:i.querySelector(ge))==null||a.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}))}function O(){var e;return(e=x.current)==null?void 0:e.querySelector(`$dist_Y}[aria-selected="true"]`)}function A(){var e;return Array.from((e=x.current)==null?void 0:e.querySelectorAll(le))}function W(e){let i=A()[e];i&&h.setState("value",i.getAttribute(M))}function J(e){var R;let s=O(),i=A(),a=i.findIndex(E=>E===s),m=i[a+e];(R=p.current)!=null&&R.loop&&(m=a+e<0?i[i.length-1]:a+e===i.length?i[0]:i[a+e]),m&&h.setState("value",m.getAttribute(M))}function oe(e){let s=O(),i=s==null?void 0:s.closest(V),a;for(;i&&!a;)i=e>0?we(i,V):Ie(i,V),a=i==null?void 0:i.querySelector(le);a?h.setState("value",a.getAttribute(M)):J(e)}let ie=()=>W(A().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?oe(1):J(1)},se=e=>{e.preventDefault(),e.metaKey?W(0):e.altKey?oe(-1):J(-1)};return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,tabIndex:-1,...H,"cmdk-root":"",onKeyDown:e=>{var s;if((s=H.onKeyDown)==null||s.call(H,e),!e.defaultPrevented)switch(e.key){case"n":case"j":{j&&e.ctrlKey&&ae(e);break}case"ArrowDown":{ae(e);break}case"p":case"k":{j&&e.ctrlKey&&se(e);break}case"ArrowUp":{se(e);break}case"Home":{e.preventDefault(),W(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":if(!e.nativeEvent.isComposing&&e.keyCode!==229){e.preventDefault();let i=O();if(i){let a=new Event(Q);i.dispatchEvent(a)}}}}},external_React_namespaceObject.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:De},v),F(r,e=>external_React_namespaceObject.createElement(de.Provider,{value:h},external_React_namespaceObject.createElement(ue.Provider,{value:B},e))))}),be=external_React_namespaceObject.forwardRef((r,o)=>{var K,x;let n=external_React_namespaceObject.useId(),u=external_React_namespaceObject.useRef(null),c=external_React_namespaceObject.useContext(fe),d=dist_G(),f=pe(r),p=(x=(K=f.current)==null?void 0:K.forceMount)!=null?x:c==null?void 0:c.forceMount;T(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let v=ve(n,u,[r.value,r.children,u],r.keywords),b=Z(),l=dist_D(g=>g.value&&g.value===v.current),y=dist_D(g=>p||d.filter()===!1?!0:g.search?g.filtered.items.get(n)>0:!0);external_React_namespaceObject.useEffect(()=>{let g=u.current;if(!(!g||r.disabled))return g.addEventListener(Q,S),()=>g.removeEventListener(Q,S)},[y,r.onSelect,r.disabled]);function S(){var g,h;C(),(h=(g=f.current).onSelect)==null||h.call(g,v.current)}function C(){b.setState("value",v.current,!0)}if(!y)return null;let{disabled:L,value:ee,onSelect:j,forceMount:H,keywords:te,...$}=r;return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([u,o]),...$,id:n,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!l,"data-disabled":!!L,"data-selected":!!l,onPointerMove:L||d.disablePointerSelection?void 0:C,onClick:L?void 0:S},r.children)}),he=external_React_namespaceObject.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=external_React_namespaceObject.useId(),p=external_React_namespaceObject.useRef(null),v=external_React_namespaceObject.useRef(null),b=external_React_namespaceObject.useId(),l=dist_G(),y=dist_D(C=>c||l.filter()===!1?!0:C.search?C.filtered.groups.has(f):!0);T(()=>l.group(f),[]),ve(f,p,[r.value,r.heading,v]);let S=external_React_namespaceObject.useMemo(()=>({id:f,forceMount:c}),[c]);return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([p,o]),...d,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&external_React_namespaceObject.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:b},n),F(r,C=>external_React_namespaceObject.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?b:void 0},external_React_namespaceObject.createElement(fe.Provider,{value:S},C))))}),ye=external_React_namespaceObject.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=external_React_namespaceObject.useRef(null),d=dist_D(f=>!f.search);return!n&&!d?null:external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([c,o]),...u,"cmdk-separator":"",role:"separator"})}),Ee=external_React_namespaceObject.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=Z(),f=dist_D(l=>l.search),p=dist_D(l=>l.value),v=dist_G(),b=external_React_namespaceObject.useMemo(()=>{var y;let l=(y=v.listInnerRef.current)==null?void 0:y.querySelector(`$dist_Y}[$M}="$encodeURIComponent(p)}"]`);return l==null?void 0:l.getAttribute("id")},[]);return external_React_namespaceObject.useEffect(()=>{r.value!=null&&d.setState("search",r.value)},[r.value]),external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":b,id:v.inputId,type:"text",value:c?r.value:f,onChange:l=>{c||d.setState("search",l.target.value),n==null||n(l.target.value)}})}),Se=external_React_namespaceObject.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=external_React_namespaceObject.useRef(null),f=external_React_namespaceObject.useRef(null),p=dist_G();return external_React_namespaceObject.useEffect(()=>{if(f.current&&d.current){let v=f.current,b=d.current,l,y=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let S=v.offsetHeight;b.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(v),()=>{cancelAnimationFrame(l),y.unobserve(v)}}},[]),external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:N([d,o]),...c,"cmdk-list":"",role:"listbox","aria-label":u,id:p.listId},F(r,v=>external_React_namespaceObject.createElement("div",{ref:N([f,p.listInnerRef]),"cmdk-list-sizer":""},v)))}),Ce=external_React_namespaceObject.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:n,onOpenChange:u},external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$602eac185826482c,{container:f},external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{"cmdk-overlay":"",className:c}),external_React_namespaceObject.createElement($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{"aria-label":r.label,"cmdk-dialog":"",className:d},external_React_namespaceObject.createElement(me,{ref:o,...p}))))}),xe=external_React_namespaceObject.forwardRef((r,o)=>dist_D(u=>u.filtered.count===0)?external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=external_React_namespaceObject.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return external_React_namespaceObject.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},F(r,f=>external_React_namespaceObject.createElement("div",{"aria-hidden":!0},f)))}),He=Object.assign(me,{List:Se,Item:be,Input:Ee,Group:he,Separator:ye,Dialog:Ce,Empty:xe,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling}}function Ie(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling}}function pe(r){let o=external_React_namespaceObject.useRef(r);return T(()=>{o.current=r}),o}var T=typeof window=="undefined"?external_React_namespaceObject.useEffect:external_React_namespaceObject.useLayoutEffect;function dist_k(r){let o=external_React_namespaceObject.useRef();return o.current===void 0&&(o.current=r()),o}function N(r){return o=>{r.forEach(n=>{typeof n=="function"?n(o):n!=null&&(n.current=o)})}}function dist_D(r){let o=Z(),n=()=>r(o.snapshot());return external_React_namespaceObject.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=external_React_namespaceObject.useRef(),d=dist_G();return T(()=>{var v;let f=(()=>{var b;for(let l of n){if(typeof l=="string")return l.trim();if(typeof l=="object"&&"current"in l)return l.current?(b=l.current.textContent)==null?void 0:b.trim():c.current}})(),p=u.map(b=>b.trim());d.value(r,f,p),(v=o.current)==null||v.setAttribute(M,f),c.current=f}),c}var Me=()=>{let[r,o]=external_React_namespaceObject.useState(),n=dist_k(()=>new Map);return T(()=>{n.current.forEach(u=>u()),n.current=new Map},[r]),(u,c)=>{n.current.set(u,c),o({})}};function Te(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function F({asChild:r,children:o},n){return r&&external_React_namespaceObject.isValidElement(o)?external_React_namespaceObject.cloneElement(Te(o),{ref:o.ref},n(o.props.children)):n(o)}var De={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"}; 3124 3125 ;// ./node_modules/clsx/dist/clsx.mjs 3126 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); 3127 ;// external ["wp","data"] 3128 const external_wp_data_namespaceObject = window["wp"]["data"]; 3129 ;// external ["wp","element"] 3130 const external_wp_element_namespaceObject = window["wp"]["element"]; 3131 ;// external ["wp","i18n"] 3132 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 3133 ;// external ["wp","components"] 3134 const external_wp_components_namespaceObject = window["wp"]["components"]; 3135 ;// external ["wp","keyboardShortcuts"] 3136 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; 3137 ;// ./node_modules/@wordpress/icons/build-module/icon/index.js 3138 /** 3139 * WordPress dependencies 3140 */ 3141 3142 3143 /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ 3144 3145 /** 3146 * Return an SVG icon. 3147 * 3148 * @param {IconProps} props icon is the SVG component to render 3149 * size is a number specifying the icon size in pixels 3150 * Other props will be passed to wrapped SVG component 3151 * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. 3152 * 3153 * @return {JSX.Element} Icon component 3154 */ 3155 function Icon({ 3156 icon, 3157 size = 24, 3158 ...props 3159 }, ref) { 3160 return (0,external_wp_element_namespaceObject.cloneElement)(icon, { 3161 width: size, 3162 height: size, 3163 ...props, 3164 ref 3165 }); 3166 } 3167 /* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); 3168 3169 ;// external ["wp","primitives"] 3170 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 3171 ;// external "ReactJSXRuntime" 3172 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 3173 ;// ./node_modules/@wordpress/icons/build-module/library/search.js 3174 /** 3175 * WordPress dependencies 3176 */ 3177 3178 3179 const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { 3180 xmlns: "http://www.w3.org/2000/svg", 3181 viewBox: "0 0 24 24", 3182 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 3183 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" 3184 }) 3185 }); 3186 /* harmony default export */ const library_search = (search); 3187 3188 ;// ./node_modules/@wordpress/commands/build-module/store/reducer.js 3189 /** 3190 * WordPress dependencies 3191 */ 3192 3193 3194 /** 3195 * Reducer returning the registered commands 3196 * 3197 * @param {Object} state Current state. 3198 * @param {Object} action Dispatched action. 3199 * 3200 * @return {Object} Updated state. 3201 */ 3202 function commands(state = {}, action) { 3203 switch (action.type) { 3204 case 'REGISTER_COMMAND': 3205 return { 3206 ...state, 3207 [action.name]: { 3208 name: action.name, 3209 label: action.label, 3210 searchLabel: action.searchLabel, 3211 context: action.context, 3212 callback: action.callback, 3213 icon: action.icon 3214 } 3215 }; 3216 case 'UNREGISTER_COMMAND': 3217 { 3218 const { 3219 [action.name]: _, 3220 ...remainingState 3221 } = state; 3222 return remainingState; 3223 } 3224 } 3225 return state; 3226 } 3227 3228 /** 3229 * Reducer returning the command loaders 3230 * 3231 * @param {Object} state Current state. 3232 * @param {Object} action Dispatched action. 3233 * 3234 * @return {Object} Updated state. 3235 */ 3236 function commandLoaders(state = {}, action) { 3237 switch (action.type) { 3238 case 'REGISTER_COMMAND_LOADER': 3239 return { 3240 ...state, 3241 [action.name]: { 3242 name: action.name, 3243 context: action.context, 3244 hook: action.hook 3245 } 3246 }; 3247 case 'UNREGISTER_COMMAND_LOADER': 3248 { 3249 const { 3250 [action.name]: _, 3251 ...remainingState 3252 } = state; 3253 return remainingState; 3254 } 3255 } 3256 return state; 3257 } 3258 3259 /** 3260 * Reducer returning the command palette open state. 3261 * 3262 * @param {Object} state Current state. 3263 * @param {Object} action Dispatched action. 3264 * 3265 * @return {boolean} Updated state. 3266 */ 3267 function isOpen(state = false, action) { 3268 switch (action.type) { 3269 case 'OPEN': 3270 return true; 3271 case 'CLOSE': 3272 return false; 3273 } 3274 return state; 3275 } 3276 3277 /** 3278 * Reducer returning the command palette's active context. 3279 * 3280 * @param {Object} state Current state. 3281 * @param {Object} action Dispatched action. 3282 * 3283 * @return {boolean} Updated state. 3284 */ 3285 function context(state = 'root', action) { 3286 switch (action.type) { 3287 case 'SET_CONTEXT': 3288 return action.context; 3289 } 3290 return state; 3291 } 3292 const reducer = (0,external_wp_data_namespaceObject.combineReducers)({ 3293 commands, 3294 commandLoaders, 3295 isOpen, 3296 context 3297 }); 3298 /* harmony default export */ const store_reducer = (reducer); 3299 3300 ;// ./node_modules/@wordpress/commands/build-module/store/actions.js 3301 /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */ 3302 3303 /** 3304 * Configuration of a registered keyboard shortcut. 3305 * 3306 * @typedef {Object} WPCommandConfig 3307 * 3308 * @property {string} name Command name. 3309 * @property {string} label Command label. 3310 * @property {string=} searchLabel Command search label. 3311 * @property {string=} context Command context. 3312 * @property {JSX.Element} icon Command icon. 3313 * @property {Function} callback Command callback. 3314 * @property {boolean} disabled Whether to disable the command. 3315 */ 3316 3317 /** 3318 * @typedef {(search: string) => WPCommandConfig[]} WPCommandLoaderHook hoo 3319 */ 3320 3321 /** 3322 * Command loader config. 3323 * 3324 * @typedef {Object} WPCommandLoaderConfig 3325 * 3326 * @property {string} name Command loader name. 3327 * @property {string=} context Command loader context. 3328 * @property {WPCommandLoaderHook} hook Command loader hook. 3329 * @property {boolean} disabled Whether to disable the command loader. 3330 */ 3331 3332 /** 3333 * Returns an action object used to register a new command. 3334 * 3335 * @param {WPCommandConfig} config Command config. 3336 * 3337 * @return {Object} action. 3338 */ 3339 function registerCommand(config) { 3340 return { 3341 type: 'REGISTER_COMMAND', 3342 ...config 3343 }; 3344 } 3345 3346 /** 3347 * Returns an action object used to unregister a command. 3348 * 3349 * @param {string} name Command name. 3350 * 3351 * @return {Object} action. 3352 */ 3353 function unregisterCommand(name) { 3354 return { 3355 type: 'UNREGISTER_COMMAND', 3356 name 3357 }; 3358 } 3359 3360 /** 3361 * Register command loader. 3362 * 3363 * @param {WPCommandLoaderConfig} config Command loader config. 3364 * 3365 * @return {Object} action. 3366 */ 3367 function registerCommandLoader(config) { 3368 return { 3369 type: 'REGISTER_COMMAND_LOADER', 3370 ...config 3371 }; 3372 } 3373 3374 /** 3375 * Unregister command loader hook. 3376 * 3377 * @param {string} name Command loader name. 3378 * 3379 * @return {Object} action. 3380 */ 3381 function unregisterCommandLoader(name) { 3382 return { 3383 type: 'UNREGISTER_COMMAND_LOADER', 3384 name 3385 }; 3386 } 3387 3388 /** 3389 * Opens the command palette. 3390 * 3391 * @return {Object} action. 3392 */ 3393 function actions_open() { 3394 return { 3395 type: 'OPEN' 3396 }; 3397 } 3398 3399 /** 3400 * Closes the command palette. 3401 * 3402 * @return {Object} action. 3403 */ 3404 function actions_close() { 3405 return { 3406 type: 'CLOSE' 3407 }; 3408 } 3409 3410 ;// ./node_modules/@wordpress/commands/build-module/store/selectors.js 3411 /* wp:polyfill */ 3412 /** 3413 * WordPress dependencies 3414 */ 3415 3416 3417 /** 3418 * Returns the registered static commands. 3419 * 3420 * @param {Object} state State tree. 3421 * @param {boolean} contextual Whether to return only contextual commands. 3422 * 3423 * @return {import('./actions').WPCommandConfig[]} The list of registered commands. 3424 */ 3425 const getCommands = (0,external_wp_data_namespaceObject.createSelector)((state, contextual = false) => Object.values(state.commands).filter(command => { 3426 const isContextual = command.context && command.context === state.context; 3427 return contextual ? isContextual : !isContextual; 3428 }), state => [state.commands, state.context]); 3429 3430 /** 3431 * Returns the registered command loaders. 3432 * 3433 * @param {Object} state State tree. 3434 * @param {boolean} contextual Whether to return only contextual command loaders. 3435 * 3436 * @return {import('./actions').WPCommandLoaderConfig[]} The list of registered command loaders. 3437 */ 3438 const getCommandLoaders = (0,external_wp_data_namespaceObject.createSelector)((state, contextual = false) => Object.values(state.commandLoaders).filter(loader => { 3439 const isContextual = loader.context && loader.context === state.context; 3440 return contextual ? isContextual : !isContextual; 3441 }), state => [state.commandLoaders, state.context]); 3442 3443 /** 3444 * Returns whether the command palette is open. 3445 * 3446 * @param {Object} state State tree. 3447 * 3448 * @return {boolean} Returns whether the command palette is open. 3449 */ 3450 function selectors_isOpen(state) { 3451 return state.isOpen; 3452 } 3453 3454 /** 3455 * Returns whether the active context. 3456 * 3457 * @param {Object} state State tree. 3458 * 3459 * @return {string} Context. 3460 */ 3461 function getContext(state) { 3462 return state.context; 3463 } 3464 3465 ;// ./node_modules/@wordpress/commands/build-module/store/private-actions.js 3466 /** 3467 * Sets the active context. 3468 * 3469 * @param {string} context Context. 3470 * 3471 * @return {Object} action. 3472 */ 3473 function setContext(context) { 3474 return { 3475 type: 'SET_CONTEXT', 3476 context 3477 }; 3478 } 3479 3480 ;// external ["wp","privateApis"] 3481 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 3482 ;// ./node_modules/@wordpress/commands/build-module/lock-unlock.js 3483 /** 3484 * WordPress dependencies 3485 */ 3486 3487 const { 3488 lock, 3489 unlock 3490 } = (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/commands'); 3491 3492 ;// ./node_modules/@wordpress/commands/build-module/store/index.js 3493 /** 3494 * WordPress dependencies 3495 */ 3496 3497 3498 /** 3499 * Internal dependencies 3500 */ 3501 3502 3503 3504 3505 3506 const STORE_NAME = 'core/commands'; 3507 3508 /** 3509 * Store definition for the commands namespace. 3510 * 3511 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore 3512 * 3513 * @type {Object} 3514 * 3515 * @example 3516 * ```js 3517 * import { store as commandsStore } from '@wordpress/commands'; 3518 * import { useDispatch } from '@wordpress/data'; 3519 * ... 3520 * const { open: openCommandCenter } = useDispatch( commandsStore ); 3521 * ``` 3522 */ 3523 const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { 3524 reducer: store_reducer, 3525 actions: actions_namespaceObject, 3526 selectors: selectors_namespaceObject 3527 }); 3528 (0,external_wp_data_namespaceObject.register)(store); 3529 unlock(store).registerPrivateActions(private_actions_namespaceObject); 3530 3531 ;// ./node_modules/@wordpress/commands/build-module/components/command-menu.js 3532 /* wp:polyfill */ 3533 /** 3534 * External dependencies 3535 */ 3536 3537 3538 3539 /** 3540 * WordPress dependencies 3541 */ 3542 3543 3544 3545 3546 3547 3548 3549 /** 3550 * Internal dependencies 3551 */ 3552 3553 3554 const inputLabel = (0,external_wp_i18n_namespaceObject.__)('Search commands and settings'); 3555 function CommandMenuLoader({ 3556 name, 3557 search, 3558 hook, 3559 setLoader, 3560 close 3561 }) { 3562 var _hook; 3563 const { 3564 isLoading, 3565 commands = [] 3566 } = (_hook = hook({ 3567 search 3568 })) !== null && _hook !== void 0 ? _hook : {}; 3569 (0,external_wp_element_namespaceObject.useEffect)(() => { 3570 setLoader(name, isLoading); 3571 }, [setLoader, name, isLoading]); 3572 if (!commands.length) { 3573 return null; 3574 } 3575 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { 3576 children: commands.map(command => { 3577 var _command$searchLabel; 3578 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(He.Item, { 3579 value: (_command$searchLabel = command.searchLabel) !== null && _command$searchLabel !== void 0 ? _command$searchLabel : command.label, 3580 onSelect: () => command.callback({ 3581 close 3582 }), 3583 id: command.name, 3584 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 3585 alignment: "left", 3586 className: dist_clsx('commands-command-menu__item', { 3587 'has-icon': command.icon 3588 }), 3589 children: [command.icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { 3590 icon: command.icon 3591 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 3592 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextHighlight, { 3593 text: command.label, 3594 highlight: search 3595 }) 3596 })] 3597 }) 3598 }, command.name); 3599 }) 3600 }); 3601 } 3602 function CommandMenuLoaderWrapper({ 3603 hook, 3604 search, 3605 setLoader, 3606 close 3607 }) { 3608 // The "hook" prop is actually a custom React hook 3609 // so to avoid breaking the rules of hooks 3610 // the CommandMenuLoaderWrapper component need to be 3611 // remounted on each hook prop change 3612 // We use the key state to make sure we do that properly. 3613 const currentLoaderRef = (0,external_wp_element_namespaceObject.useRef)(hook); 3614 const [key, setKey] = (0,external_wp_element_namespaceObject.useState)(0); 3615 (0,external_wp_element_namespaceObject.useEffect)(() => { 3616 if (currentLoaderRef.current !== hook) { 3617 currentLoaderRef.current = hook; 3618 setKey(prevKey => prevKey + 1); 3619 } 3620 }, [hook]); 3621 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandMenuLoader, { 3622 hook: currentLoaderRef.current, 3623 search: search, 3624 setLoader: setLoader, 3625 close: close 3626 }, key); 3627 } 3628 function CommandMenuGroup({ 3629 isContextual, 3630 search, 3631 setLoader, 3632 close 3633 }) { 3634 const { 3635 commands, 3636 loaders 3637 } = (0,external_wp_data_namespaceObject.useSelect)(select => { 3638 const { 3639 getCommands, 3640 getCommandLoaders 3641 } = select(store); 3642 return { 3643 commands: getCommands(isContextual), 3644 loaders: getCommandLoaders(isContextual) 3645 }; 3646 }, [isContextual]); 3647 if (!commands.length && !loaders.length) { 3648 return null; 3649 } 3650 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(He.Group, { 3651 children: [commands.map(command => { 3652 var _command$searchLabel2; 3653 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(He.Item, { 3654 value: (_command$searchLabel2 = command.searchLabel) !== null && _command$searchLabel2 !== void 0 ? _command$searchLabel2 : command.label, 3655 onSelect: () => command.callback({ 3656 close 3657 }), 3658 id: command.name, 3659 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { 3660 alignment: "left", 3661 className: dist_clsx('commands-command-menu__item', { 3662 'has-icon': command.icon 3663 }), 3664 children: [command.icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { 3665 icon: command.icon 3666 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { 3667 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextHighlight, { 3668 text: command.label, 3669 highlight: search 3670 }) 3671 })] 3672 }) 3673 }, command.name); 3674 }), loaders.map(loader => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandMenuLoaderWrapper, { 3675 hook: loader.hook, 3676 search: search, 3677 setLoader: setLoader, 3678 close: close 3679 }, loader.name))] 3680 }); 3681 } 3682 function CommandInput({ 3683 isOpen, 3684 search, 3685 setSearch 3686 }) { 3687 const commandMenuInput = (0,external_wp_element_namespaceObject.useRef)(); 3688 const _value = dist_D(state => state.value); 3689 const selectedItemId = (0,external_wp_element_namespaceObject.useMemo)(() => { 3690 const item = document.querySelector(`[cmdk-item=""][data-value="$_value}"]`); 3691 return item?.getAttribute('id'); 3692 }, [_value]); 3693 (0,external_wp_element_namespaceObject.useEffect)(() => { 3694 // Focus the command palette input when mounting the modal. 3695 if (isOpen) { 3696 commandMenuInput.current.focus(); 3697 } 3698 }, [isOpen]); 3699 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(He.Input, { 3700 ref: commandMenuInput, 3701 value: search, 3702 onValueChange: setSearch, 3703 placeholder: inputLabel, 3704 "aria-activedescendant": selectedItemId, 3705 icon: search 3706 }); 3707 } 3708 3709 /** 3710 * @ignore 3711 */ 3712 function CommandMenu() { 3713 const { 3714 registerShortcut 3715 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); 3716 const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); 3717 const isOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isOpen(), []); 3718 const { 3719 open, 3720 close 3721 } = (0,external_wp_data_namespaceObject.useDispatch)(store); 3722 const [loaders, setLoaders] = (0,external_wp_element_namespaceObject.useState)({}); 3723 (0,external_wp_element_namespaceObject.useEffect)(() => { 3724 registerShortcut({ 3725 name: 'core/commands', 3726 category: 'global', 3727 description: (0,external_wp_i18n_namespaceObject.__)('Open the command palette.'), 3728 keyCombination: { 3729 modifier: 'primary', 3730 character: 'k' 3731 } 3732 }); 3733 }, [registerShortcut]); 3734 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/commands', /** @type {import('react').KeyboardEventHandler} */ 3735 event => { 3736 // Bails to avoid obscuring the effect of the preceding handler(s). 3737 if (event.defaultPrevented) { 3738 return; 3739 } 3740 event.preventDefault(); 3741 if (isOpen) { 3742 close(); 3743 } else { 3744 open(); 3745 } 3746 }, { 3747 bindGlobal: true 3748 }); 3749 const setLoader = (0,external_wp_element_namespaceObject.useCallback)((name, value) => setLoaders(current => ({ 3750 ...current, 3751 [name]: value 3752 })), []); 3753 const closeAndReset = () => { 3754 setSearch(''); 3755 close(); 3756 }; 3757 if (!isOpen) { 3758 return false; 3759 } 3760 const onKeyDown = event => { 3761 if ( 3762 // Ignore keydowns from IMEs 3763 event.nativeEvent.isComposing || 3764 // Workaround for Mac Safari where the final Enter/Backspace of an IME composition 3765 // is `isComposing=false`, even though it's technically still part of the composition. 3766 // These can only be detected by keyCode. 3767 event.keyCode === 229) { 3768 event.preventDefault(); 3769 } 3770 }; 3771 const isLoading = Object.values(loaders).some(Boolean); 3772 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { 3773 className: "commands-command-menu", 3774 overlayClassName: "commands-command-menu__overlay", 3775 onRequestClose: closeAndReset, 3776 __experimentalHideHeader: true, 3777 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Command palette'), 3778 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { 3779 className: "commands-command-menu__container", 3780 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(He, { 3781 label: inputLabel, 3782 onKeyDown: onKeyDown, 3783 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { 3784 className: "commands-command-menu__header", 3785 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandInput, { 3786 search: search, 3787 setSearch: setSearch, 3788 isOpen: isOpen 3789 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { 3790 icon: library_search 3791 })] 3792 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(He.List, { 3793 label: (0,external_wp_i18n_namespaceObject.__)('Command suggestions'), 3794 children: [search && !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(He.Empty, { 3795 children: (0,external_wp_i18n_namespaceObject.__)('No results found.') 3796 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandMenuGroup, { 3797 search: search, 3798 setLoader: setLoader, 3799 close: closeAndReset, 3800 isContextual: true 3801 }), search && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandMenuGroup, { 3802 search: search, 3803 setLoader: setLoader, 3804 close: closeAndReset 3805 })] 3806 })] 3807 }) 3808 }) 3809 }); 3810 } 3811 3812 ;// ./node_modules/@wordpress/commands/build-module/hooks/use-command-context.js 3813 /** 3814 * WordPress dependencies 3815 */ 3816 3817 3818 3819 /** 3820 * Internal dependencies 3821 */ 3822 3823 3824 3825 /** 3826 * Sets the active context of the command palette 3827 * 3828 * @param {string} context Context to set. 3829 */ 3830 function useCommandContext(context) { 3831 const { 3832 getContext 3833 } = (0,external_wp_data_namespaceObject.useSelect)(store); 3834 const initialContext = (0,external_wp_element_namespaceObject.useRef)(getContext()); 3835 const { 3836 setContext 3837 } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); 3838 (0,external_wp_element_namespaceObject.useEffect)(() => { 3839 setContext(context); 3840 }, [context, setContext]); 3841 3842 // This effects ensures that on unmount, we restore the context 3843 // that was set before the component actually mounts. 3844 (0,external_wp_element_namespaceObject.useEffect)(() => { 3845 const initialContextRef = initialContext.current; 3846 return () => setContext(initialContextRef); 3847 }, [setContext]); 3848 } 3849 3850 ;// ./node_modules/@wordpress/commands/build-module/private-apis.js 3851 /** 3852 * Internal dependencies 3853 */ 3854 3855 3856 3857 /** 3858 * @private 3859 */ 3860 const privateApis = {}; 3861 lock(privateApis, { 3862 useCommandContext: useCommandContext 3863 }); 3864 3865 ;// ./node_modules/@wordpress/commands/build-module/hooks/use-command.js 3866 /** 3867 * WordPress dependencies 3868 */ 3869 3870 3871 3872 /** 3873 * Internal dependencies 3874 */ 3875 3876 3877 /** 3878 * Attach a command to the command palette. Used for static commands. 3879 * 3880 * @param {import('../store/actions').WPCommandConfig} command command config. 3881 * 3882 * @example 3883 * ```js 3884 * import { useCommand } from '@wordpress/commands'; 3885 * import { plus } from '@wordpress/icons'; 3886 * 3887 * useCommand( { 3888 * name: 'myplugin/my-command-name', 3889 * label: __( 'Add new post' ), 3890 * icon: plus, 3891 * callback: ({ close }) => { 3892 * document.location.href = 'post-new.php'; 3893 * close(); 3894 * }, 3895 * } ); 3896 * ``` 3897 */ 3898 function useCommand(command) { 3899 const { 3900 registerCommand, 3901 unregisterCommand 3902 } = (0,external_wp_data_namespaceObject.useDispatch)(store); 3903 const currentCallbackRef = (0,external_wp_element_namespaceObject.useRef)(command.callback); 3904 (0,external_wp_element_namespaceObject.useEffect)(() => { 3905 currentCallbackRef.current = command.callback; 3906 }, [command.callback]); 3907 (0,external_wp_element_namespaceObject.useEffect)(() => { 3908 if (command.disabled) { 3909 return; 3910 } 3911 registerCommand({ 3912 name: command.name, 3913 context: command.context, 3914 label: command.label, 3915 searchLabel: command.searchLabel, 3916 icon: command.icon, 3917 callback: (...args) => currentCallbackRef.current(...args) 3918 }); 3919 return () => { 3920 unregisterCommand(command.name); 3921 }; 3922 }, [command.name, command.label, command.searchLabel, command.icon, command.context, command.disabled, registerCommand, unregisterCommand]); 3923 } 3924 3925 ;// ./node_modules/@wordpress/commands/build-module/hooks/use-command-loader.js 3926 /** 3927 * WordPress dependencies 3928 */ 3929 3930 3931 3932 /** 3933 * Internal dependencies 3934 */ 3935 3936 3937 /** 3938 * Attach a command loader to the command palette. Used for dynamic commands. 3939 * 3940 * @param {import('../store/actions').WPCommandLoaderConfig} loader command loader config. 3941 * 3942 * @example 3943 * ```js 3944 * import { useCommandLoader } from '@wordpress/commands'; 3945 * import { post, page, layout, symbolFilled } from '@wordpress/icons'; 3946 * 3947 * const icons = { 3948 * post, 3949 * page, 3950 * wp_template: layout, 3951 * wp_template_part: symbolFilled, 3952 * }; 3953 * 3954 * function usePageSearchCommandLoader( { search } ) { 3955 * // Retrieve the pages for the "search" term. 3956 * const { records, isLoading } = useSelect( ( select ) => { 3957 * const { getEntityRecords } = select( coreStore ); 3958 * const query = { 3959 * search: !! search ? search : undefined, 3960 * per_page: 10, 3961 * orderby: search ? 'relevance' : 'date', 3962 * }; 3963 * return { 3964 * records: getEntityRecords( 'postType', 'page', query ), 3965 * isLoading: ! select( coreStore ).hasFinishedResolution( 3966 * 'getEntityRecords', 3967 * 'postType', 'page', query ] 3968 * ), 3969 * }; 3970 * }, [ search ] ); 3971 * 3972 * // Create the commands. 3973 * const commands = useMemo( () => { 3974 * return ( records ?? [] ).slice( 0, 10 ).map( ( record ) => { 3975 * return { 3976 * name: record.title?.rendered + ' ' + record.id, 3977 * label: record.title?.rendered 3978 * ? record.title?.rendered 3979 * : __( '(no title)' ), 3980 * icon: icons[ postType ], 3981 * callback: ( { close } ) => { 3982 * const args = { 3983 * postType, 3984 * postId: record.id, 3985 * ...extraArgs, 3986 * }; 3987 * document.location = addQueryArgs( 'site-editor.php', args ); 3988 * close(); 3989 * }, 3990 * }; 3991 * } ); 3992 * }, [ records, history ] ); 3993 * 3994 * return { 3995 * commands, 3996 * isLoading, 3997 * }; 3998 * } 3999 * 4000 * useCommandLoader( { 4001 * name: 'myplugin/page-search', 4002 * hook: usePageSearchCommandLoader, 4003 * } ); 4004 * ``` 4005 */ 4006 function useCommandLoader(loader) { 4007 const { 4008 registerCommandLoader, 4009 unregisterCommandLoader 4010 } = (0,external_wp_data_namespaceObject.useDispatch)(store); 4011 (0,external_wp_element_namespaceObject.useEffect)(() => { 4012 if (loader.disabled) { 4013 return; 4014 } 4015 registerCommandLoader({ 4016 name: loader.name, 4017 hook: loader.hook, 4018 context: loader.context 4019 }); 4020 return () => { 4021 unregisterCommandLoader(loader.name); 4022 }; 4023 }, [loader.name, loader.hook, loader.context, loader.disabled, registerCommandLoader, unregisterCommandLoader]); 4024 } 4025 4026 ;// ./node_modules/@wordpress/commands/build-module/index.js 4027 4028 4029 4030 4031 4032 4033 (window.wp = window.wp || {}).commands = __webpack_exports__; 4034 /******/ })() 4035 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sat Feb 22 08:20:01 2025 | Cross-referenced by PHPXref |