WordPress/wp-includes/js/dist/commands.min.js

2 lines
45 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{var e={6007:e=>{var t=1,n=.9,r=.3,o=.1,a=0,c=.999,u=.9999,i=.99,l=/[\\\/\-_+.# \t"@\[\(\{&]/,s=/[\\\/\-_+.# \t"@\[\(\{&]/g;function d(e,f,m,p,v,h){if(h===f.length)return v===e.length?t:i;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:l.test(e.charAt(w-1))?(g*=n,(b=e.slice(v,w-1).match(s))&&v>0&&(g*=Math.pow(c,b.length))):l.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=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=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={};(()=>{"use strict";n.r(r),n.d(r,{CommandMenu:()=>On,privateApis:()=>kn,store:()=>yn,useCommand:()=>Ln,useCommandLoader:()=>An});var e={};n.r(e),n.d(e,{close:()=>dn,open:()=>sn,registerCommand:()=>an,registerCommandLoader:()=>un,unregisterCommand:()=>cn,unregisterCommandLoader:()=>ln});var t={};n.r(t),n.d(t,{getCommandLoaders:()=>mn,getCommands:()=>fn,getContext:()=>vn,isOpen:()=>pn});var o={};function a(){return a=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},a.apply(this,arguments)}n.r(o),n.d(o,{setContext:()=>hn});const c=window.React;function u(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 l(...e){return(0,c.useCallback)(i(...e),e)}function s(...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,c.useMemo)((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}const d=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?c.useLayoutEffect:()=>{},f=c["useId".toString()]||(()=>{});let m=0;function p(e){const[t,n]=c.useState(f());return d((()=>{e||n((e=>null!=e?e:String(m++)))}),[e]),e||(t?`radix-${t}`:"")}function v(e){const t=(0,c.useRef)(e);return(0,c.useEffect)((()=>{t.current=e})),(0,c.useMemo)((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function h({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=(0,c.useState)(e),[r]=n,o=(0,c.useRef)(r),a=v(t);return(0,c.useEffect)((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,u=a?e:r,i=v(n);return[u,(0,c.useCallback)((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&i(n)}else o(t)}),[a,e,o,i])]}const g=window.ReactDOM;var E=n.n(g);const b=(0,c.forwardRef)(((e,t)=>{const{children:n,...r}=e,o=c.Children.toArray(n),u=o.find(C);if(u){const e=u.props.children,n=o.map((t=>t===u?c.Children.count(e)>1?c.Children.only(null):(0,c.isValidElement)(e)?e.props.children:null:t));return(0,c.createElement)(y,a({},r,{ref:t}),(0,c.isValidElement)(e)?(0,c.cloneElement)(e,void 0,n):null)}return(0,c.createElement)(y,a({},r,{ref:t}),n)}));b.displayName="Slot";const y=(0,c.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,c.isValidElement)(n)?(0,c.cloneElement)(n,{...S(r,n.props),ref:i(t,n.ref)}):c.Children.count(n)>1?c.Children.only(null):null}));y.displayName="SlotClone";