WordPress/wp-includes/js/dist/commands.min.js
Joe McGill ca421dd3c0 Build/Test Tools: Update terser-webpack-plugin.
This bumps the `terser-webpack-plugin` dependency to version `5.3.9`, which fixes an error during the minification process of the `@wordpress/block-library` package during builds.

Props clorith, azaozz, desrosj.
Fixes #58660, See #57657.

Built from https://develop.svn.wordpress.org/trunk@56097


git-svn-id: http://core.svn.wordpress.org/trunk@55609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-28 20:08:46 +00:00

2 lines
45 KiB
JavaScript

/*! This file is auto-generated */
!function(){var e={8670:function(e){var t=1,n=.9,r=.3,o=.1,a=0,c=.999,u=.9999,l=.99,i=/[\\\/\-_+.# \t"@\[\(\{&]/,s=/[\\\/\-_+.# \t"@\[\(\{&]/g;function d(e,f,m,p,v,h){if(h===f.length)return v===e.length?t:l;for(var g,E,b,y=p.charAt(h),w=m.indexOf(y,v),C=0;w>=0;)(g=d(e,f,m,p,w+1,h+1))>C&&(w===v?g*=t:i.test(e.charAt(w-1))?(g*=n,(b=e.slice(v,w-1).match(s))&&v>0&&(g*=Math.pow(c,b.length))):i.test(e.slice(v,w-1))?(g*=a,v>0&&(g*=Math.pow(c,w-v))):(g*=r,v>0&&(g*=Math.pow(c,w-v))),e.charAt(w)!==f.charAt(h)&&(g*=u)),g<o&&m.charAt(w-1)===p.charAt(h+1)&&m.charAt(w-1)!==p.charAt(h)&&(E=d(e,f,m,p,w+1,h+2))*o>g&&(g=E*o),g>C&&(C=g),w=m.indexOf(y,w+1);return C}e.exports=function(e,t){return d(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};!function(){"use strict";n.r(r),n.d(r,{CommandMenu:function(){return Sn},privateApis:function(){return xn},store:function(){return bn},useCommand:function(){return On},useCommandLoader:function(){return kn}});var e={};n.r(e),n.d(e,{close:function(){return an},open:function(){return on},registerCommand:function(){return en},registerCommandLoader:function(){return nn},unregisterCommand:function(){return tn},unregisterCommandLoader:function(){return rn}});var t={};n.r(t),n.d(t,{getCommandLoaders:function(){return fn},getCommands:function(){return dn},getContext:function(){return pn},isOpen:function(){return mn}});var o={};n.r(o),n.d(o,{setContext:function(){return vn}});var a=window.wp.element;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u=window.React;function l(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function i(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function s(...e){return(0,u.useCallback)(i(...e),e)}function d(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return(0,u.useMemo)((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}const f=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?u.useLayoutEffect:()=>{},m=u["useId".toString()]||(()=>{});let p=0;function v(e){const[t,n]=u.useState(m());return f((()=>{e||n((e=>null!=e?e:String(p++)))}),[e]),e||(t?`radix-${t}`:"")}function h(e){const t=(0,u.useRef)(e);return(0,u.useEffect)((()=>{t.current=e})),(0,u.useMemo)((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function g({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=(0,u.useState)(e),[r]=n,o=(0,u.useRef)(r),a=h(t);return(0,u.useEffect)((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,c=a?e:r,l=h(n);return[c,(0,u.useCallback)((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[a,e,o,l])]}var E=window.ReactDOM,b=n.n(E);const y=(0,u.forwardRef)(((e,t)=>{const{children:n,...r}=e,o=u.Children.toArray(n),a=o.find(S);if(a){const e=a.props.children,n=o.map((t=>t===a?u.Children.count(e)>1?u.Children.only(null):(0,u.isValidElement)(e)?e.props.children:null:t));return(0,u.createElement)(w,c({},r,{ref:t}),(0,u.isValidElement)(e)?(0,u.cloneElement)(e,void 0,n):null)}return(0,u.createElement)(w,c({},r,{ref:t}),n)}));y.displayName="Slot";const w=(0,u.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,u.isValidElement)(n)?(0,u.cloneElement)(n,{...x(r,n.props),ref:i(t,n.ref)}):u.Children.count(n)>1?u.Children.only(null):null}));w.displayName="SlotClone";const C=({children:e})=>(0,u.createElement)(u.Fragment,null,e);function S(e){return(0,u.isValidElement)(e)&&e.type===C}function x(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?n[r]=(...e)=>{null==a||a(...e),null==o||o(...e)}:"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}const O=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=(0,u.forwardRef)(((e,n)=>{const{asChild:r,...o}=e,a=r?y:t;return(0,u.useEffect)((()=>{window[Symbol.for("radix-ui")]=!0}),[]),(0,u.createElement)(a,c({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});const k="dismissableLayer.update",R="dismissableLayer.pointerDownOutside",L="dismissableLayer.focusOutside";let N;const D=(0,u.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),A=(0,u.forwardRef)(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:d,...f}=e,m=(0,u.useContext)(D),[p,v]=(0,u.useState)(null),[,g]=(0,u.useState)({}),E=s(t,(e=>v(e))),b=Array.from(m.layers),[y]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(y),C=p?b.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,x=C>=w,A=function(e){const t=h(e),n=(0,u.useRef)(!1),r=(0,u.useRef)((()=>{}));return(0,u.useEffect)((()=>{const e=e=>{if(e.target&&!n.current){const o={originalEvent:e};function a(){_(R,t,o,{discrete:!0})}"touch"===e.pointerType?(document.removeEventListener("click",r.current),r.current=a,document.addEventListener("click",r.current,{once:!0})):a()}n.current=!1},o=window.setTimeout((()=>{document.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",e),document.removeEventListener("click",r.current)}}),[t]),{onPointerDownCapture:()=>n.current=!0}}((e=>{const t=e.target,n=[...m.branches].some((e=>e.contains(t)));x&&!n&&(null==o||o(e),null==i||i(e),e.defaultPrevented||null==d||d())})),P=function(e){const t=h(e),n=(0,u.useRef)(!1);return(0,u.useEffect)((()=>{const e=e=>{if(e.target&&!n.current){_(L,t,{originalEvent:e},{discrete:!1})}};return document.addEventListener("focusin",e),()=>document.removeEventListener("focusin",e)}),[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}((e=>{const t=e.target;[...m.branches].some((e=>e.contains(t)))||(null==a||a(e),null==i||i(e),e.defaultPrevented||null==d||d())}));return function(e){const t=h(e);(0,u.useEffect)((()=>{const e=e=>{"Escape"===e.key&&t(e)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[t])}((e=>{C===m.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))})),(0,u.useEffect)((()=>{if(p)return n&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(N=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),M(),()=>{n&&1===m.layersWithOutsidePointerEventsDisabled.size&&(document.body.style.pointerEvents=N)}}),[p,n,m]),(0,u.useEffect)((()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),M())}),[p,m]),(0,u.useEffect)((()=>{const e=()=>g({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)}),[]),(0,u.createElement)(O.div,c({},f,{ref:E,style:{pointerEvents:S?x?"auto":"none":void 0,...e.style},onFocusCapture:l(e.onFocusCapture,P.onFocusCapture),onBlurCapture:l(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,A.onPointerDownCapture)}))}));function M(){const e=new CustomEvent(k);document.dispatchEvent(e)}function _(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&(0,E.flushSync)((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}const P="focusScope.autoFocusOnMount",T="focusScope.autoFocusOnUnmount",I={bubbles:!1,cancelable:!0},F=(0,u.forwardRef)(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...l}=e,[i,d]=(0,u.useState)(null),f=h(o),m=h(a),p=(0,u.useRef)(null),v=s(t,(e=>d(e))),g=(0,u.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,u.useEffect)((()=>{if(r){function e(e){if(g.paused||!i)return;const t=e.target;i.contains(t)?p.current=t:B(p.current,{select:!0})}function t(e){!g.paused&&i&&(i.contains(e.relatedTarget)||B(p.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,i,g.paused]),(0,u.useEffect)((()=>{if(i){K.add(g);const t=document.activeElement;if(!i.contains(t)){const n=new CustomEvent(P,I);i.addEventListener(P,f),i.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(B(r,{select:t}),document.activeElement!==n)return}((e=j(i),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&B(i))}return()=>{i.removeEventListener(P,f),setTimeout((()=>{const e=new CustomEvent(T,I);i.addEventListener(T,m),i.dispatchEvent(e),e.defaultPrevented||B(null!=t?t:document.body,{select:!0}),i.removeEventListener(T,m),K.remove(g)}),0)}}var e}),[i,f,m,g]);const E=(0,u.useCallback)((e=>{if(!n&&!r)return;if(g.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,a]=function(e){const t=j(e),n=W(t,e),r=W(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&B(a,{select:!0})):(e.preventDefault(),n&&B(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,g.paused]);return(0,u.createElement)(O.div,c({tabIndex:-1},l,{ref:v,onKeyDown:E}))}));function j(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W(e,t){for(const n of e)if(!U(n,{upTo:t}))return n}function U(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function B(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const K=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=$(e,t),e.unshift(t)},remove(t){var n;e=$(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function $(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const q=(0,u.forwardRef)(((e,t)=>{var n;const{container:r=(null===globalThis||void 0===globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...o}=e;return r?b().createPortal((0,u.createElement)(O.div,c({},o,{ref:t})),r):null}));const G=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=(0,u.useState)(),r=(0,u.useRef)({}),o=(0,u.useRef)(e),a=(0,u.useRef)("none"),c=e?"mounted":"unmounted",[l,i]=function(e,t){return(0,u.useReducer)(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,u.useEffect)((()=>{const e=z(r.current);a.current="mounted"===l?e:"none"}),[l]),f((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=z(t);if(e)i("MOUNT");else if("none"===c||"none"===(null==t?void 0:t.display))i("UNMOUNT");else{i(n&&r!==c?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,i]),f((()=>{if(t){const e=e=>{const n=z(r.current).includes(e.animationName);e.target===t&&n&&(0,E.flushSync)((()=>i("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=z(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}i("ANIMATION_END")}),[t,i]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:(0,u.useCallback)((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):u.Children.only(n),a=s(r.ref,o.ref);return"function"==typeof n||r.isPresent?(0,u.cloneElement)(o,{ref:a}):null};function z(e){return(null==e?void 0:e.animationName)||"none"}G.displayName="Presence";let H=0;function V(){(0,u.useEffect)((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:X()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:X()),H++,()=>{1===H&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),H--}}),[])}function X(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Y=function(){return Y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Y.apply(this,arguments)};function Z(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Object.create;function J(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var Q="right-scroll-bar-position",ee="width-before-scroll-bar";function te(e,t){return n=t||null,r=function(t){return e.forEach((function(e){return function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}(e,t)}))},(o=(0,u.useState)((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade;var n,r,o}function ne(e){return e}function re(e,t){void 0===t&&(t=ne);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}};return o}var oe=function(e){void 0===e&&(e={});var t=re(null);return t.options=Y({async:!0,ssr:!1},e),t}(),ae=function(){},ce=u.forwardRef((function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:ae,onWheelCapture:ae,onTouchMoveCapture:ae}),o=r[0],a=r[1],c=e.forwardProps,l=e.children,i=e.className,s=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,g=e.as,E=void 0===g?"div":g,b=Z(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=m,w=te([n,t]),C=Y(Y({},b),o);return u.createElement(u.Fragment,null,d&&u.createElement(y,{sideCar:oe,removeScrollBar:s,shards:f,noIsolation:p,inert:v,setCallbacks:a,allowPinchZoom:!!h,lockRef:n}),c?u.cloneElement(u.Children.only(l),Y(Y({},C),{ref:w})):u.createElement(E,Y({},C,{className:i,ref:w}),l))}));ce.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ce.classNames={fullWidth:ee,zeroRight:Q};var ue,le=function(e){var t=e.sideCar,n=Z(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,Y({},n))};le.isSideCarExport=!0;function ie(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ue||n.nc;return t&&e.setAttribute("nonce",t),e}var se=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=ie())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},de=function(){var e,t=(e=se(),function(t,n){u.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},fe={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},pe=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return fe;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[me(n),me(r),me(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ve=de(),he=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,u=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(u,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(u,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Q," {\n right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(ee," {\n margin-right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(Q," .").concat(Q," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ee," .").concat(ee," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(u,"px;\n }\n")},ge=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r,a=u.useMemo((function(){return pe(o)}),[o]);return u.createElement(ve,{styles:he(a,!t,o,n?"":"!important")})},Ee=!1;if("undefined"!=typeof window)try{var be=Object.defineProperty({},"passive",{get:function(){return Ee=!0,!0}});window.addEventListener("test",be,be),window.removeEventListener("test",be,be)}catch(e){Ee=!1}var ye=!!Ee&&{passive:!1},we=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Ce(e,n)){var r=Se(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Ce=function(e,t){return"v"===e?function(e){var t=window.getComputedStyle(e);return"hidden"!==t.overflowY&&!(t.overflowY===t.overflowX&&"visible"===t.overflowY)}(t):function(e){var t=window.getComputedStyle(e);return"hidden"!==t.overflowX&&!(t.overflowY===t.overflowX&&"visible"===t.overflowX)}(t)},Se=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},xe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Oe=function(e){return[e.deltaX,e.deltaY]},ke=function(e){return e&&"current"in e?e.current:e},Re=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Le=0,Ne=[];var De,Ae=(De=function(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(Le++)[0],a=u.useState((function(){return de()}))[0],c=u.useRef(e);u.useEffect((function(){c.current=e}),[e]),u.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=J([e.lockRef.current],(e.shards||[]).map(ke),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=u.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!c.current.allowPinchZoom;var o,a=xe(e),u=n.current,l="deltaX"in e?e.deltaX:u[0]-a[0],i="deltaY"in e?e.deltaY:u[1]-a[1],s=e.target,d=Math.abs(l)>Math.abs(i)?"h":"v";if("touches"in e&&"h"===d&&"range"===s.type)return!1;var f=we(d,s);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=we(d,s)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||i)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),c=a*r,u=n.target,l=t.contains(u),i=!1,s=c>0,d=0,f=0;do{var m=Se(e,u),p=m[0],v=m[1]-m[2]-a*p;(p||v)&&Ce(e,u)&&(d+=v,f+=p),u=u.parentNode}while(!l&&u!==document.body||l&&(t.contains(u)||t===u));return(s&&(o&&0===d||!o&&c>d)||!s&&(o&&0===f||!o&&-c>f))&&(i=!0),i}(m,t,e,"h"===m?l:i,!0)}),[]),i=u.useCallback((function(e){var n=e;if(Ne.length&&Ne[Ne.length-1]===a){var r="deltaY"in n?Oe(n):xe(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)n.preventDefault();else if(!o){var u=(c.current.shards||[]).map(ke).filter(Boolean).filter((function(e){return e.contains(n.target)}));(u.length>0?l(n,u[0]):!c.current.noIsolation)&&n.preventDefault()}}}),[]),s=u.useCallback((function(e,n,r,o){var a={name:e,delta:n,target:r,should:o};t.current.push(a),setTimeout((function(){t.current=t.current.filter((function(e){return e!==a}))}),1)}),[]),d=u.useCallback((function(e){n.current=xe(e),r.current=void 0}),[]),f=u.useCallback((function(t){s(t.type,Oe(t),t.target,l(t,e.lockRef.current))}),[]),m=u.useCallback((function(t){s(t.type,xe(t),t.target,l(t,e.lockRef.current))}),[]);u.useEffect((function(){return Ne.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",i,ye),document.addEventListener("touchmove",i,ye),document.addEventListener("touchstart",d,ye),function(){Ne=Ne.filter((function(e){return e!==a})),document.removeEventListener("wheel",i,ye),document.removeEventListener("touchmove",i,ye),document.removeEventListener("touchstart",d,ye)}}),[]);var p=e.removeScrollBar,v=e.inert;return u.createElement(u.Fragment,null,v?u.createElement(a,{styles:Re(o)}):null,p?u.createElement(ge,{gapMode:"margin"}):null)},oe.useMedium(De),le),Me=u.forwardRef((function(e,t){return u.createElement(ce,Y({},e,{ref:t,sideCar:Ae}))}));Me.classNames=ce.classNames;var _e=Me,Pe=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Te=new WeakMap,Ie=new WeakMap,Fe={},je=0,We=function(e){return e&&(e.host||We(e.parentNode))},Ue=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=We(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var a=Fe[n],c=[],u=new Set,l=new Set(o),i=function(e){e&&!u.has(e)&&(u.add(e),i(e.parentNode))};o.forEach(i);var s=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(u.has(e))s(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(Te.get(e)||0)+1,i=(a.get(e)||0)+1;Te.set(e,l),a.set(e,i),c.push(e),1===l&&o&&Ie.set(e,!0),1===i&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return s(t),u.clear(),je++,function(){c.forEach((function(e){var t=Te.get(e)-1,o=a.get(e)-1;Te.set(e,t),a.set(e,o),t||(Ie.has(e)||e.removeAttribute(r),Ie.delete(e)),o||e.removeAttribute(n)})),--je||(Te=new WeakMap,Te=new WeakMap,Ie=new WeakMap,Fe={})}},Be=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Pe(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ue(r,o,n,"aria-hidden")):function(){return null}};const Ke="Dialog",[$e,qe]=function(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>(0,u.createContext)(e)));return function(n){const r=(null==n?void 0:n[e])||t;return(0,u.useMemo)((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=(0,u.createContext)(r),a=n.length;function c(t){const{scope:n,children:r,...c}=t,l=(null==n?void 0:n[e][a])||o,i=(0,u.useMemo)((()=>c),Object.values(c));return(0,u.createElement)(l.Provider,{value:i},r)}return n=[...n,r],c.displayName=t+"Provider",[c,function(n,c){const l=(null==c?void 0:c[e][a])||o,i=(0,u.useContext)(l);if(i)return i;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},d(r,...t)]}(Ke),[Ge,ze]=$e(Ke),He=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,l=(0,u.useRef)(null),i=(0,u.useRef)(null),[s=!1,d]=g({prop:r,defaultProp:o,onChange:a});return(0,u.createElement)(Ge,{scope:t,triggerRef:l,contentRef:i,contentId:v(),titleId:v(),descriptionId:v(),open:s,onOpenChange:d,onOpenToggle:(0,u.useCallback)((()=>d((e=>!e))),[d]),modal:c},n)},Ve="DialogPortal",[Xe,Ye]=$e(Ve,{forceMount:void 0}),Ze=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ze(Ve,t);return(0,u.createElement)(Xe,{scope:t,forceMount:n},u.Children.map(r,(e=>(0,u.createElement)(G,{present:n||a.open},(0,u.createElement)(q,{asChild:!0,container:o},e)))))},Je="DialogOverlay",Qe=(0,u.forwardRef)(((e,t)=>{const n=Ye(Je,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ze(Je,e.__scopeDialog);return a.modal?(0,u.createElement)(G,{present:r||a.open},(0,u.createElement)(et,c({},o,{ref:t}))):null})),et=(0,u.forwardRef)(((e,t)=>{const{__scopeDialog:n,...r}=e,o=ze(Je,n);return(0,u.createElement)(_e,{as:y,allowPinchZoom:!0,shards:[o.contentRef]},(0,u.createElement)(O.div,c({"data-state":ut(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))})),tt="DialogContent",nt=(0,u.forwardRef)(((e,t)=>{const n=Ye(tt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ze(tt,e.__scopeDialog);return(0,u.createElement)(G,{present:r||a.open},a.modal?(0,u.createElement)(rt,c({},o,{ref:t})):(0,u.createElement)(ot,c({},o,{ref:t})))})),rt=(0,u.forwardRef)(((e,t)=>{const n=ze(tt,e.__scopeDialog),r=(0,u.useRef)(null),o=s(t,n.contentRef,r);return(0,u.useEffect)((()=>{const e=r.current;if(e)return Be(e)}),[]),(0,u.createElement)(at,c({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:l(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:l(e.onFocusOutside,(e=>e.preventDefault()))}))})),ot=(0,u.forwardRef)(((e,t)=>{const n=ze(tt,e.__scopeDialog),r=(0,u.useRef)(!1);return(0,u.createElement)(at,c({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,a;(null===(o=e.onCloseAutoFocus)||void 0===o||o.call(e,t),t.defaultPrevented)||(r.current||null===(a=n.triggerRef.current)||void 0===a||a.focus(),t.preventDefault());r.current=!1},onInteractOutside:t=>{var o,a;null===(o=e.onInteractOutside)||void 0===o||o.call(e,t),t.defaultPrevented||(r.current=!0);const c=t.target;(null===(a=n.triggerRef.current)||void 0===a?void 0:a.contains(c))&&t.preventDefault()}}))})),at=(0,u.forwardRef)(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...l}=e,i=ze(tt,n),d=s(t,(0,u.useRef)(null));return V(),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(F,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a},(0,u.createElement)(A,c({role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ut(i.open)},l,{ref:d,onDismiss:()=>i.onOpenChange(!1)}))),!1)})),ct="DialogTitle";function ut(e){return e?"open":"closed"}const lt="DialogTitleWarning",[it,st]=function(e,t){const n=(0,u.createContext)(t);function r(e){const{children:t,...r}=e,o=(0,u.useMemo)((()=>r),Object.values(r));return(0,u.createElement)(n.Provider,{value:o},t)}return r.displayName=e+"Provider",[r,function(r){const o=(0,u.useContext)(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(lt,{contentName:tt,titleName:ct,docsSlug:"dialog"}),dt=He,ft=Ze,mt=Qe,pt=nt;var vt=n(8670),ht='[cmdk-group=""]',gt='[cmdk-group-items=""]',Et='[cmdk-item=""]',bt=`${Et}:not([aria-disabled="true"])`,yt="cmdk-item-select",wt="data-value",Ct=(e,t)=>vt(e,t),St=u.createContext(void 0),xt=()=>u.useContext(St),Ot=u.createContext(void 0),kt=()=>u.useContext(Ot),Rt=u.createContext(void 0),Lt=u.forwardRef(((e,t)=>{let n=u.useRef(null),r=Kt((()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}}))),o=Kt((()=>new Set)),a=Kt((()=>new Map)),c=Kt((()=>new Map)),l=Kt((()=>new Set)),i=Ut(e),{label:s,children:d,value:f,onValueChange:m,filter:p,shouldFilter:v,...h}=e,g=u.useId(),E=u.useId(),b=u.useId(),y=zt();Bt((()=>{if(void 0!==f){let e=f.trim().toLowerCase();r.current.value=e,y(6,R),w.emit()}}),[f]);let w=u.useMemo((()=>({subscribe:e=>(l.current.add(e),()=>l.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,c;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)k(),x(),y(1,O);else if("value"===e){if(void 0!==(null==(o=i.current)?void 0:o.value))return void(null==(c=(a=i.current).onValueChange)||c.call(a,t));n||y(5,R)}w.emit()}},emit:()=>{l.current.forEach((e=>e()))}})),[]),C=u.useMemo((()=>({value:(e,t)=>{t!==c.current.get(e)&&(c.current.set(e,t),r.current.filtered.items.set(e,S(t)),y(2,(()=>{x(),w.emit()})))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),y(3,(()=>{k(),x(),r.current.value||O(),w.emit()})),()=>{c.current.delete(e),o.current.delete(e),r.current.filtered.items.delete(e),y(4,(()=>{k(),O(),w.emit()}))}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{c.current.delete(e),a.current.delete(e)}),filter:()=>i.current.shouldFilter,label:s||e["aria-label"],listId:g,inputId:b,labelId:E})),[]);function S(e){var t;let n=(null==(t=i.current)?void 0:t.filter)??Ct;return e?n(e,r.current.search):0}function x(){if(!n.current||!r.current.search||!1===i.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach((n=>{let r=a.current.get(n),o=0;r.forEach((t=>{let n=e.get(t);o=Math.max(n,o)})),t.push([n,o])}));let o=n.current.querySelector('[cmdk-list-sizer=""]');N().sort(((t,n)=>{let r=t.getAttribute(wt),o=n.getAttribute(wt);return(e.get(o)??0)-(e.get(r)??0)})).forEach((e=>{let t=e.closest(gt);t?t.appendChild(e.parentElement===t?e:e.closest(`${gt} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${gt} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=n.current.querySelector(`${ht}[${wt}="${e[0]}"]`);null==t||t.parentElement.appendChild(t)}))}function O(){let e=N().find((e=>!e.ariaDisabled)),t=null==e?void 0:e.getAttribute(wt);w.setState("value",t||void 0)}function k(){if(!r.current.search||!1===i.current.shouldFilter)return void(r.current.filtered.count=o.current.size);r.current.filtered.groups=new Set;let e=0;for(let t of o.current){let n=S(c.current.get(t));r.current.filtered.items.set(t,n),n>0&&e++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=e}function R(){var e,t,n;let r=L();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(ht))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function L(){return n.current.querySelector(`${Et}[aria-selected="true"]`)}function N(){return Array.from(n.current.querySelectorAll(bt))}function D(e){let t=N()[e];t&&w.setState("value",t.getAttribute(wt))}function A(e){var t;let n=L(),r=N(),o=r.findIndex((e=>e===n)),a=r[o+e];null!=(t=i.current)&&t.loop&&(a=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),a&&w.setState("value",a.getAttribute(wt))}function M(e){let t,n=L(),r=null==n?void 0:n.closest(ht);for(;r&&!t;)r=e>0?jt(r,ht):Wt(r,ht),t=null==r?void 0:r.querySelector(bt);t?w.setState("value",t.getAttribute(wt)):A(e)}let _=()=>D(N().length-1),P=e=>{e.preventDefault(),e.metaKey?_():e.altKey?M(1):A(1)},T=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?M(-1):A(-1)};return u.createElement("div",{ref:$t([n,t]),...h,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=h.onKeyDown)||t.call(h,e),!e.defaultPrevented)switch(e.key){case"n":case"j":e.ctrlKey&&P(e);break;case"ArrowDown":P(e);break;case"p":case"k":e.ctrlKey&&T(e);break;case"ArrowUp":T(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),_();break;case"Enter":{e.preventDefault();let t=L();if(t){let e=new Event(yt);t.dispatchEvent(e)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Ht},s),u.createElement(Ot.Provider,{value:w},u.createElement(St.Provider,{value:C},d)))})),Nt=u.forwardRef(((e,t)=>{let n=u.useId(),r=u.useRef(null),o=u.useContext(Rt),a=xt(),c=Ut(e);Bt((()=>a.item(n,o)),[]);let l=Gt(n,r,[e.value,e.children,r]),i=kt(),s=qt((e=>e.value&&e.value===l.current)),d=qt((e=>!1===a.filter()||(!e.search||e.filtered.items.get(n)>0)));function f(){var e,t;null==(t=(e=c.current).onSelect)||t.call(e,l.current)}if(u.useEffect((()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(yt,f),()=>t.removeEventListener(yt,f)}),[d,e.onSelect,e.disabled]),!d)return null;let{disabled:m,value:p,onSelect:v,...h}=e;return u.createElement("div",{ref:$t([r,t]),...h,"cmdk-item":"",role:"option","aria-disabled":m||void 0,"aria-selected":s||void 0,"data-selected":s||void 0,onPointerMove:m?void 0:function(){i.setState("value",l.current,!0)},onClick:m?void 0:f},e.children)})),Dt=u.forwardRef(((e,t)=>{let{heading:n,children:r,...o}=e,a=u.useId(),c=u.useRef(null),l=u.useRef(null),i=u.useId(),s=xt(),d=qt((e=>!1===s.filter()||(!e.search||e.filtered.groups.has(a))));Bt((()=>s.group(a)),[]),Gt(a,c,[e.value,e.heading,l]);let f=u.createElement(Rt.Provider,{value:a},r);return u.createElement("div",{ref:$t([c,t]),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&u.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:i},n),u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?i:void 0},f))})),At=u.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=u.useRef(null),a=qt((e=>!e.search));return n||a?u.createElement("div",{ref:$t([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),Mt=u.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,a=kt(),c=qt((e=>e.search)),l=xt();return u.useEffect((()=>{null!=e.value&&a.setState("search",e.value)}),[e.value]),u.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,id:l.inputId,type:"text",value:o?e.value:c,onChange:e=>{o||a.setState("search",e.target.value),null==n||n(e.target.value)}})})),_t=u.forwardRef(((e,t)=>{let{children:n,...r}=e,o=u.useRef(null),a=u.useRef(null),c=xt();return u.useEffect((()=>{if(a.current&&o.current){let e,t=a.current,n=o.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{let e=t.getBoundingClientRect().height;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),u.createElement("div",{ref:$t([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:c.listId,"aria-labelledby":c.inputId},u.createElement("div",{ref:a,"cmdk-list-sizer":""},n))})),Pt=u.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,container:o,...a}=e;return u.createElement(dt,{open:n,onOpenChange:r},u.createElement(ft,{container:o},u.createElement(mt,{"cmdk-overlay":""}),u.createElement(pt,{"aria-label":e.label,"cmdk-dialog":""},u.createElement(Lt,{ref:t,...a}))))})),Tt=u.forwardRef(((e,t)=>{let n=u.useRef(!0),r=qt((e=>0===e.filtered.count));return u.useEffect((()=>{n.current=!1}),[]),n.current||!r?null:u.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})})),It=u.forwardRef(((e,t)=>{let{progress:n,children:r,...o}=e;return u.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},u.createElement("div",{"aria-hidden":!0},r))})),Ft=Object.assign(Lt,{List:_t,Item:Nt,Input:Mt,Group:Dt,Separator:At,Dialog:Pt,Empty:Tt,Loading:It});function jt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Wt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ut(e){let t=u.useRef(e);return Bt((()=>{t.current=e})),t}var Bt=typeof window>"u"?u.useEffect:u.useLayoutEffect;function Kt(e){let t=u.useRef();return void 0===t.current&&(t.current=e()),t}function $t(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function qt(e){let t=kt(),n=()=>e(t.snapshot());return u.useSyncExternalStore(t.subscribe,n,n)}function Gt(e,t,n){let r=u.useRef(),o=xt();return Bt((()=>{var a;let c=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim().toLowerCase();if("object"==typeof t&&"current"in t&&t.current)return null==(e=t.current.textContent)?void 0:e.trim().toLowerCase()}})();o.value(e,c),null==(a=t.current)||a.setAttribute(wt,c),r.current=c})),r}var zt=()=>{let[e,t]=u.useState(),n=Kt((()=>new Map));return Bt((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}},Ht={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},Vt=window.wp.data,Xt=window.wp.i18n,Yt=window.wp.components,Zt=window.wp.keyboardShortcuts;var Jt=function({icon:e,size:t=24,...n}){return(0,a.cloneElement)(e,{width:t,height:t,...n})};var Qt=(0,Vt.combineReducers)({commands:function(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,callback:t.callback,icon:t.icon}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...r}=e;return r}}return e},commandLoaders:function(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...r}=e;return r}}return e},isOpen:function(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e},context:function(e="root",t){return"SET_CONTEXT"===t.type?t.context:e}});function en(e){return{type:"REGISTER_COMMAND",...e}}function tn(e){return{type:"UNREGISTER_COMMAND",name:e}}function nn(e){return{type:"REGISTER_COMMAND_LOADER",...e}}function rn(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function on(){return{type:"OPEN"}}function an(){return{type:"CLOSE"}}var cn={};function un(e){return[e]}function ln(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function sn(e,t){var n,r=t||un;function o(){n=new WeakMap}function a(){var t,o,a,c,u,l=arguments.length;for(c=new Array(l),a=0;a<l;a++)c[a]=arguments[a];for(t=function(e){var t,r,o,a,c,u=n,l=!0;for(t=0;t<e.length;t++){if(!(c=r=e[t])||"object"!=typeof c){l=!1;break}u.has(r)?u=u.get(r):(o=new WeakMap,u.set(r,o),u=o)}return u.has(cn)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,u.set(cn,a)),u.get(cn)}(u=r.apply(null,c)),t.isUniqueByDependants||(t.lastDependants&&!ln(u,t.lastDependants,0)&&t.clear(),t.lastDependants=u),o=t.head;o;){if(ln(o.args,c,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,c)},c[0]=null,o.args=c,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}const dn=sn(((e,t=!1)=>Object.values(e.commands).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commands,e.context])),fn=sn(((e,t=!1)=>Object.values(e.commandLoaders).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commandLoaders,e.context]));function mn(e){return e.isOpen}function pn(e){return e.context}function vn(e){return{type:"SET_CONTEXT",context:e}}var hn=window.wp.privateApis;const{lock:gn,unlock:En}=(0,hn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/commands"),bn=(0,Vt.createReduxStore)("core/commands",{reducer:Qt,actions:e,selectors:t});function yn({name:e,search:t,hook:n,setLoader:r,close:o}){var c;const{isLoading:u,commands:l=[]}=null!==(c=n({search:t}))&&void 0!==c?c:{};return(0,a.useEffect)((()=>{r(e,u)}),[r,e,u]),l.length?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ft.List,null,l.map((e=>{var n;return(0,a.createElement)(Ft.Item,{key:e.name,value:null!==(n=e.searchLabel)&&void 0!==n?n:e.label,onSelect:()=>e.callback({close:o})},(0,a.createElement)(Yt.__experimentalHStack,{alignment:"left",className:"commands-command-menu__item"},(0,a.createElement)(Jt,{icon:e.icon}),(0,a.createElement)("span",null,(0,a.createElement)(Yt.TextHighlight,{text:e.label,highlight:t}))))})))):null}function wn({hook:e,search:t,setLoader:n,close:r}){const o=(0,a.useRef)(e),[c,u]=(0,a.useState)(0);return(0,a.useEffect)((()=>{o.current!==e&&(o.current=e,u((e=>e+1)))}),[e]),(0,a.createElement)(yn,{key:c,hook:o.current,search:t,setLoader:n,close:r})}function Cn({isContextual:e,search:t,setLoader:n,close:r}){const{commands:o,loaders:c}=(0,Vt.useSelect)((t=>{const{getCommands:n,getCommandLoaders:r}=t(bn);return{commands:n(e),loaders:r(e)}}),[e]);return o.length||c.length?(0,a.createElement)(Ft.Group,null,o.map((e=>{var n;return(0,a.createElement)(Ft.Item,{key:e.name,value:null!==(n=e.searchLabel)&&void 0!==n?n:e.label,onSelect:()=>e.callback({close:r})},(0,a.createElement)(Yt.__experimentalHStack,{alignment:"left",className:"commands-command-menu__item"},(0,a.createElement)(Jt,{icon:e.icon}),(0,a.createElement)("span",null,(0,a.createElement)(Yt.TextHighlight,{text:e.label,highlight:t}))))})),c.map((e=>(0,a.createElement)(wn,{key:e.name,hook:e.hook,search:t,setLoader:n,close:r})))):null}function Sn(){const{registerShortcut:e}=(0,Vt.useDispatch)(Zt.store),[t,n]=(0,a.useState)(""),r=(0,Vt.useSelect)((e=>e(bn).isOpen()),[]),{open:o,close:c}=(0,Vt.useDispatch)(bn),[u,l]=(0,a.useState)({}),i=(0,a.useRef)();(0,a.useEffect)((()=>{e({name:"core/commands",category:"global",description:(0,Xt.__)("Open the global command menu"),keyCombination:{modifier:"primary",character:"k"}})}),[e]),(0,Zt.useShortcut)("core/commands",(e=>{e.preventDefault(),r?c():o()}),{bindGlobal:!0});const s=(0,a.useCallback)(((e,t)=>l((n=>({...n,[e]:t})))),[]),d=()=>{n(""),c()};if((0,a.useEffect)((()=>{r&&i.current.focus()}),[r]),!r)return!1;const f=Object.values(u).some(Boolean);return(0,a.createElement)(Yt.Modal,{className:"commands-command-menu",overlayClassName:"commands-command-menu__overlay",onRequestClose:d,__experimentalHideHeader:!0},(0,a.createElement)("div",{className:"commands-command-menu__container"},(0,a.createElement)(Ft,{label:(0,Xt.__)("Global Command Menu")},(0,a.createElement)("div",{className:"commands-command-menu__header"},(0,a.createElement)(Ft.Input,{ref:i,value:t,onValueChange:n,placeholder:(0,Xt.__)("Type a command or search")})),(0,a.createElement)(Ft.List,null,t&&!f&&(0,a.createElement)(Ft.Empty,null,(0,Xt.__)("No results found.")),(0,a.createElement)(Cn,{search:t,setLoader:s,close:d,isContextual:!0}),t&&(0,a.createElement)(Cn,{search:t,setLoader:s,close:d})))))}(0,Vt.register)(bn),En(bn).registerPrivateActions(o);const xn={};function On(e){const{registerCommand:t,unregisterCommand:n}=(0,Vt.useDispatch)(bn),r=(0,a.useRef)(e.callback);(0,a.useEffect)((()=>{r.current=e.callback}),[e.callback]),(0,a.useEffect)((()=>(t({name:e.name,context:e.context,label:e.label,searchLabel:e.searchLabel,icon:e.icon,callback:(...e)=>r.current(...e)}),()=>{n(e.name)})),[e.name,e.label,e.searchLabel,e.icon,e.context,t,n])}function kn(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=(0,Vt.useDispatch)(bn);(0,a.useEffect)((()=>(t({name:e.name,hook:e.hook,context:e.context}),()=>{n(e.name)})),[e.name,e.hook,e.context,t,n])}gn(xn,{useCommandContext:function(e){const{getContext:t}=(0,Vt.useSelect)(bn),n=(0,a.useRef)(t()),{setContext:r}=En((0,Vt.useDispatch)(bn));(0,a.useEffect)((()=>{r(e)}),[e,r]),(0,a.useEffect)((()=>{const e=n.current;return()=>r(e)}),[r])}})}(),(window.wp=window.wp||{}).commands=r}();